Skip to content

[https://nvbugs/7163265][fix] Forward pre-replay staging in MoE LoRA test - #23008

Merged
trtllm-agent merged 3 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-v2/nvbug-7163265-r701
Nov 30, 2026
Merged

trtllm-agent merged 3 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-v2/nvbug-7163265-r701

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Make the MoE LoRA integration test's counted_replay wrapper a typed
passthrough. It forwards positional and keyword arguments unchanged to
CUDAGraphRunner.replay, including pre_replay_staged, and returns its result.
The replay counter still increments once per call.

Merge main at 8a80ee6fd359f223d6e9108227a64945ac25c86f and remove the
temporary waiver for the native FP8 [cudagraph] case, restoring its existing
CI coverage.

Why this is a test-only fix

PR #22370
(7a8a07721021842e363c241e8372fbffa26af308) added this keyword to both the
production replay interface and its decoder callers. The test's counting
wrapper retained the older explicit signature and rejected the keyword before
delegating to the original replay method.

Forwarding arguments instead of copying the replay parameter list avoids
repeating that mismatch when keywords are added. Relative to the updated base,
this fix changes only the test instrumentation and removes its waiver.
Production code, numerical criteria, assertions, and test registrations are
unchanged by the fix.

Test Coverage

  • test_qwen_moe_native_fp8_lora_matches_bf16_reference[cudagraph] exercises the
    corrected wrapper, asserts LoRA graph replay, and compares the native FP8
    adapter's logit delta with its BF16 reference.
  • Its [eager] parametrization is the existing non-graph control.
  • The existing test_qwen_moe_routed_expert_multi_lora_varying_ranks[eager] and
    [cudagraph] cases provide adjacent MoE LoRA coverage.

These four cases are selected by tests/integration/test_lists/test-db/l0_h100.yml.
No new tests or registrations are added. Only this bug's exact waiver is removed.

Verification

  • Applicable pre-commit hooks pass, including an explicit check of the two
    outward-changed files after the conflict-free merge.
  • The wrapper's source is unchanged from the previously checked typed
    passthrough; all 18 test assertions remain unchanged.
  • Matched H100 verification uses one GPU, the CI image and development
    requirements, and a checksum-verified CI package built from the updated base.
  • Baseline: 8a80ee6fd359f223d6e9108227a64945ac25c86f;
    candidate: 659af2eb12d4c49171b42671e9f1acdf2070be1f.
  • Each arm runs all four cases together in one pytest process with --test-list,
    retaining the test-list timeouts. Both arms use the candidate's waiver list so
    the reported case is enabled for the before/after comparison.
  • Before: three cases pass; the native FP8 [cudagraph] case fails because
    counted_replay rejects pre_replay_staged, surfaced as a request error.
  • After: all four cases pass, with no errors or skips. The original numerical,
    cache, generation, and graph-replay assertions remain in place.

Fixes https://nvbugs/7163265

Dev Engineer Review

  • The test wrapper counted_replay now accepts arbitrary *args and **kwargs. It forwards them to CUDAGraphRunner.replay and still increments the counter before the call. This is test-only; no production code changed.
  • The change summary does not confirm that the wrapper returns the replay result. The objectives say it does. Verify this in the diff.
  • tests/integration/test_lists/waives.txt removes the NVBUG 7163265 skip for the native FP8 [cudagraph] case. The objectives say CI registrations are unchanged. That statement conflicts with this waiver removal.

QA Engineer Review

  • Modified: tests/integration/defs/llmapi/test_llm_api_pytorch_moe_lora.py. Modified test-list file: tests/integration/test_lists/waives.txt (one waiver removed).
  • Unwaived: test_qwen_moe_native_fp8_lora_matches_bf16_reference[cudagraph]. This case failed at baseline because the old wrapper rejected pre_replay_staged.
  • The author reports that the four H100 cases passed on candidate 3ed1de4cb307af817288322717d8bf73efd97270. This result is not independently verified. No completed CI check on the current head was supplied.
  • Test-db or qa list membership for these cases is not verified.
  • Coverage verdict: needs follow-up. Confirm a passing CI run on the head commit for the unwaived case, and confirm test-db listing.

Per-File QA Perspective

  • tests/integration/defs/llmapi/test_llm_api_pytorch_moe_lora.py: Covers native FP8 versus BF16 output and routed-expert multi-LoRA in eager and CUDA-graph modes. The wrapper now forwards pre_replay_staged, so the CUDA-graph path can run.
  • tests/integration/test_lists/waives.txt: Removes the skip for the native FP8 CUDA-graph case. Confirm this case runs and passes in the intended CI stage.

…test

PR NVIDIA#22370 (7a8a077) added
pre_replay_staged to CUDAGraphRunner.replay and its decoder callers.
Accept and forward that keyword in _run_paired_adapter_engine's replay
counter, preserving its instrumentation and the original replay behavior.

The existing test_qwen_moe_native_fp8_lora_matches_bf16_reference
cudagraph case covers this wrapper and asserts that LoRA replay occurs.

Fixes https://nvbugs/7163265

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

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CUDA-graph replay wrapper now accepts arbitrary positional and keyword arguments and forwards them to the original replay method. The test's replay-counting behavior remains unchanged. The skip-list entry for the Qwen MoE native FP8 LoRA versus BF16 reference CUDA-graph test is removed.

Changes

Replay argument forwarding

Layer / File(s) Summary
Update replay wrapper
tests/integration/defs/llmapi/test_llm_api_pytorch_moe_lora.py, tests/integration/test_lists/waives.txt
counted_replay accepts arbitrary positional and keyword arguments and forwards them to original_replay. The test imports Any for the wrapper annotation. The skip-list entry for the CUDA-graph test is removed.

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

Change: Other

Merge Risk: Minimal · up to 659af

This change updates a test wrapper so it passes all replay arguments through to the real method, and re-enables a previously skipped CUDA-graph test. It does not touch production code. No merge-blocking risk was found.

Architecture risk: Low · up to 659af

The change affects 1 source area.

Changed areas: tests

Review details

Systems and components

  • observed — 2 changed files mapped to tests.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the NVBugs ID and the [fix] type, and it describes the change: forwarding the pre-replay staging argument in the MoE LoRA test wrapper. This matches the main change in the changeset, w…
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.
Description check Passed The description follows the repository template in substance. It has a Summary, a Why section, Test Coverage, and Verification. It explains that the counted_replay wrapper rejected the pre_replay_stag…
Full details: Title check

Explanation

The title names the NVBugs ID and the [fix] type, and it describes the change: forwarding the pre-replay staging argument in the MoE LoRA test wrapper. This matches the main change in the changeset, which makes the counted_replay wrapper a passthrough that forwards pre_replay_staged. The title follows the repository template format.

Full details: Description check

Explanation

The description follows the repository template in substance. It has a Summary, a Why section, Test Coverage, and Verification. It explains that the counted_replay wrapper rejected the pre_replay_staged keyword added in PR #22370, that the fix forwards arguments unchanged, and that the NVBugs waiver is removed. Gaps: the template's PR title format and the PR Checklist are not addressed. The template's Description and Test Coverage headings are not used verbatim. The description also says the base was merged at 8a80ee6, while the objectives reference different revisions (86cc005 baseline and 3ed1de4 candidate), which is a conflict the author should reconcile.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3ed1de4 and 659af2e.

Files selected for processing: 2

  • tests/integration/defs/llmapi/test_llm_api_pytorch_moe_lora.py
  • tests/integration/test_lists/waives.txt
Files with no reviewable changes: 1

  • tests/integration/test_lists/waives.txt

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@trtllm-agent-review trtllm-agent-review left a comment

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.

Thanks for the PR. It updates the replay-counting wrapper in the MoE LoRA integration test to accept and forward the pre_replay_staged keyword that #22370 added to CUDAGraphRunner.replay, so the native FP8 [cudagraph] case no longer fails with TypeError.

Reviewed at commit 8c73e49dd6 (1 file, +7/−1).

Approve: no Blocker found. 2 suggestions below are nice to have.

Nice to have (2): 2 inline, 0 below
  • (N2: Test design and organization) counted_replay still hand-copies CUDAGraphRunner.replay's keywords, so the next keyword added there makes the FP8 [cudagraph] case fail with TypeError again (test_llm_api_pytorch_moe_lora.py:362)
  • (R3: Repository rules) The rewritten counted_replay signature has no type annotations, which CODING_GUIDELINES.md asks for on every function (test_llm_api_pytorch_moe_lora.py:356)
What this review checked
  • counted_replay now takes exactly the keyword-only parameters and defaults of CUDAGraphRunner.replay (tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py:1383-1391) and forwards all of them. Both decoder call sites pass only those keywords (tensorrt_llm/_torch/pyexecutor/engine/runners/decoder/graphs.py:828-850), and the signature is the same on current main.
  • Every other test stand-in for CUDAGraphRunner.replay already accepts pre_replay_staged or **kwargs: tests/integration/defs/kv_cache/test_final_single_token_context_cuda_graph.py:124-138, tests/unittest/_torch/pyexecutor/test_model_engine.py:110-115, tests/unittest/_torch/pyexecutor/test_cuda_graph_skip_warmup_pass.py:127 and the T5 and BART decoder wrappers. This wrapper was the last one #22370 left behind.
  • The fixed case runs where it is listed: tests/integration/test_lists/test-db/l0_h100.yml:409 has it in the single-GPU H100 post-merge block, its supports_native_fp8_lora gate is true on SM90 (cpp/tensorrt_llm/kernels/groupGemm.cu:51-55), and no waive names it or nvbugs/7163265.
  • Not covered: No GPU run: the before and after H100 results in the description were not reproduced.
  • Not covered: No CI result for the fixed case: it runs only in the post-merge H100 stages.

Automated review by trtllm-agent-review. If a point is wrong, reply in its thread. Once you have pushed code changes and replied in every Blocker thread, the bot re-checks the Blockers within a few hours. A Blocker you think should not be fixed needs no code change: reply in its thread with the reason and the evidence.

…counter

Forward replay arguments and the return value unchanged instead of copying CUDAGraphRunner.replay's evolving signature. Keep the existing replay-count instrumentation and annotate the wrapper. The existing native FP8 CUDA-graph integration case exercises this counter.

Fixes https://nvbugs/7163265

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

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87833 [ run ] triggered by Bot. Commit: 3ed1de4 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87833 [ run ] completed with state DISABLED
The CI pipeline is currently frozen to deploy an urgent hotfix. For time-sensitive requests, please contact @trt-llm-infra-devs.

Link to invocation

@ziyixiong-nv

Copy link
Copy Markdown
Collaborator

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87842 [ run ] triggered by Bot. Commit: 3ed1de4 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87842 [ run ] completed with state DISABLED
The CI pipeline is currently frozen to deploy an urgent hotfix. For time-sensitive requests, please contact @trt-llm-infra-devs.

Link to invocation

…163265-r701

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

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87980 [ run ] triggered by Bot. Commit: 659af2e Link to invocation

@github-actions

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #87980 [ run ] completed with state FAILURE. Commit: 659af2e
/LLM/main/L0_MergeRequest_PR pipeline #73031 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@BowenFu

BowenFu commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88049 [ run ] triggered by Bot. Commit: 659af2e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88049 [ run ] completed with state SUCCESS. Commit: 659af2e
/LLM/main/L0_MergeRequest_PR pipeline #73090 completed with status: 'SUCCESS'

CI Report

Link to invocation

@trtllm-agent
trtllm-agent added this pull request to the merge queue Nov 30, 2026
Merged via the queue into NVIDIA:main with commit 2a3fb58 Nov 30, 2026
23 checks passed
@trtllm-agent
trtllm-agent deleted the repair-bot-v2/nvbug-7163265-r701 branch November 30, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants