Skip to content

[https://nvbugs/6426886][fix] Forward use_host_stop_criteria alongside sample_state.host and py_result_diffs… - #16149

Closed
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6426886
Closed

[https://nvbugs/6426886][fix] Forward use_host_stop_criteria alongside sample_state.host and py_result_diffs…#16149
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6426886

Conversation

@trtllm-agent

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

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: Last PP rank's use_host_stop_criteria=True (finish_reasons_host=None) is not propagated over the PP ring, so non-last ranks default to False and try to index the empty finish_reasons list.
  • Fix: Forward use_host_stop_criteria alongside sample_state.host and py_result_diffs in _ring_broadcast_sample_state, and restore it on the receiver (guarded by hasattr/getattr for other sampler flavors).
  • 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
    • Fixed an issue in pipeline-parallel generation where stop-criteria settings were not consistently shared across ranks.
    • Improved handling of host-side stopping behavior so non-final pipeline stages no longer follow an incorrect finish path in certain fast-stop cases.

TestDeepSeekV3Lite::test_nvfp4_4gpus[...pp4-fp8kv=True-attention_dp=True-
cuda_graph=True-overlap_scheduler=True...] hung and MPI_Aborted on PP=4.
Just before the hang, ranks 0/1/2 raised
IndexError: list index out of range in finish_if_reason at
sampler.py:2775 while indexing an empty finish_reasons list.

The last PP rank runs the fast-greedy path with
use_host_stop_criteria=True, which suppresses population of
finish_reasons_host on the SampleStateTorch. _ring_broadcast_sample_state
only forwarded (sample_state.host, py_result_diffs) to non-last PP ranks,
so their sample_state.use_host_stop_criteria stayed at the constructor
default False. Non-last ranks then entered the process_draft_tokens branch
in update_requests and raised IndexError on the empty finish_reasons list.
The exception killed the executor loop, peer ranks stalled in MPI
collectives, HangDetector fired and MPI_Abort was triggered.

Include use_host_stop_criteria in the PP ring payload and restore it on
the receiver. Guarded with hasattr/getattr so sampler flavors without the
field (e.g. SampleStateTRTLLM) are unaffected.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e85e6b7d-9235-429b-9f78-1057494e3fa1

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd00bb and 5c79ba6.

📒 Files selected for processing (1)
  • tensorrt_llm/_torch/pyexecutor/py_executor.py

📝 Walkthrough

Walkthrough

The PP ring broadcast in py_executor.py now transmits a use_host_stop_criteria flag alongside existing sample state data. The receiving side unpacks and conditionally applies this flag to sample_state, ensuring non-last pipeline-parallel ranks maintain consistent host-stop behavior with the last rank.

Changes

Host-Stop Criteria Broadcast Fix

Layer / File(s) Summary
Ring broadcast flag propagation
tensorrt_llm/_torch/pyexecutor/py_executor.py
Send path now includes use_host_stop_criteria (via getattr default False) in the broadcast tuple; receive path unpacks the extra value and conditionally sets it on sample_state for non-last PP ranks.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change, includes the NVBugs reference and fix type, and clearly states the propagation bug fix.
Description check ✅ Passed The PR includes the key summary and test plan, but it omits the template's explicit Description and PR Checklist sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@achartier

Copy link
Copy Markdown
Collaborator

Duplicate of #16133

@achartier achartier marked this as a duplicate of #16133 Jul 10, 2026
@achartier achartier closed this Jul 10, 2026
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.

3 participants