Skip to content

[None][fix] fix disagg overlap slot headroom without MTP - #17282

Open
reasonsolo wants to merge 3 commits into
NVIDIA:mainfrom
reasonsolo:fix/dsv4-overlap-slot-headroom-draft0
Open

[None][fix] fix disagg overlap slot headroom without MTP#17282
reasonsolo wants to merge 3 commits into
NVIDIA:mainfrom
reasonsolo:fix/dsv4-overlap-slot-headroom-draft0

Conversation

@reasonsolo

@reasonsolo reasonsolo commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Updated overlap headroom logic to apply to disaggregated attention-DP deployments.
  • Removed the DeepSeek-V4 and MTP-specific eligibility check.
  • Preserved the 2 * max_batch_size sequence-slot headroom only when attention-DP, disaggregation, non-pipeline execution, and overlap scheduling are enabled.
  • Updated model engine and guided decoder allocation to use the new _enable_disagg_adp_overlap_headroom flag.
  • Added configurable disaggregated test startup timeouts.
  • Updated the DeepSeek V3 Lite attention-DP configuration to use KV cache manager v2 and the NIXL Python cache transceiver.
  • Removed the obsolete waiver entry.
  • The changes are consistent across helper APIs, engine initialization, slot allocation, and unit tests.
  • No configuration typos or unintended model-specific scope changes are evident.

QA Engineer Review

  • Updated the sequence-slot sizing gate test to validate disaggregated attention-DP conditions.
  • Updated the DeepSeek attention-DP overlap integration test to run without a Hopper-only restriction.
  • Updated the integration configuration used by that test.
  • Removed the corresponding waiver from tests/integration/test_lists/waives.txt.
  • The integration test is covered by the waiver removal. The unit test is not listed in the provided test-list changes.
  • Verdict: needs follow-up because CBTS coverage data is unavailable.

Description

With overlap scheduling, requests completed in the previous iteration still hold their sequence slots when the next iteration calls prepare_resources(). Meanwhile, the scheduler has already removed those terminal requests from its capacity budget and may schedule replacement requests or ADP dummy requests.

This creates a transient requirement of up to 2 * max_batch_size sequence slots.

DeepSeek-V4 already had this overlap headroom, but it was incorrectly restricted to one-model MTP configurations. With draft length 0, the slot pool remained at max_batch_size, allowing dummy allocation to fail when the pool was saturated.

Once some rank event loops exited with NoFreeSlotsError, the remaining ranks blocked in distributed collectives, presenting externally as a server hang.

Test Coverage

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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • 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.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Sequence-slot overlap headroom now applies to disaggregated attention-DP deployments. Eligibility uses topology, cache-transceiver configuration, pipeline parallelism, and overlap scheduling. Unit and integration tests cover the updated behavior.

Changes

Disaggregated attention-DP overlap headroom

Layer / File(s) Summary
Headroom eligibility and capacity wiring
tensorrt_llm/_torch/pyexecutor/_util.py, tensorrt_llm/_torch/pyexecutor/model_engine.py, tensorrt_llm/_torch/pyexecutor/py_executor_creator.py
The helper now gates headroom for disaggregated attention-DP without pipeline parallelism and with overlap scheduling enabled. Model initialization, speculative metadata sizing, and guided decoder allocation use the resulting sequence-slot capacity.
Topology and integration validation
tests/unittest/_torch/executor/test_seq_slot_sizing.py, tests/integration/defs/disaggregated/..., tests/integration/test_lists/waives.txt
Unit tests cover the new topology gates. The integration configuration uses KV cache manager v2 and NIXL. The test adds a configurable startup timeout, removes the Hopper restriction, runs one iteration, and removes its waiver.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: schetlur-nv, bowenfu, qijune

Sequence Diagram(s)

sequenceDiagram
  participant ModelEngine
  participant HeadroomUtility
  participant SequenceSlotSizing
  ModelEngine->>HeadroomUtility: evaluate attention-DP, disaggregation, pipeline, and overlap settings
  HeadroomUtility-->>ModelEngine: return headroom eligibility
  ModelEngine->>SequenceSlotSizing: calculate maximum sequence slots
  SequenceSlotSizing-->>ModelEngine: return slot capacity
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the fix for disaggregated overlap slot headroom when MTP is disabled.
Description check ✅ Passed The description clearly explains the failure and impact, but it does not list the relevant tests in the Test Coverage section.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/unittest/_torch/executor/test_seq_slot_sizing.py (1)

50-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add annotations to the modified test function.

test_dsv4_overlap_headroom_gate has untyped parameters and no return annotation. Add precise parameter annotations and -> None.

Proposed change
 def test_dsv4_overlap_headroom_gate(
-    model_type, pp_size, disable_overlap, expected
-) :
+    model_type: str,
+    pp_size: int,
+    disable_overlap: bool,
+    expected: bool,
+) -> None:

As per coding guidelines, annotate every function.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/_torch/executor/test_seq_slot_sizing.py` around lines 50 - 52,
Update the test_dsv4_overlap_headroom_gate function signature with precise
annotations for model_type, pp_size, disable_overlap, and expected, and add a ->
None return annotation. Preserve the existing parameterization and test
behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unittest/_torch/executor/test_seq_slot_sizing.py`:
- Around line 42-56: Complete the coverage follow-up for
test_dsv4_overlap_headroom_gate by running pytest tests/unittest/ and reporting
the results; preserve the existing parameterized cases and test behavior.

---

