Skip to content

[https://nvbugs/6336682][fix] When spec_config is not None, set piecewise_named_args_fn to a lambda… - #15560

Closed
tensorrt-cicd wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6336682
Closed

[https://nvbugs/6336682][fix] When spec_config is not None, set piecewise_named_args_fn to a lambda…#15560
tensorrt-cicd wants to merge 2 commits into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6336682

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: piecewise_named_args_fn returned cm.named_args without cache_seq_interface, so EagleWrapper.forward fell back to the export-time prefill path which can't satisfy the post-transform target_model GraphModule's 458 cached state placeholders.
  • Fix: When spec_config is not None, set piecewise_named_args_fn to a lambda returning {**cm.named_args, "cache_seq_interface": cm}; otherwise leave the original behavior. Also drop the now-redundant nvbugs/6336682 waiver.
  • 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

  • Refactor

    • Improved model compilation configuration handling to more effectively manage batch size and maximum draft length parameters, with enhanced support for speculative decoding and piecewise compilation workflows.
  • Tests

    • Re-enabled accuracy validation test for TensorRT-LLM auto-deployment scenarios that was previously waived due to implementation issues, now indicating successful resolution and improved stability.

@coderabbitai

coderabbitai Bot commented Jun 23, 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: 17002e4b-9f2a-4ea6-ba7e-4f4265e592e0

📥 Commits

Reviewing files that changed from the base of the PR and between 07270b7 and 0fb399c.

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

📝 Walkthrough

Walkthrough

In CompileModel._apply_to_full_model, a new _named_args() helper conditionally adds cache_seq_interface to named args when spec_config is present. _get_args_kwargs is updated to pass max_draft_len to set_capture_batch when spec_config exists. The piecewise compilation path is updated to use _named_args. One CI test waiver for TestNemotronSuperV3::test_mtp is removed.

Changes

Speculative decoding compile-model fix and waiver cleanup

Layer / File(s) Summary
spec_config-aware named args and capture batch
tensorrt_llm/_torch/auto_deploy/transform/library/compile_model.py, tests/integration/test_lists/waives.txt
_named_args() helper conditionally augments named args with cache_seq_interface when spec_config is present; _get_args_kwargs passes max_draft_len to set_capture_batch; piecewise path switches from a plain cm.named_args lambda to _named_args; the waiver for TestNemotronSuperV3::test_mtp[fp8_ws4_80gb-trtllm] is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#15510: Modifies tests/integration/test_lists/waives.txt to adjust CI waiver entries for test_llm_api_autodeploy.py variants, the same file modified here.
  • NVIDIA/TensorRT-LLM#15511: Removes SKIP waiver entries for test_llm_api_autodeploy.py in waives.txt, directly overlapping with this PR's waiver removal.

Suggested reviewers

  • crazydemo
  • jieli-matrix
  • LarryXFly
  • StanleySun639
  • xinhe-nv
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and clearly summarizes the main change: setting piecewise_named_args_fn to include cache_seq_interface when spec_config is present.
Description check ✅ Passed The PR description includes a clear summary of the root cause, the fix, test coverage verification, and links to the relevant bug. It covers all essential sections required by the template.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6336682 branch from 0fb399c to 9534189 Compare June 24, 2026 05:45
…se CG capture for spec dec

The piecewise CUDA-graph capture path's piecewise_named_args_fn returned only
cm.named_args, omitting cache_seq_interface. When the EagleWrapper top-level
model is invoked with no cache_seq_interface, it dispatches to the
prefill-only fallback which calls the FX-graph target_model with just
inputs_embeds/position_ids; the post-transform target GraphModule expects
the full set of cached SSM/conv state placeholders, raising
TypeError: forward() missing 458 required positional arguments.

Mirror _get_args_kwargs (which already handles the spec_config branch) so
piecewise capture invokes the wrapper through the same KV-cache dispatch
the runtime uses (ad_executor.py:1011).

Also remove the now-redundant nvbugs/6336682 waiver.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@tensorrt-cicd
tensorrt-cicd force-pushed the repair-bot-bug6336682 branch from 9534189 to 813bcd1 Compare June 25, 2026 18:57
@hnover-nv

Copy link
Copy Markdown
Collaborator

/bot kill

@hnover-nv

Copy link
Copy Markdown
Collaborator

We disabled piecewise cuda graphs for spec dec for now, so the test was already unwaived. team doesn't have bandwidth to investiagte if this is the suficient fix, so just closing.

@hnover-nv hnover-nv closed this Jun 26, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator Author

PR_Github #56128 [ ] completed with state FAILURE. Commit: 7a298c8
Not allowed on merged PR

Link to invocation

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