Skip to content

GLM CUDA: bound the peer warm-up after NCCL init (part of #2347) - #2512

Merged
ashhart merged 1 commit into
mainfrom
lead/glm-warmup-bound
Nov 8, 2026
Merged

ashhart merged 1 commit into
mainfrom
lead/glm-warmup-bound

Conversation

@ashhart

@ashhart ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Part of #2347. GLM at TP=2 could wait forever at startup when a peer never answered the 4 MiB warm-up exchange after NCCL init. #2354 added warnings; this adds the bound described on the issue.

  • A fixed 300 s deadline around the existing warm-up, covering the post, the stream synchronization and its cleanup, before weights load. 300 s is the same as RankNeverCame (zig/src/cuda/tp_watch.zig:88). There is no new setting, and NCCL init itself stays logged, not bounded.
  • On expiry, the rank publishes PeerWarmupTimedOut over the rank liveness lines, aborts its communicator and stops. It logs the peers this exchange waited on (direct or ring, the same selection as posting) and the NCCL transport it saw. It publishes before aborting, because the abort can unblock a call with a less specific NCCL error.
  • Unchanged: the buffer size, stream flags, send/receive order and offsets, the group closure and the synchronization body. The post function is byte-identical to main, and so are the GPU kernels, NCCL init and the startup logs. A single rank still skips the warm-up.

Tests, host only: the real warm-up runs over fake CUDA and NCCL calls. For each TP=2 rank as origin, a peer that never answers, during posting, stream completion or cleanup, stops every rank with PeerWarmupTimedOut naming the peer. That test fails on main (expected error.PeerWarmupTimedOut, found void) and passes here. The control is a peer that answers at 99 ms against a 100 ms test deadline: it completes with no abort, notification or stop. A formatter fixture checks the ring's peer lists. Lean shows nothing new, every file is at or under 600 lines, and the Linux CUDA host build cross-compiles.

A healthy TP=2 start on two GB10s is queued to check nothing changes when peers do answer.

@ashhart
ashhart force-pushed the lead/glm-warmup-bound branch from dd118d1 to 86e0e59 Compare November 8, 2026 03:55
@ashhart

ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

A normal TP=2 start on two GB10s with GLM-5.3-Flash NVFP4, main against this branch (base, new, new, base): every rank came up, tokens equal in all 52 cells, prefill and decode within ±0.5%, resumed chats qualified. The bound changes nothing when peers answer. Queued.

Give the existing 4 MiB peer exchange a 300-second deadline, including blocking postings and stream cleanup. Name the waited peers and captured transport, notify rank liveness before aborting the communicator, and stop without joining stuck CUDA work.

Keep NCCL init logged and unbounded. Host fakes cover missing peers in both ranks, completion just inside the bound and the actual named liveness record. Refs #2347.
@ashhart
ashhart force-pushed the lead/glm-warmup-bound branch from 86e0e59 to 2d412b9 Compare November 8, 2026 08:48
@ashhart
ashhart merged commit 7ead07c into main Nov 8, 2026
3 of 7 checks passed
ashhart added a commit that referenced this pull request Nov 8, 2026
…nged since 18b3b69

The test stops at its first mismatch, so only contract_controls.cu. failed first Hashing every
row with the test's own rules finds 16. For each, the last commit whose bytes match the pin was
found in topological order (rebased commits keep older author dates). Every change since is a
merged commit whose diff matches its message. The kernel ones carry their contract or SASS
evidence:

- contract_controls.cu: cf637be, 390ef29, 94a9a48 (controls for the LFM2 glue, the Liquid
  conv and the head-64 paged attention), then 6b81d9b (declares P256, IDS and PN off, which the
  prompt-row fragment reads since 47bd0d5 and 00dddc5).
- nemotron_attention.cu, prefill_attention.cu and prefill_attention_rows.cuh: 82f3dde and
  94a9a48 (head-64 paged attention, moved helpers; sassid: existing functions unchanged).
- qmmf.cu, qmmf.zig: ec76abd and c3acc34 (BF16 prompt tile and K32 staging, bytes unchanged
  under the contract), fbf8d96 (that tile for Flash Next only), 6a1feb2 (TF_QMMF_HALF_BELOW).
- aot.zig 3a7e6fa; carveout.zig 6a1feb2; kernels.zig cf637be: one export or reader each.
- root.zig ffe9b36, 13d7450 and tp_watch.zig 13d7450, 7ead07c (#2354; #2512).
- Flash Next cuda_batch, cuda_batch_state, cuda_lanes, cuda_mtp_ops, cuda_snap: 4f6017c (marks
  kept inside the pass), 4b2679b (grouped draft head's page table), fbca907 (#2391),
  ec76abd (reserveRows).

Seven of these (root.zig, the Flash Next files and part of tp_watch.zig) changed before
18b3b69 and were already stale there. Each changed row gets a note column naming its commits,
or that note appended to the existing one. Modes and paths are unchanged.
pocket-serving-approved.tsv is unchanged.

test-gradient-serving: 1 of 1.
@ashhart
ashhart deleted the lead/glm-warmup-bound branch November 10, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant