[https://nvbugs/6618106][fix] Carry single_step_greedy on SampleStateTensorsHostTorch - #17828
Conversation
…ransmitted host tensors
The stable-greedy fast path in `_process_requests` returns a compact 1-D
`new_tokens_host` of shape `(num_requests,)` instead of the usual
`[step, slot, beam]` buffer, but flagged that layout only on the outer
`SampleStateTorch`. Under pipeline parallelism, however,
`_ring_broadcast_sample_state` transmits just `sample_state.host`, and
`_forward_step_inter_pp` rebuilds the state object locally without the flag, so
a non-final PP rank paired the received flat buffer with the dataclass default
`single_step_greedy=False`. It then fell into the batched fast path and indexed
the flat token list as 3-D:
TypeError: 'int' object is not subscriptable
printed once per non-final PP stage. The reported "Test leaked" failure is a
downstream artifact of the aborted run, not the defect.
Move the marker onto `SampleStateTensorsHostTorch` -- the object actually
pickled across the ring -- and dispatch on either copy in `update_requests`.
This keeps send/recv symmetric without changing the wire-format tuple on both
sides, and needs no special-casing for sampler types lacking the field.
In sampler_strategy.py, return `(tokens, softmax, None)` directly from the
greedy branch instead of assigning `temperature = None` and falling through.
The tuple patterns bind `temperature` as `float`, so that assignment is a type
error reported by the `type-check` hook, which is `pass_filenames: false` and
therefore lints this file for any edit under the sampler directory. Annotating
`temperature` as `float | None` would clear the local run but make the `case`
capture patterns ill-typed under the pinned mypy 1.19.1 that CI installs; the
early return is clean under both 1.19.1 and 1.20.1 and is a no-op at runtime,
since the fall-through already returned `cast(float, None)`.
Also drops this bug's waives.txt line.
Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. WalkthroughThe sampler stores ChangesSampler state and greedy-path updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change carries the greedy-layout flag with the state that is transmitted between ranks, keeping buffer interpretation symmetric; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run |
|
PR_Github #66835 [ run ] triggered by Bot. Commit: |
|
PR_Github #66835 [ run ] completed with state
|
|
/bot run |
|
PR_Github #66988 [ run ] triggered by Bot. Commit: |
Signed-off-by: Guiju Zhang <7135567+cascade812@users.noreply.github.com>
|
PR_Github #66988 [ run ] completed with state |
The broad gpu4 waiver was added in the same failure batch as the two exact PP test waivers fixed by this PR. Remove it so the complete H100 marker selection runs again. Signed-off-by: Guiju Zhang <7135567+cascade812@users.noreply.github.com>
This reverts commit ccb2a9c. Signed-off-by: Guiju Zhang <7135567+cascade812@users.noreply.github.com>
|
/bot skip --comment "revert last unwaive, previous CI success" |
|
PR_Github #67123 [ skip ] triggered by Bot. Commit: |
|
PR_Github #67123 [ skip ] completed with state |
Summary
pytest tests/unittest/llmapi/test_llm_multi_gpu_pytorch.py::test_tinyllama_logits_processor_tp2pp2 -vTest plan
Links
Dev Engineer Review
single_step_greedynow travels withSampleStateTensorsHostTorch.new_tokens_hostbuffers correctly.sampler_strategy.pymypy error.QA Engineer Review
tests/unittest/_torch/sampler/test_torch_sampler.py.SampleStateTensorsHostTorch.single_step_greedy.tests/unittest/llmapi/test_llm_multi_gpu_pytorch.py::test_tinyllama_logits_processor_tp2pp2.tests/integration/test_lists/waives.txt.L0_MergeRequest_PRpipeline.Verdict: sufficient