Repository navigation
Conversation
…ezvous TCP store, not in a spinning all-gather Between requests GLM-5.3-Flash's rank 1 waited for the next header inside _share's all-gather: an NCCL kernel spinning on its GPU and a host thread spinning in the copy that waits for it, for as long as the server stayed idle. On two DGX Sparks an idle rank 1 sat at 96% GPU utilization and ~210% CPU. Rank 0 now sets a key (tf_glm_request_<n>) in the rendezvous TCPStore that NCCL already holds (NCCL.store) right before each request's header, and follow() blocks on store.wait for that key first, then enters the all-gathers as before. Consumed keys are deleted; a wait that times out after an idle hour is retried, any other store error (rank 0 gone) raises. Communicators without a store skip the doorbell, so the request exchange and every reply are unchanged. Tests: tests/test_glm_idle_bell.py (a real TCPStore on localhost, the two ranks as threads: rank 1 blocks until rank 0 rings and follows every request in order; rings sent before rank 1 waits are not lost; idle timeouts retry and other errors raise; no store, no doorbell). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014wCj5zx4NuKdUNWUeJi3X1
ashhart
added a commit
that referenced
this pull request
Sep 30, 2026
Owner
|
Thanks for this. Between requests the idle rank was sitting in the collective, at 96% of the GPU and 200% of a core. It now waits on the rendezvous store until the next request arrives, and those idle samples read 0% and 0%. All 20 reply hashes matched. This is in 0.6.0, out tonight. |
This was referenced Oct 3, 2026
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: on GLM-5.3-Flash's two-rank CUDA engine, an idle rank 1 no longer busy-waits for the next request. Rank 0 rings a key in the rendezvous TCPStore that NCCL already holds before each request's header; rank 1 blocks on that socket first, then runs the same all-gathers as before. Replies and the request exchange are unchanged.
The problem
Between requests, rank 1 waits for the next request inside the header's all-gather (
follow->_share). That wait is an NCCL kernel spinning on its GPU plus a host thread spinning in the device-to-host copy that waits for it, and it lasts for as long as the server stays idle. On two DGX Sparks serving GLM-5.3-Flash, an idle rank 1 sits at ~96% GPU utilization and ~210% CPU (two cores) with no request in flight: power, heat, and a GPU that other work on that machine can't use.The change
In
families/glm5_next/cuda/engine.py:_ring()(rank 0): right before each request's_share(header), setstf_glm_request_<n>inself.comm.store, theTCPStoreNCCLalready creates for the rendezvous._await_bell()(rank 1): at the top of eachfollow()iteration, blocks onstore.wait([key]), deletes the consumed key, then enters the all-gathers as before.storeattribute (test fakes) skip the doorbell entirely.The header, prompt and grammar still go through
_shareexactly as before; the bell only decides when rank 1 starts waiting on the GPU.Measurements
"draft": false). The per-request cost of the extra store round trip (one small TCP set/wait on the rendezvous link) was not measured separately; prefill timings stayed within run-to-run noise.Tests
tests/test_glm_idle_bell.py(CPU only, a realTCPStoreon localhost with the two ranks as threads): rank 1 stays blocked until rank 0 rings, then follows 3 requests in order and the consumed keys are deleted; rings sent before rank 1 waits are not lost; idle timeouts are retried and other store errors raise; no store means no doorbell. 4 passed.DistStoreError: wait timeout after 1000ms, keys: /nope).tensorfold-glm53:v0.5.0(NVIDIA PyTorch container, aarch64),pytest tests --ignore=tests/cuda -k 'glm or capacity or geometry or cuda': 1005 passed, 79 skipped. That's the same as unmodifiedmain(1001 passed) plus the 4 new tests. The 2 collection errors (test_alternating_kv.py,test_dflash_tree_search.py) needmlxand fail the same way onmain.tests/cuda/test_glm_*), and a two-rank GLM-5.3-Flash server with this patch.