Repository navigation
glm cuda: a logit gather broadcasts one block a rank, so TP=3 prompt_logprobs past ~100 tokens no longer hangs - #1571
Conversation
|
Hi @gilby, a status update on #1571. We read the diff and found nothing unsafe: the spans tile the vocabulary exactly, and every rank posts its |
|
Hi @gilby, a status note: this is still waiting on us. The code read clean; what's left is our run on three GB10s at |
|
Hi @gilby, a correction to our status notes here. We said the TP=3 run on three GB10s was ours, but we have no three GB10s linked together, so we can't run the case this fixes, and we're sorry for the wait that caused. Could you run it on your three, on this head rebased onto current main? The cells we'd want: |
|
Yes, please go ahead and carry the two small items on our branch, with our authorship: the staging buffers counted in the memory plan, and the host test that the gather posts one broadcast per rank whatever the row count. We accept your plan: you run the TP=2 byte-equal checks on your pair and land it with the TP=3 receipt already in the description, and we will run the TP=3 cells on three GB10s on the landed head when the sparks are free (they are currently carrying a pin; a window is being scheduled). Thank you for the correction on the 5 Nov note — understood that the three-GB10 run is ours. |
|
Thanks @gilby, we'll take it from here. We'll add the two items on your branch, with your authorship: the staging buffers counted in the memory plan, and the one-broadcast-per-rank host test across row counts at TP=2 and TP=3. Then we'll run the TP=2 byte-equal checks on our pair and land it with your TP=3 receipt in the description. Main is frozen for the 1.2.7 release this afternoon, so it lands just after. Your TP=3 cells on the landed head, whenever the sparks are free, will close the loop.
|
|
@gilby, we've added one commit on top of yours (
No kernel or arithmetic changes. Main is frozen for today's release. After it ships we'll run GLM-5.3-Flash at TP=2 on two GB10s against main (byte-equal prompt logprobs and replies), and then it lands. If anything in the commit doesn't match what you intended, say so and we'll change it.
|
|
Thanks @gilby. The TP=2 run against main is in, on this PR's change (head
That was the last thing on our side, so it's queued to land. #1559 closes when it merges.
|
f6f1d75 to
be0298a
Compare
|
Rebased onto today's main and pushed to your branch, keeping your two commits as they were. The landing train's CI failed on this PR's own test, and both causes came from main moving underneath it:
Your code is unchanged.
|
…logprobs past ~100 tokens no longer hangs Spread.post queued one ncclBroadcast per row per rank in one NCCL group; at TP=3 a 128-row prompt-logprob pass (381 broadcasts) never left ncclGroupEnd. Each rank's columns are already one [rows][span] block: broadcast it once into a staging buffer and place it into the full rows with one cuMemcpy2DAsync. Same bytes, world broadcasts whatever the rows. Fixes ashhart#1559
Prepare prompt scoring buffers before rank room is measured and pin one broadcast per rank at every gather height. Refs ashhart#1559.
…dow_rows and the fake driver answers the integrated-GPU check Main raised GLM's window_rows from 8 to 32, so the expected staging is vocab x 2 bytes x window_rows rather than the 8-row figure, and main's DeviceBuffer.download now asks cuda/download_stage.zig whether the GPU is integrated: the test's fake driver answers cuCtxGetDevice and cuDeviceGetAttribute as a discrete GPU, so its downloads copy directly as before. The PR's code is unchanged.
be0298a to
0c79a09
Compare
|
Thank you @gilby. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @gilby! This is in TensorFold 1.2.9, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.9
|
What this changes
Fixes #1559. GLM's logit gather (
Sampler.gather, used by prompt logprobs and structured output) queued onencclBroadcastper row per rank in one NCCL group, and at TP=3 a prompt-logprob pass over ~100 tokens never leftncclGroupEnd. Each rank's columns are already one[rows][span]block, so each rank now broadcasts that block once into a staging buffer and each block lands infullwith onecuMemcpy2DAsync:worldbroadcasts whatever the row count. The bytes are the same, so the output is unchanged. Staging isrows * vocabbf16: 2.5 MB in the sampler (8 rows), 39.6 MB in the prompt-logprob buffers.Receipt
nvidia/GLM-5.3-Flash-FP4-Local@ 76348ddb,--context 500000 --parallel 4 --kv-cache fp8, TP=3;zig build native -Dsm=121. Measured onmaina1e6d34 with this change; the same diff applies unchanged to a881b6f and to this base, and no GLM or NCCL file changed in between./v1/completions,max_tokens: 1,prompt_logprobs: 20, prompts as token ids.main: 87 tokens answer in 0.28 s, 128 and 512 tokens give no answer in 300 s (every rank inncclGroupEnd, stacks in GLM on native CUDA at TP=3: aprompt_logprobsrequest over ~100 tokens hangs every rank in the gather's NCCL group #1559). This branch: 128 / 512 / 2,048 tokens answer in 0.30 / 0.60 / 1.68 s.tools/bench_concurrent.py --levels 1,4 --tokens 256 --reps 3 --temperatures 1.0,0 --alone --serial: 0 unequal and 0 failed in every cell, and every 256-token completion hashes the same asmain's.main(the gather runs only for prompt logprobs and structured output).zig build test-cuda-hoston Linux aarch64 (GB10): 270/270 steps, 3,841 of 3,850 tests passed, 9 skipped, the same asmain.zig fmt --checkclean on the three files.python3 tools/zig/lean_check.py: 425 problems, the same asmain.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.