Skip to content

[https://nvbugs/6535874][fix] Size DFlash/DSpark worker slot pools from num_seq_slots - #21305

Open
viraatc wants to merge 4 commits into
NVIDIA:feat/k3_26.08from
viraatc:viraatc/k3-spec-slot-pool
Open

viraatc wants to merge 4 commits into
NVIDIA:feat/k3_26.08from
viraatc:viraatc/k3-spec-slot-pool

Conversation

@viraatc

@viraatc viraatc commented Oct 30, 2026 •

Copy link
Copy Markdown

Description

Port of #17154 (closed unmerged against main) onto feat/k3_26.08.

DFlashWorker._lazy_init_ctx_buffers and DSv4DSparkWorker._lazy_init allocate their per-request slot pools once and reuse them for every later batch shape. Both sized the pool from spec_metadata.max_num_requests. That value is not a stable bound:

  • create_cuda_graph_metadata narrows it to the captured graph bucket, so a first call on a small bucket pins the pool to that bucket.
  • Under disaggregated attention DP with overlap headroom, the seq-slot pool (compute_max_num_sequences) is 2 * max_batch_size, which max_num_requests never covers.

feat/k3_26.08 already passes num_seq_slots into DFlashSpecMetadata and DSparkSpecMetadata through get_spec_metadata. This PR:

  • sizes both worker pools from spec_metadata.num_seq_slots;
  • normalizes its default (num_seq_slots or max_num_requests) in both metadata __post_init__s, so directly built metadata and CUDA-graph copies keep the full capacity.

The tests from #17154 do not apply here: the DSpark worker on this branch uses manager-owned draft pages instead of _kv_windows. New tests are written against this branch's layout.

Memory: when the pool is 2 * max_batch_size, the private DFlash context cache (used when the draft KV is not in the unified pool) doubles with it. The DSpark progress buffers are small.

Test Coverage

PR Checklist

  • Commits signed off (DCO).
  • GPU unit tests run (GB300; the 3 failures above also fail on the base).

…om num_seq_slots

Port of NVIDIA#17154 (closed unmerged against main) onto
feat/k3_26.08.

DFlashWorker._lazy_init_ctx_buffers and DSv4DSparkWorker._lazy_init allocate
their per-request slot pools once and reuse them for every later batch shape.
Both sized the pool from spec_metadata.max_num_requests, which
create_cuda_graph_metadata narrows to the captured graph bucket, so a first
call on a small bucket pinned the pool to that bucket. Under disaggregated
attention DP with overlap headroom the seq-slot pool is 2 * max_batch_size,
which max_num_requests never covers.

feat/k3_26.08 already threads num_seq_slots into DFlashSpecMetadata and
DSparkSpecMetadata through get_spec_metadata. This change makes both workers
size their pools from it, and normalizes its default in __post_init__ so
directly built metadata and graph copies keep the full capacity.

Co-authored-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
Signed-off-by: Viraat Chandra <viraatc@nvidia.com>
@viraatc

viraatc commented Nov 10, 2026

Copy link
Copy Markdown
Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83641 [ run ] triggered by Bot. Commit: 2064b5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83641 [ run ] completed with state FAILURE. Commit: 2064b5d
/LLM/main/L0_MergeRequest_PR pipeline #69151 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

viraatc and others added 3 commits November 11, 2026 17:04
…atch, not the slot pool

The seq-slot pool can be 2 * max_batch_size under disaggregated attention
DP overlap, but a generation step never carries more than the engine's
generation batch. Keep the un-narrowed max_num_requests on the metadata
and pass it to configure_generation_autotuner, so the MXFP8 projection
buckets top out at the real batch. The slot-exhaustion error now names
max_batch_size, the knob users set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Viraat Chandra <viraatc@nvidia.com>
The base branch pins it with a direct .pin_memory(), which the pinned-memory
pre-commit hook rejects for any PR that touches dflash.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Viraat Chandra <viraatc@nvidia.com>

This branch has not been deployed

No deployments
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.

3 participants