-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[https://nvbugs/6621362][fix] fix disagg retry and gpt-oss spec-dec #18517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,7 +120,13 @@ def prepare_resources(self, scheduled_batch: ScheduledRequests): | |
| self.slot_ids = [] | ||
| for req in context_batch: | ||
| if req.is_first_context_chunk: | ||
| slot_id = self.slot_manager.add_slot(req.request_id) | ||
| # A padding dummy (e.g. the attention-DP idle-rank dummy) may | ||
| # already hold a slot from add_dummy_requests -- reuse it | ||
| # instead of re-adding, which SlotManager.add_slot only | ||
| # tolerates for the CUDA-graph dummy id. | ||
| slot_id = self.slot_manager.get_slot(req.request_id) | ||
| if slot_id is None: | ||
|
Comment on lines
+127
to
+128
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- production excerpts ---'
for f in tensorrt_llm/_torch/speculative/eagle3.py tensorrt_llm/_torch/speculative/mtp.py; do
echo "### $f"
sed -n '1,190p' "$f"
done
printf '%s\n' '--- relevant files ---'
git ls-files | rg '(^|/)(test|tests|.*speculative.*|.*eagle.*|.*mtp.*)' | head -200
printf '%s\n' '--- symbol references ---'
rg -n --glob '!build/**' --glob '!dist/**' 'add_dummy_requests|NoFreeSlotsError|get_slot\(|Eagle3|MTP|mtp|eagle3' tensorrt_llm tests 2>/dev/null | head -300Repository: NVIDIA/TensorRT-LLM Length of output: 42090 🤖 get_repo_knowledge executed:
Length of output: 40741 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- speculative test files ---'
git ls-files 'tests/unittest/_torch/speculative/**' | sort
printf '%s\n' '--- speculative test references ---'
rg -n -C 4 'Eagle3ResourceManager|MTPHiddenStatesManager|add_dummy_requests|prepare_resources|NoFreeSlotsError|test_eagle3|slot_manager|preallocated|dummy' tests/unittest/_torch/speculative tests/unittest/llmapi/test_session_reuse.py tensorrt_llm/_torch/pyexecutor/resource_manager.py 2>/dev/null
printf '%s\n' '--- SlotManager definition ---'
rg -n -A 100 -B 15 'class SlotManager' tensorrt_llm/_torch/pyexecutor/resource_manager.pyRepository: NVIDIA/TensorRT-LLM Length of output: 42420 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- working tree summary ---'
git status --short
git diff --stat -- tensorrt_llm/_torch/speculative/eagle3.py tensorrt_llm/_torch/speculative/mtp.py tests
printf '%s\n' '--- production diff ---'
git diff --unified=35 -- tensorrt_llm/_torch/speculative/eagle3.py tensorrt_llm/_torch/speculative/mtp.py
printf '%s\n' '--- slot pool tests ---'
sed -n '1,210p' tests/unittest/_torch/speculative/test_spec_slot_pool_sizing.py
printf '%s\n' '--- MTP relevant tests ---'
sed -n '1080,1160p' tests/unittest/_torch/speculative/hw_agnostic/test_mtp.py
sed -n '1680,1750p' tests/unittest/_torch/speculative/hw_agnostic/test_mtp.py
printf '%s\n' '--- Eagle3 manager/test references ---'
rg -n -C 8 'Eagle3ResourceManager|MTPHiddenStatesManager|prepare_resources\(|add_dummy_requests\(' tests/unittest/_torch/speculativeRepository: NVIDIA/TensorRT-LLM Length of output: 42165 🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- numbered production paths ---'
nl -ba tensorrt_llm/_torch/speculative/eagle3.py | sed -n '118,158p'
nl -ba tensorrt_llm/_torch/speculative/mtp.py | sed -n '78,118p'
printf '%s\n' '--- exact manager references across tests ---'
rg -n -C 5 'Eagle3ResourceManager|MTPHiddenStatesManager' tests --glob '*.py'
printf '%s\n' '--- exact candidate test sections ---'
nl -ba tests/unittest/_torch/speculative/test_spec_slot_pool_sizing.py | sed -n '115,180p'
nl -ba tests/unittest/_torch/speculative/hw_agnostic/test_mtp.py | sed -n '1118,1140p'
nl -ba tests/unittest/_torch/speculative/hw_agnostic/test_mtp.py | sed -n '1711,1733p'Repository: NVIDIA/TensorRT-LLM Length of output: 23684 Add regression coverage for preallocated-slot reuse.
📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
| slot_id = self.slot_manager.add_slot(req.request_id) | ||
| self.slot_ids.append(slot_id) | ||
| if self.use_relaxed_acceptance_for_thinking: | ||
| self.relaxed_delta_pool[slot_id].fill_(0) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferring
ctx_request_idhere makes sense for the retry case, since that's the key the ctxTxSessionactually registered under. But the harness and the six test files now all setctx_request_id == disagg_request_id, so every test passes with either ordering. Nothing pins down the case this PR is fixing, where a retried gen request carries a differentdisagg_request_idthan the one the ctx side registered.Would it be worth adding one case in
test_kv_transfer.py, or a harness option, where the two ids differ and the transfer still matches onctx_request_id? Otherwise a future flip back to disagg-first would go unnoticed. I think this one is required for this PR, since the ordering is the core of the fix.