Skip to content

[https://nvbugs/6428057][fix] In _ring_broadcast_sample_state, forward use_host_stop_criteria alongside… - #16130

Open
trtllm-agent wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6428057
Open

[https://nvbugs/6428057][fix] In _ring_broadcast_sample_state, forward use_host_stop_criteria alongside…#16130
trtllm-agent wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6428057

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: use_host_stop_criteria lives on SampleStateTorch (not on .host) and is not propagated across PP ranks; non-last-pp ranks default to False and enter process_draft_tokens, but the last rank left finish_reasons_host=None, so indexing raises IndexError.
  • Fix: In _ring_broadcast_sample_state, forward use_host_stop_criteria alongside sample_state.host in a 3-tuple; receiver restores it on the local sample_state (also tolerates the legacy 2-tuple form).
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Bug Fixes
    • Improved propagation of sampling stop-criteria settings across pipeline-parallel stages, ensuring downstream stages follow the same stopping behavior as the final stage.
  • Tests
    • Updated an integration test waiver list by removing a single waived case related to a specific PyTorch DeepSeek V3 Lite configuration.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

The PP ring broadcast of sample state in PyExecutor is updated to propagate an additional use_host_stop_criteria boolean flag alongside the existing host and py_result_diffs payload, on both the send and receive sides.

Changes

Ring broadcast payload update

Layer / File(s) Summary
Send and receive use_host_stop_criteria in ring broadcast
tensorrt_llm/_torch/pyexecutor/py_executor.py
Receive-side unpacks a 3-tuple including use_host_stop_criteria and assigns it onto sample_state; send-side forwards the flag via getattr(sample_state, "use_host_stop_criteria", False) to the next PP rank.

Estimated code review effort: 1 (Trivial) | ~5 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

The last PP rank sets state.use_host_stop_criteria=True when it evaluates
end-ID/length limits on the host, which suppresses population of
finish_reasons_host on the sample state. Prior to this fix, only
sample_state.host was ring-broadcasted to non-last PP ranks, so those
ranks re-entered the process_draft_tokens branch in update_requests
(their state.use_host_stop_criteria stayed at the default False) and
tried to index into an empty finish_reasons list, raising
IndexError: list index out of range.

Forward the flag alongside .host so non-last PP ranks take the same host
stop-criteria branch. The receiver accepts both the new 3-tuple form and
the legacy 2-tuple form to keep upgrades safe.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@trtllm-agent
trtllm-agent force-pushed the repair-bot-bug6428057 branch from 40d159e to 8386a90 Compare July 8, 2026 20:43
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

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.

2 participants