Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tensorrt_llm/_torch/pyexecutor/py_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3147,10 +3147,15 @@ def _ring_broadcast_sample_state(
if not self.dist.is_last_pp_rank:
# Receive tokens from previous pp rank (w.r.t model forward direction)
with nvtx_range("recv_sample_state"):
sample_state.host, py_result_diffs = self.dist.recv_object(
# SampleStateTorch carries a ``use_host_stop_criteria`` flag
# decided on the last PP rank; propagate it so ``update_requests``
# picks the same branch on all ranks. Other samplers ship None.
sample_state.host, py_result_diffs, use_host_stop_criteria = self.dist.recv_object(

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.

Two problems here beyond the missing attribute:

  1. The unpack is a strict 3-tuple, so this is not "backward-compatible 2/3-tuple handling" as the description claims — a 2-tuple payload raises ValueError. (Fine in practice since all ranks run the same build, but the description and the code disagree.)
  2. Sending None as an in-band "field absent" sentinel and using getattr(..., None) on the send side hides exactly the bug this PR has: a typo'd or nonexistent attribute name silently degrades to the old behavior instead of failing. Reference the dataclass field directly (sample_state.single_step_greedy) so an attribute mismatch is an AttributeError, and branch on isinstance(sample_state, SampleStateTorch) if other sampler state types need to skip it.

src=self.dist.prev_pp_rank,
tag=tag,
)
if use_host_stop_criteria is not None:
sample_state.use_host_stop_criteria = use_host_stop_criteria

for request, py_result_diff in zip(requests, py_result_diffs):
request.py_result.apply_diff(py_result_diff)
Expand All @@ -3168,7 +3173,8 @@ def _ring_broadcast_sample_state(
self.wait_on_pp_send_handles(self.send_handles, microbatch_id)
with nvtx_range("send_sample_state"):
self.send_handles[microbatch_id] = self.dist.isend_object(
(sample_state.host, py_result_diffs),
(sample_state.host, py_result_diffs,
getattr(sample_state, "use_host_stop_criteria", None)),

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.

use_host_stop_criteria does not exist on any SampleState class (nor at this PR's merge-base), so this getattr is always None, the receiver's guard never fires, and the change is a no-op -- while the waiver is removed, so the test will fail again as soon as it runs.

The flag you want is SampleStateTorch.single_step_greedy (sampler.py:1203): when set, sample_async skips write_finish_reasons (sampler.py:3045), and non-last ranks keep the False default from _forward_step_inter_pp, so they take the slow path and index an empty finish_reasons_list(). Please send that field and assign it unconditionally on recv; note SampleStateTRTLLM lacks it, so it probably belongs on the base SampleState.

dest=self.dist.next_pp_rank,
tag=tag,
)
Expand Down
1 change: 0 additions & 1 deletion tests/integration/test_lists/waives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_fp8_block_scales_4gpu
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_fp8_block_scales_4gpus[tp2pp2-mtp_nextn=0-fp8kv=True-attention_dp=False-cuda_graph=True-overlap_scheduler=True-torch_compile=True-sampler_async_worker=False] SKIP (https://nvbugs/6427411)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_fp8_block_scales_4gpus[tp2pp2-mtp_nextn=0-fp8kv=True-attention_dp=True-cuda_graph=True-overlap_scheduler=True-torch_compile=False-sampler_async_worker=False] SKIP (https://nvbugs/6427411)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_fp8_block_scales_4gpus[tp2pp2-mtp_nextn=0-fp8kv=True-attention_dp=True-cuda_graph=True-overlap_scheduler=True-torch_compile=True-sampler_async_worker=False] SKIP (https://nvbugs/6427411)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_nvfp4_4gpus[moe_backend=CUTEDSL-mtp_nextn=0-tp2pp2-fp8kv=False-attention_dp=False-cuda_graph=False-overlap_scheduler=False-low_precision_combine=False-torch_compile=True] SKIP (https://nvbugs/6428087)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_nvfp4_4gpus[moe_backend=CUTEDSL-mtp_nextn=0-tp2pp2-fp8kv=True-attention_dp=True-cuda_graph=True-overlap_scheduler=True-low_precision_combine=False-torch_compile=False] SKIP (https://nvbugs/6427411)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_nvfp4_4gpus[moe_backend=CUTLASS-mtp_nextn=0-pp4-fp8kv=False-attention_dp=False-cuda_graph=False-overlap_scheduler=False-low_precision_combine=False-torch_compile=True] SKIP (https://nvbugs/6384625)
accuracy/test_llm_api_pytorch.py::TestDeepSeekV3Lite::test_nvfp4_4gpus[moe_backend=CUTLASS-mtp_nextn=0-pp4-fp8kv=True-attention_dp=True-cuda_graph=True-overlap_scheduler=True-low_precision_combine=False-torch_compile=False] SKIP (https://nvbugs/6427411)
Expand Down
Loading