KEMBAR78
[None][fix] Fix MTP 2-model by mikeiovine · Pull Request #8115 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@mikeiovine
Copy link
Collaborator

@mikeiovine mikeiovine commented Oct 1, 2025

Description

Fix API issues. This was not caught by the unit test because it was never properly enabled.

Overlap scheduler has accuracy issues. Disable for now.

Test Coverage

Enable the existing test.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Summary by CodeRabbit

  • New Features

    • Added dedicated support for MTP Eagle mode with appropriate metadata and resource management.
    • Improved handling of draft token limits with smarter runtime configuration.
    • Conditional initialization of speculative tree management based on available options.
  • Bug Fixes

    • Disabled overlap scheduling for MTP Eagle mode to prevent accuracy issues.
  • Tests

    • Added an integration test covering the advanced MTP Eagle quickstart (BF16 variant).

Signed-off-by: Mike Iovine <6158008+mikeiovine@users.noreply.github.com>
@mikeiovine mikeiovine requested a review from a team as a code owner October 1, 2025 17:06
@mikeiovine mikeiovine requested a review from kris1025 October 1, 2025 17:06
@mikeiovine mikeiovine changed the title Fix MTP 2-model [None][fix] Fix MTP 2-model Oct 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

📝 Walkthrough

Walkthrough

Implements MTP Eagle mode handling across speculative decoding: guarded Eagle3 resource manager initialization, dedicated metadata path for MTP Eagle, and an overlap-scheduler disablement for MTP_EAGLE. Adds a test entry for MTP Eagle. No public exports removed; Eagle3SpecMetadata gains an is_mtp_eagle parameter.

Changes

Cohort / File(s) Summary
Speculative decoding: MTP Eagle handling
tensorrt_llm/_torch/speculative/eagle3.py, tensorrt_llm/_torch/speculative/interface.py, tensorrt_llm/_torch/speculative/utils.py
Eagle3ResourceManager.init now conditionally reads max_total_draft_tokens from EagleDecodingConfig via isinstance check and instantiates spec_tree_manager only when EagleDecodingConfig with eagle_choices is provided. SpeculativeDecodingMode.support_overlap_scheduler short-circuits to False for MTP_EAGLE. get_spec_metadata adds a new first-checked branch for is_mtp_eagle returning Eagle3SpecMetadata with is_mtp_eagle=True and Eagle-specific resources. Eagle3SpecMetadata signature extended with is_mtp_eagle.
Tests
tests/integration/test_lists/test-db/l0_b200.yml
Adds test entry: test_ptp_quickstart_advanced_mtp_eagle[DeepSeek-V3-Lite-BF16-DeepSeek-V3-Lite/bf16].

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant SpecMode as SpeculativeDecodingMode
  participant Utils as get_spec_metadata
  participant RM as Eagle3ResourceManager

  Caller->>SpecMode: support_overlap_scheduler()
  alt mode == MTP_EAGLE
    SpecMode-->>Caller: False (early return)
  else other modes
    SpecMode-->>Caller: fallback logic
  end

  Caller->>Utils: get_spec_metadata(spec_dec_mode, config, model)
  alt spec_dec_mode.is_mtp_eagle
    Utils->>RM: init(config)
    note right of RM: If config is EagleDecodingConfig:<br/>- set max_total_draft_tokens from config<br/>- create spec_tree_manager when eagle_choices present
    RM-->>Utils: resource manager
    Utils-->>Caller: Eagle3SpecMetadata(..., is_mtp_eagle=True)
  else spec_dec_mode.is_eagle3
    Utils-->>Caller: Eagle3SpecMetadata(..., is_mtp_eagle=False)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning While the description provides a brief “what” and “why” under the Description heading and mentions enabling the existing test, it omits the required summary block at the top of the template and lacks detail in the Test Coverage section (such as the specific test name), so it does not fully follow the repository’s PR description template. Please add the top‐level summary directive (e.g., “@coderabbitai summary”) and ensure the Test Coverage section lists the exact test identifier(s) impacted by this change, matching the repository’s description template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “[None][fix] Fix MTP 2-model” is too terse and ambiguous to convey the primary change in this pull request, as it does not clarify what “2-model” refers to and omits key aspects like the API fixes for MTP Eagle mode and the overlap scheduler adjustment. This makes it difficult for maintainers reviewing history to quickly understand the intent and scope of the changes. Please revise the title to clearly summarize the main change—for example, “[None][fix] Disable overlap scheduler for MTP Eagle mode and fix related API handling”—so that readers immediately grasp the core update.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7581bb and 039344c.

