Skip to content

[None][fix] Backport nonblocking CTX transfer polling to M3 - #17428

Merged
peihu-nv merged 2 commits into
NVIDIA:feat/m3_with_msafrom
peihu-nv:peihengh/m3-ctx-poll-backport-20260807
Aug 7, 2026
Merged

[None][fix] Backport nonblocking CTX transfer polling to M3#17428
peihu-nv merged 2 commits into
NVIDIA:feat/m3_with_msafrom
peihu-nv:peihengh/m3-ctx-poll-backport-20260807

Conversation

@peihu-nv

@peihu-nv peihu-nv commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Backports #17324 to feat/m3_with_msa.

After the idle transfer poll was removed, completed context KV transfers could remain unreaped when scheduling stalled. Their KV blocks stayed pinned, so the context executor could stop admitting work even though transfers had completed.

This change replaces the local-scheduler-state-gated blocking progress checks and their extra entry collectives with a rank-symmetric, nonblocking context transfer poll on every asynchronous disaggregated executor iteration. The idle helper does not repeat the generation poll because the normal loop head and receive path already poll generation transfer status. The synchronous-transfer early return is preserved because ranks may be inside rank-local blocking receives.

Test Coverage

  • Updated executor unit coverage for nonblocking context progress, absence of redundant generation polling, removal of the extra gating collectives, and synchronous/gen-only bypass behavior.
  • Changed-file pre-commit suite: passed.
  • GB300 end-to-end validation completed without serving errors on:
    • AgentX: 11 context workers (TP2) + 1 generation worker (TP8/EP8 ADP), concurrency 32.
    • AgentX: 2 context workers (TP2) + 1 generation worker (TEP4), concurrency 16.
    • 8K/1K: 4 context workers (TP2) + 1 generation worker (TP8/EP8 ADP), concurrency 4096; 40,960/40,960 requests completed.
  • The three-way workload comparisons showed no material throughput regression from the context-only poll.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

`_check_disagg_transfer_progress_when_idle` gated its work behind two
rank-collectives (`_sync_disagg_gen_status_entry` /
`_sync_disagg_ctx_status_entry`) and then issued a blocking
`atLeastNum=1` wait on whichever direction won the vote. The vote input
was derived from purely local scheduler state (`num_fitting_reqs`,
`fitting_disagg_gen_init_requests`, `wait_for_disagg_gen_transfer_progress`,
`all_gen_first`), so every disagg iteration paid for an extra allreduce or
allgather just to decide whether to poll, and the winning branch could
block the executor loop on an unfinished transfer.

Both `_check_disagg_ctx_cache_transfer_status` and
`_check_disagg_gen_cache_transfer_status` already perform their own
internal cross-rank consensus and are safe to enter unconditionally with
`atLeastNum=0`. Entering both non-blocking polls on every iteration keeps
all ranks symmetric without the extra collective, and reaps completed
transfers so their KV blocks are freed just the same. Ranks with nothing
in flight simply reap nothing.

The synchronous-transfer early return is preserved: a synchronous GEN
receive is rank-local and blocking, so one rank can still be receiving
while another is idle, which makes entering either progress collective
unsafe.

Removes the now-unused `_sync_disagg_gen_status_entry` and
`_sync_disagg_ctx_status_entry` helpers and drops the per-iteration
`all_gen_first` scan over `active_requests` at both call sites.

Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
…heck

`_check_disagg_transfer_progress_when_idle` polled both directions, but the
GEN poll was always a repeat of one that already ran earlier in the same
iteration:

- The loop head (`_executor_loop_pp` / `_prepare_and_schedule_batch`) calls
  `_check_disagg_gen_transfer_status`, which enters
  `_check_disagg_gen_cache_transfer_status(0)` unconditionally.
- If scheduling started new receives, `_prepare_disagg_gen_init` ->
  `_recv_disagg_gen_cache` already polls GEN status right after issuing them.

So in both cases the second call re-ran the GEN status query and its internal
cross-rank consensus for nothing. Keep only the CTX poll here.

The synchronous-transfer early return is unchanged: a synchronous GEN receive
is rank-local and blocking, so one rank can still be receiving while another is
idle, which makes entering the context progress collective unsafe.

Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
@peihu-nv

peihu-nv commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64673 [ run ] triggered by Bot. Commit: 38a62a1 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64673 [ run ] completed with state SUCCESS. Commit: 38a62a1
/LLM/main/L0_MergeRequest_PR pipeline #52530 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@peihu-nv

peihu-nv commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64692 [ run ] triggered by Bot. Commit: 38a62a1 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64692 [ run ] completed with state SUCCESS. Commit: 38a62a1
/LLM/main/L0_MergeRequest_PR pipeline #52548 completed with status: 'SUCCESS'

CI Report

Link to invocation

@peihu-nv
peihu-nv merged commit cd854a4 into NVIDIA:feat/m3_with_msa Aug 7, 2026
9 checks passed
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.

4 participants