[https://nvbugs/6428069][fix] Move use_host_stop_criteria from SampleStateTorch onto… - #16135
[https://nvbugs/6428069][fix] Move use_host_stop_criteria from SampleStateTorch onto…#16135trtllm-agent wants to merge 1 commit into
use_host_stop_criteria from SampleStateTorch onto…#16135Conversation
📝 WalkthroughWalkthroughThe ChangesHost stop criteria field relocation
Test waiver list updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unittest/_torch/sampler/test_torch_sampler.py (1)
932-934: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winLGTM for the assertion update itself, matching the new field location.
One coverage gap worth flagging: this test exercises
sample_async/update_requestswithin a single sampler instance and doesn't cover the actual PP send/recv boundary that caused bug 6428069 (non-last ranks receivingstate.hostwithout the flag). Consider a lightweight unit test that pickles/round-trips (or otherwise simulates the PP transfer of)SampleStateTensorsHostTorchto assertuse_host_stop_criteriasurvives, complementing the disaggregated PP integration tests already re-enabled by this PR.As per path instructions for
tests/**: "suggest concrete list file names and whether coverage is sufficient, insufficient, or needs follow-up outside the PR."🤖 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/sampler/test_torch_sampler.py` around lines 932 - 934, Coverage is insufficient for the PP transfer path: the current test only checks `sample_async` and `update_requests` inside one `TorchSampler` instance, so it does not verify that `SampleStateTensorsHostTorch.use_host_stop_criteria` survives the send/recv boundary. Add a lightweight unit test in `tests/unittest/_torch/sampler/test_torch_sampler.py` that round-trips or simulates serialization for `SampleStateTensorsHostTorch` and asserts `use_host_stop_criteria` remains set on the received `state.host`. This should complement, not replace, the existing disaggregated PP integration tests already covered elsewhere in the PR.Source: Path instructions
🤖 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.
Nitpick comments:
In `@tests/unittest/_torch/sampler/test_torch_sampler.py`:
- Around line 932-934: Coverage is insufficient for the PP transfer path: the
current test only checks `sample_async` and `update_requests` inside one
`TorchSampler` instance, so it does not verify that
`SampleStateTensorsHostTorch.use_host_stop_criteria` survives the send/recv
boundary. Add a lightweight unit test in
`tests/unittest/_torch/sampler/test_torch_sampler.py` that round-trips or
simulates serialization for `SampleStateTensorsHostTorch` and asserts
`use_host_stop_criteria` remains set on the received `state.host`. This should
complement, not replace, the existing disaggregated PP integration tests already
covered elsewhere in the PR.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a8365454-2569-4bac-8dab-fba3226a42dd
📒 Files selected for processing (3)
tensorrt_llm/_torch/pyexecutor/sampler/sampler.pytests/integration/test_lists/waives.txttests/unittest/_torch/sampler/test_torch_sampler.py
💤 Files with no reviewable changes (1)
- tests/integration/test_lists/waives.txt
The 'use_host_stop_criteria' flag was stored on SampleStateTorch (top-level), so it only lived on the last PP rank that actually ran sample_async(). Under PP>=2, non-last ranks recv only sample_state.host from the previous rank via _ring_broadcast_sample_state and keep their locally-constructed SampleStateTorch with the default flag=False. update_requests() on those ranks then went down the device finish-reasons path and dereferenced state.host.finish_reasons, which is None on the host-stop path -- causing IndexError in finish_if_reason. Move the flag into SampleStateTensorsHostTorch so it travels together with finish_reasons through the PP send/recv chain and update the single read site plus the corresponding sampler unit test. Remove the eight nvbugs/6428069 waivers so the fixed disagg PP tests re-enter CI. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
0b942e8 to
1429a84
Compare
Summary
use_host_stop_criterialived on outerSampleStateTorch, not on thehostobject propagated across PP ring send/recv, so non-last PP ranks kept flag=False and dereferenced a Nonefinish_reasons.use_host_stop_criteriafromSampleStateTorchontoSampleStateTensorsHostTorch; update the one reader and the unit test; remove the eight nvbugs/6428069 waivers.Test plan
Links
Summary by CodeRabbit
Bug Fixes
Tests