[None][perf] reduce rank-0 GIL contention in disaggregated generation - #15133
Merged
Tabrizian merged 1 commit intoJun 9, 2026
Merged
Conversation
lancelly
force-pushed
the
perf/gen-rank0-gil-host-overhead
branch
from
June 9, 2026 02:35
7c6425a to
3bd22b9
Compare
At high concurrency the disaggregated generation rank-0 process runs the executor loop, the request ingress, and the attention-DP request broadcast on a single GIL, so per-iteration host work on rank 0 paces the iteration. Two hot, redundant GIL costs on the executor-loop thread are removed: - safe_broadcast: the root rank rebuilt its return value by unpickling its own just-serialized bytes; return the original object instead. (Also drops the now-dead size check, which compared a length against itself.) - DefaultADPRouter._balance_requests_across_ranks: input_token_ids is a C++ getter that copies the whole token list on every access, and it was read in both the descending-token sort key and the heap loop; read it once per request. No functional change. Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com>
lancelly
force-pushed
the
perf/gen-rank0-gil-host-overhead
branch
from
June 9, 2026 03:03
3bd22b9 to
0279247
Compare
lancelly
marked this pull request as ready for review
June 9, 2026 05:49
lancelly
requested review from
achartier,
mikeiovine and
yizhang-nv
and removed request for
a team
June 9, 2026 05:50
Collaborator
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #52976 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #52976 [ run ] completed with state
|
Collaborator
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #53053 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #53053 [ run ] completed with state |
lfr-0531
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 26, 2026
…NVIDIA#15133) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Shixiaowei02
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 29, 2026
…NVIDIA#15133) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
lancelly
added a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 29, 2026
…NVIDIA#15133) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> Signed-off-by: Liao Lanyu <108499334+lancelly@users.noreply.github.com>
Shixiaowei02
pushed a commit
to lfr-0531/TensorRT-LLM
that referenced
this pull request
Jun 30, 2026
…NVIDIA#15133) Signed-off-by: Lance Liao <108499334+lancelly@users.noreply.github.com> Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> Signed-off-by: Liao Lanyu <108499334+lancelly@users.noreply.github.com>
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.
What
Reduce per-iteration GIL contention on the disaggregated generation rank-0
process. At high concurrency rank 0 runs the executor loop, the request ingress,
and the attention-DP request broadcast on a single GIL, so host work on rank 0
paces the iteration. Two redundant, hot GIL costs on the executor-loop thread are
removed:
safe_broadcast(_torch/distributed/communicator.py) — the root rankrebuilt its return value by
pickle.loads-ing its own just-serialized bytes,a full deep copy of the broadcast payload (which carries the new requests'
token ids) on every iteration. Return the original object instead. Also drops a
now-dead size check that compared a length against itself.
DefaultADPRouter._balance_requests_across_ranks(
_torch/pyexecutor/scheduler/adp_router.py) —input_token_idsis a C++getter that copies the whole token list on every access, and it was read twice
per request per iteration (the descending-token sort key and the heap loop).
Read it once per request.
Both run on the rank-0 executor-loop thread on every iteration at scale.
Impact
Measured on DeepSeek-V4-Pro 7P1D disaggregated (7×CTX-DEP4 + 1×GEN-DEP8, GB300),
concurrency 2880, py-spy on the rank-0 generation worker:
host_step_timep50: 123.5 ms → ~105 ms (−15%)device_step_timep50: 123 ms → ~99 ms (−19%) — under the overlapscheduler the device step was being dragged up to the host step, i.e. the
generation step was host-bound; relieving the host work surfaces the true
device time
No functional change.
Test
safe_broadcastroot return is value-identical: non-root ranks stillreconstruct the same object from the broadcast bytes; the root already holds it.