Repository navigation
Nemotron 3.5 Super TP=2 on CUDA: one header a decode window, one message a layer - #2839
Conversation
|
An independent read found one gap, now closed in
|
a9ca692 to
910cec5
Compare
…ward.zig back under 600 (#2839) On main 3f1290f the TP=2 job headers take zig/src/families/nemotron/cuda_forward.zig to 610 lines. The window profile's timing types, Class and Marks (tf-cuda-test window-profile's events), move unchanged to cuda_window_marks.zig; cuda_forward.zig re-exports both names, so every caller is as it was. 597 lines.
…ayer A window's latent MoE jobs to rank 1 go under one pass header (rows, job count, layer mask) in the fixed first message; every later job sends only its rows, at the size that header gave. Rank 1 reads one header a window, then queues each layer's receive, partials and reply with no host read between. A job's rows land where a job of its size always did, on both ranks, so rank 1 runs the same bytes from the same places. Prompt chunks and the MTP head keep a header a job. The pass header has its own magic, so a build without passes refuses it as a bad job. test-nemotron-tp-jobs-host runs rank 0's real posts against rank 1's real loop over a fake link. #2834.
Once a window's first job is out, rank 1 has queued a receive for every later job of its pass. An eager window that then failed on rank 0's host (a launch error in verifyShared, a masked window off its graphs, a dump run) left rank 1 waiting, and rank 0's next message (its end header, or the next window's) would land in a receive of another size, which NCCL leaves undefined. A window now counts its jobs out and replies in (Flight); windowSegs hands a failure to windowFailed, and while rank 1 still waits inside the window, rank 0 tells every rank the error's name on its liveness line and exits, the way completion.drain does. A capture sent nothing and stops no rank, nor does a failure before the first job or after the last reply. Host tests pin a failure after k of 40 jobs: rank 1 runs exactly those k jobs, then stops with rank 0's error's name. #2834.
…ward.zig back under 600 (#2839) On main 3f1290f the TP=2 job headers take zig/src/families/nemotron/cuda_forward.zig to 610 lines. The window profile's timing types, Class and Marks (tf-cuda-test window-profile's events), move unchanged to cuda_window_marks.zig; cuda_forward.zig re-exports both names, so every caller is as it was. 597 lines.
910cec5 to
48e9b1b
Compare
…ward.zig back under 600 (#2839) On main 3f1290f the TP=2 job headers take zig/src/families/nemotron/cuda_forward.zig to 610 lines. The window profile's timing types, Class and Marks (tf-cuda-test window-profile's events), move unchanged to cuda_window_marks.zig; cuda_forward.zig re-exports both names, so every caller is as it was. 597 lines.
Nemotron 3.5 Super at TP=2 on CUDA sends rank 1 a header for every layer job: during decode, a window of more than one row makes two messages a layer, and rank 1 waits on the host to read each header (two stream syncs a read) before it can queue the layer's work.
What changes (
cuda_worker.zig,cuda_forward.zig):routedWindowgives each decode window one pass header carrying the rows, the job count and a layer mask. After it, each layer's job is one exact-size message.parserefuses a short or malformed header; the pass header has its own magic, so a build without passes refuses it instead of misreading it (mismatched builds are already refused at startup by the executable hash).For a 40-layer window that is about 41 messages and one header read where main makes 80 messages and 40 header reads.
Exactness: each job's rows land at the same device addresses with the same layout on both ranks, and rank 1 runs the same partials in the same order on one stream; no kernel, reduction or ordering changes. TP=1 never reaches this code.
Checks: six host tests in
cuda_worker_test.zig(new steptest-nemotron-tp-jobs-host, 19/19) run rank 0's real send code into a fake host-memory link and rank 1's real loop out of it; each fails when the part it pins is broken.test-bolt-host,test-nemotron-copies-host(28/28),check-native-cuda-host,compile-cuda-tests -Dtarget=aarch64-linux-gnu,zig fmt --checkand the lean count pass. One existing test (test-nemotron-mtp-policy-host) built a forward with no weights; it now gets empty weights and passes 10/10.Still to run before landing: two GB10s at TP=2, Nemotron 3.5 Super NVFP4, main against this branch with the same binary on both ranks for each side: 1 and 4 streams, undrafted and MTP-drafted, greedy and seeded, token hashes equal to main and the golden set equal to TP=1, with rank 1's message and header-read counts from its exit line.
For #2834.