Skip to content

[https://nvbugs/6422315][fix] Decorate PythonMambaCacheManager.add_dummy_requests with…#16070

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

[https://nvbugs/6422315][fix] Decorate PythonMambaCacheManager.add_dummy_requests with…#16070
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6422315

Conversation

@trtllm-agent

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

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: add_dummy_requests writes into inference-tensor fields (prev_num_accepted_tokens/cache_buf_idx) without a torch.inference_mode() guard, unlike sibling helpers _prepare_mamba_cache_blocks and _refresh_dummy_request_mask.
  • Fix: Decorate PythonMambaCacheManager.add_dummy_requests with @torch.inference_mode() and remove the corresponding waiver line.
  • 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 cache setup behavior during inference-only execution, reducing unnecessary runtime tracking overhead.
    • Removed an outdated test exception entry so that the related accuracy check now runs as part of the integration suite.
  • Tests

    • Updated integration test expectations to better reflect current behavior.

PythonMambaCacheManager.add_dummy_requests writes into
self.mamba_cache.prev_num_accepted_tokens / cache_buf_idx on the MTP
replay path. Those tensors are inference tensors, so any in-place update
must run inside torch.inference_mode(). The sibling helpers
_prepare_mamba_cache_blocks and _refresh_dummy_request_mask are already
decorated; add_dummy_requests was missed by the replay-checkpoint
change, and under attention-DP it is invoked from
_pad_attention_dp_dummy_request outside any inference-mode guard,
producing 'Inplace update to inference tensor outside InferenceMode is
not allowed' on all ranks.

Add @torch.inference_mode() to PythonMambaCacheManager.add_dummy_requests
and unwaive TestNemotronSuperV3::test_mtp[bf16_ws4_180gb-trtllm].

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

coderabbitai Bot commented Jul 7, 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: 3961846e-1661-4201-86c7-ebcc615de53c

📥 Commits

Reviewing files that changed from the base of the PR and between ce67288 and 2c60957.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

📝 Walkthrough

Walkthrough

This PR makes two unrelated small changes: it adds a @torch.inference_mode() decorator to PythonMambaCacheManager.add_dummy_requests, and removes a SKIP waiver entry for TestNemotronSuperV3::test_mtp[bf16_ws4_180gb-trtllm] from the integration test waives list.

Changes

Small unrelated fixes

Layer / File(s) Summary
Inference mode decorator
tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
Adds @torch.inference_mode() decorator to PythonMambaCacheManager.add_dummy_requests.
Waive list update
tests/integration/test_lists/waives.txt
Removes the SKIP entry for TestNemotronSuperV3::test_mtp[bf16_ws4_180gb-trtllm] (nvbugs 6422315).

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

Possibly related PRs

Suggested reviewers: xinhe-nv, jieli-matrix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the main change: fixing add_dummy_requests under inference mode.
Description check ✅ Passed It covers the issue, fix, test plan, and bug link, though the template's Description and PR Checklist sections are omitted.
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.

@hnover-nv hnover-nv closed this Jul 8, 2026
@hnover-nv

Copy link
Copy Markdown
Collaborator

Duplicate with 16000

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