📒 Files selected for processing (4)
  • tensorrt_llm/_torch/speculative/eagle3.py (2 hunks)
  • tensorrt_llm/_torch/speculative/interface.py (1 hunks)
  • tensorrt_llm/_torch/speculative/utils.py (1 hunks)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tensorrt_llm/_torch/speculative/eagle3.py
  • tensorrt_llm/_torch/speculative/utils.py
  • tensorrt_llm/_torch/speculative/interface.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tensorrt_llm/_torch/speculative/eagle3.py
  • tensorrt_llm/_torch/speculative/utils.py
  • tensorrt_llm/_torch/speculative/interface.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tensorrt_llm/_torch/speculative/eagle3.py
  • tensorrt_llm/_torch/speculative/utils.py
  • tensorrt_llm/_torch/speculative/interface.py
🧬 Code graph analysis (2)
tensorrt_llm/_torch/speculative/eagle3.py (1)
tensorrt_llm/llmapi/llm_args.py (1)
  • EagleDecodingConfig (449-562)
tensorrt_llm/_torch/speculative/utils.py (4)
tensorrt_llm/llmapi/llm_args.py (3)
  • spec_dec_mode (410-417)
  • spec_dec_mode (546-551)
  • spec_dec_mode (661-668)
tensorrt_llm/_torch/speculative/interface.py (1)
  • is_mtp_eagle (34-35)
tensorrt_llm/_torch/speculative/eagle3.py (1)
  • Eagle3SpecMetadata (108-222)
tensorrt_llm/_torch/model_config.py (1)
  • torch_dtype (201-206)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (3)
tensorrt_llm/_torch/speculative/interface.py (1)

66-69: Disable overlap scheduler for MTP_EAGLE

Thanks for short-circuiting the overlap path; until the accuracy bug is fixed this keeps us from reintroducing bad tokens.

tensorrt_llm/_torch/speculative/utils.py (1)

30-43: MTP_EAGLE metadata wiring

Reusing Eagle3SpecMetadata with the is_mtp_eagle flag looks solid—the one-layer capture path in __post_init__ keeps the drafter logic aligned.

tests/integration/test_lists/test-db/l0_b200.yml (1)

58-58: Nice addition for MTP-Eagle coverage.

This brings the new MTP Eagle path under pre-merge coverage, matching the functionality fixes in the PR.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mikeiovine
Copy link
Collaborator Author

/bot run

@mikeiovine mikeiovine requested a review from yweng0828 October 1, 2025 18:24
@tensorrt-cicd
Copy link
Collaborator

PR_Github #20482 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20482 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15446 completed with status: 'FAILURE'

@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20536 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20536 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15493 completed with status: 'FAILURE'

@mikeiovine
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20555 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20555 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15512 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@mikeiovine mikeiovine requested a review from zheyuf October 3, 2025 14:39
Signed-off-by: Mike Iovine <miovine@nvidia.com>
@mikeiovine
Copy link
Collaborator Author

/bot --reuse-pipeline

@mikeiovine mikeiovine enabled auto-merge (squash) October 3, 2025 15:53
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@mikeiovine
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20597 [ reuse-pipeline ] triggered by Bot

Signed-off-by: Mike Iovine <mike.iovine7@gmail.com>
@mikeiovine
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20597 [ reuse-pipeline ] completed with state SUCCESS
Release Check Pipeline #2128 failed
Reusing PR_Github #20555 for commit 9c6caaa

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20599 [ reuse-pipeline ] triggered by Bot

Signed-off-by: Mike Iovine <mike.iovine7@gmail.com>
@mikeiovine
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20602 [ reuse-pipeline ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20599 [ reuse-pipeline ] completed with state ABORTED
Can't reuse PR_Github #20555 with status: SUCCESS

@mikeiovine
Copy link
Collaborator Author

/bot skip --comment "CI already passed before rebase"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20604 [ skip ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20602 [ reuse-pipeline ] completed with state ABORTED
Can't reuse PR_Github #20555 with status: SUCCESS

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20604 [ skip ] completed with state SUCCESS
Skipping testing for commit fff67b7

@mikeiovine mikeiovine merged commit ca82911 into NVIDIA:main Oct 3, 2025
5 checks passed
@mikeiovine mikeiovine deleted the fix-mtp branch October 3, 2025 17:15
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