Skip to content

[https://nvbugs/6550727][fix] Pin _force_non_greedy_for_capture=False on the test double so it models a… - #17205

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

[https://nvbugs/6550727][fix] Pin _force_non_greedy_for_capture=False on the test double so it models a…#17205
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6550727

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: The test passed a bare Mock() as spec_metadata, and Mock auto-vivifies attributes, so the capture-override getattr(..., False) returned a truthy child Mock and tripped the assert.
  • Fix: Pin _force_non_greedy_for_capture=False on the test double so it models a real SpecMetadata outside warmup, leaving the production serving-correctness guard intact.
  • 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

Dev Engineer Review

  • The mock now sets _force_non_greedy_for_capture=False.
  • This matches SpecMetadata behavior outside warmup.
  • The production serving-correctness guard remains unchanged.
  • No API, configuration, or performance changes were found.

QA Engineer Review

  • Modified the speculative-overlap test in tests/unittest/_torch/executor/test_pytorch_model_engine.py.
  • No integration test-list files were modified.
  • Coverage in tests/integration/test_lists/ could not be confirmed.

Verdict: needs follow-up

…test double

The bare Mock() used as spec_metadata auto-vivifies every attribute, so
getattr(spec_metadata, '_force_non_greedy_for_capture', False) in
_prepare_tp_inputs never reached its False default and read a truthy child
Mock instead, tripping the capture-override assert added in b118fc3.

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

coderabbitai Bot commented Aug 3, 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: a151e604-2ce5-412d-afb1-b9b9c17fb463

📥 Commits

Reviewing files that changed from the base of the PR and between d8b25c5 and 9a651fc.

📒 Files selected for processing (1)
  • tests/unittest/_torch/executor/test_pytorch_model_engine.py

Walkthrough

The speculative-overlap test now explicitly sets _force_non_greedy_for_capture to False on its spec_metadata mock.

Changes

Capture Mock Behavior

Layer / File(s) Summary
Explicit capture flag configuration
tests/unittest/_torch/executor/test_pytorch_model_engine.py
The test replaces the bare Mock with a mock that explicitly disables _force_non_greedy_for_capture.

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

Suggested reviewers: bowenfu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the NVBugs issue, fix type, and primary change to the test double.
Description check ✅ Passed The description explains the root cause, fix, test plan, and related bug link, but uses different headings from the template.
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.

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