Nitpick comments:
In `@tests/unittest/_torch/executor/test_seq_slot_sizing.py`:
- Around line 50-52: Update the test_dsv4_overlap_headroom_gate function
signature with precise annotations for model_type, pp_size, disable_overlap, and
expected, and add a -> None return annotation. Preserve the existing
parameterization and test behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5a15a08d-d92f-4ad4-b6eb-603d9dd513b8

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1f219 and d55d013.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/pyexecutor/_util.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
  • tests/unittest/_torch/executor/test_seq_slot_sizing.py

Comment thread tests/unittest/_torch/executor/test_seq_slot_sizing.py Outdated
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63941 [ run ] triggered by Bot. Commit: d55d013 Link to invocation

Signed-off-by: Lizhi Zhou <lizhiz@oci-aga-slurm-1-login-01.cm.cluster>
@reasonsolo
reasonsolo force-pushed the fix/dsv4-overlap-slot-headroom-draft0 branch from d55d013 to e2f7e71 Compare August 5, 2026 05:21
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63947 [ run ] triggered by Bot. Commit: e2f7e71 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63941 [ run ] completed with state ABORTED. Commit: d55d013

Link to invocation

@reasonsolo
reasonsolo enabled auto-merge (squash) August 5, 2026 07:27
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63947 [ run ] completed with state SUCCESS. Commit: e2f7e71
/LLM/main/L0_MergeRequest_PR pipeline #51882 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

@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64021 [ run ] triggered by Bot. Commit: e2f7e71 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64021 [ run ] completed with state SUCCESS. Commit: e2f7e71
/LLM/main/L0_MergeRequest_PR pipeline #51952 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Ask a member of NVIDIA/trt-llm-ci-approvers to add the label, then re-trigger CI with the same bot command (no rebase needed).

⚠️ 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

Link to invocation

@longlee0622

Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64041 [ run ] triggered by Bot. Commit: e2f7e71 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64041 [ run ] completed with state FAILURE. Commit: e2f7e71
/LLM/main/L0_MergeRequest_PR pipeline #51970 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

Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
@reasonsolo
reasonsolo requested review from a team as code owners August 6, 2026 08:09
@reasonsolo reasonsolo changed the title [None][fix] enable DSv4 overlap slot headroom without MTP [None][fix] fix overlap slot headroom without MTP Aug 6, 2026
@reasonsolo reasonsolo changed the title [None][fix] fix overlap slot headroom without MTP [None][fix] fix disagg overlap slot headroom without MTP Aug 6, 2026
@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@reasonsolo

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64285 [ run ] triggered by Bot. Commit: 474df5c Link to invocation

@ZhanruiSunCh ZhanruiSunCh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for infra part.

Comment on lines +2527 to +2534
def should_enable_disagg_adp_overlap_headroom(
mapping: Mapping,
cache_transceiver_config: Optional[CacheTransceiverConfig],
disable_overlap_scheduler: bool) -> bool:
"""Gate extra sequence slots to non-PP disaggregated attention-DP."""
is_disagg = (cache_transceiver_config is not None
and cache_transceiver_config.backend is not None)
return (mapping.enable_attention_dp and is_disagg and not mapping.has_pp()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that the MTP conjunct in #16279 was over-narrow — draft length has nothing to do with slot lifetime. But swapping it for enable_attention_dp and is_disagg narrows in a new direction, and two configurations that #16279 deliberately protected lose the headroom here:

  • DeepSeek-V4 + MTP-one-model + non-PP + overlap, running aggregated (no cache_transceiver_config)
  • the same, disaggregated but with enable_attention_dp=False

The old predicate required neither disagg nor ADP (model_type == "deepseek_v4" and not mapping.has_pp() + MTP + overlap), so both go from 2 * max_batch_size back to max_batch_size.

That matters because the race isn't disagg-specific. #16279 describes it purely as a V2-scheduler/overlap lifetime issue, and the code agrees: V2 excludes GENERATION_TO_COMPLETE from its schedulable range (scheduler_v2.py:151,357), overlap moves the completing request into that state (py_executor.py:6272), the backfilled request takes a slot in generic prepare_resources (py_executor.py:4485, seq_slot_manager.py:17), and only afterwards does _process_previous_batch free the old one (py_executor.py:4651). No transceiver anywhere on that path. Manager selection keys off use_kv_cache_manager_v2 (_util.py:81), not disaggregation, so an aggregated DSV4/MTP/V2 deployment can hit exactly the same ValueError("No free slots").

The mirror image is that the new gate doesn't test for V2 either, so V1 disagg ADP deployments now pay 2x for a race V1 doesn't have.

Could the gate key off the thing the mechanism actually depends on — V2 + overlap + non-PP — rather than topology? kv_cache_config.use_kv_cache_manager_v2 is available at the same point in __init__ as cache_transceiver_config, so it doesn't reintroduce the load-order problem that made you move this ahead of the model load. Failing that, OR-ing the old DSV4/MTP condition back in would at least keep this from being a narrowing.

Not free either: 2x propagates into TorchSampler state, the legacy TRTLLMSampler decoder state (sampler.py:4876,4886,4900), the guided decoder, and SpecMetadata. Greedy non-spec is negligible (~0.3 MiB at B=256), but beam search adds ~12 * B * beam_width * max_seq_len bytes (sampler.py:2284) and spec rejection sampling adds 4 * B * max_draft_len * vocab_size for draft_probs (interface.py:576,590) — both in the hundreds of MiB per rank at B=256. Worth a line in the description, since disagg ADP + overlap is a very common serving shape and this is now on by default for all of it.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64285 [ run ] completed with state SUCCESS. Commit: 474df5c
/LLM/main/L0_MergeRequest_PR pipeline #52185 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

@reasonsolo
reasonsolo disabled auto-merge August 6, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants