Skip to content

Conversation

byshiue
Copy link
Collaborator

@byshiue byshiue commented Jul 30, 2025

This PR has following works:

  1. Add eagle3 explanation into Qwen3 document.
  2. Add Qwen3-235B-A22B + Eagle3 CI: accuracy/test_llm_api_pytorch.py::TestQwen3_235B_A22B::test_nvfp4[latency_moe_trtllm_eagle3]
  3. unwaive test: examples/test_granite.py::test_granite_bf16_lora[granite-3.0-1b-a400m-instruct]

Summary by CodeRabbit

  • Documentation
    • Updated Qwen model documentation to include details on Eagle3 speculative decoding support, configuration examples, and current limitations.
  • Tests
    • Added new accuracy references for the Qwen3-235B-A22B model using Eagle3 speculative decoding for GSM8K and MMLU benchmarks.
    • Enhanced test coverage for Qwen3-235B-A22B to include Eagle3 speculative decoding scenarios.
    • Added a new latency test variant with Eagle3 to the multi-node test configuration.
    • Removed a waiver for a previously skipped Granite model test.

Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

📝 Walkthrough

Walkthrough

This change updates the Qwen3 model documentation to describe Eagle3 speculative decoding support, adds new accuracy reference entries for Eagle3 in GSM8K and MMLU benchmarks, parameterizes and extends the related integration test to cover Eagle3, updates test lists to include the new Eagle3 variant, and removes a waiver for an unrelated test.

Changes

Cohort / File(s) Change Summary
Qwen3 Documentation Update
examples/models/core/qwen/README.md
Added a section on enabling Eagle3 speculative decoding in Qwen3, including configuration instructions, limitations, an example config snippet, and updated the table of contents.
Accuracy Reference Additions
tests/integration/defs/accuracy/references/gsm8k.yaml, tests/integration/defs/accuracy/references/mmlu.yaml
Added new accuracy entries for Qwen3/Qwen3-235B-A22B with spec_dec_algo: Eagle and relevant quantization settings.
Integration Test Parameterization
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Parameterized the test_nvfp4 method to include an eagle3 flag, updated the test to configure and run with Eagle3 speculative decoding.
Test List Update
tests/integration/test_lists/test-db/l0_gb200_multi_nodes.yml
Added the Eagle3 variant of the Qwen3 test to the TIMEOUT list for multi-node testing.
Test Waiver Removal
tests/integration/test_lists/waives.txt
Removed a skip entry for an unrelated Granite model test.

Sequence Diagram(s)

sequenceDiagram
    participant Tester as Integration Test
    participant LLM as LLM Context Manager
    participant Qwen3 as Qwen3 Model

    Tester->>LLM: Initialize with Eagle3 speculative_config (if eagle3=True)
    LLM->>Qwen3: Load model with Eagle3 config
    Qwen3-->>LLM: Ready for inference
    LLM-->>Tester: Run evaluation (GSM8K/MMLU) with Eagle3 decoding
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

Community want to contribute, Documentation

Suggested reviewers

  • yilin-void
  • litaotju
  • yizhang-nv

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49edb97 and faf1f6f.

📒 Files selected for processing (1)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
⏰ 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
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot requested review from brb-nv, litaotju and yilin-void July 30, 2025 08:17
@byshiue byshiue force-pushed the qwen3_235b_eagle3_ci branch from 2d4187c to 49edb97 Compare July 30, 2025 08:17
@byshiue
Copy link
Collaborator Author

byshiue commented Jul 30, 2025

/bot run

@coderabbitai coderabbitai bot requested a review from yizhang-nv July 30, 2025 08:21
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13513 [ run ] triggered by Bot

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
tests/integration/defs/accuracy/references/mmlu.yaml (1)

173-176: Duplicate accuracy record – consider merging to avoid ambiguity

This new item repeats the exact (quant_algo=NVFP4, kv_cache_quant_algo=FP8, accuracy=86) tuple already declared on Lines 170-172, differing only by adding spec_dec_algo: Eagle.
If the accuracy-validation logic keys solely off model + quant_algo + kv_cache_quant_algo, the duplicate may be ignored or, worse, generate the wrong reference being picked at random.

-  - quant_algo: NVFP4
-    kv_cache_quant_algo: FP8
-    accuracy: 86
-  - spec_dec_algo: Eagle
-    quant_algo: NVFP4
-    kv_cache_quant_algo: FP8
-    accuracy: 86
+  - spec_dec_algo: Eagle        # merge the new flag into one entry
+    quant_algo: NVFP4
+    kv_cache_quant_algo: FP8
+    accuracy: 86

Please confirm the de-duplication rules of the harness and collapse the records if necessary.

tests/integration/defs/accuracy/references/gsm8k.yaml (1)

89-92: Same duplication issue as in MMLU reference

Lines 83-88 already store the (quant_algo=NVFP4, kv_cache_quant_algo=FP8, accuracy=85.78) tuple; Lines 89-92 re-insert it with spec_dec_algo: Eagle.
Ensure the accuracy loader will not treat this as two independent references for the same setting and merge if required (see previous diff example).

examples/models/core/qwen/README.md (1)

909-923: Use a heredoc instead of multi-line echo for the sample config

Using echo "…" with embedded new-lines is brittle and often collapses whitespace,
especially when copy-pasted. A small switch to cat <<EOF > ${path_config} is more
robust and readable.

-echo "
-enable_attention_dp: false
-speculative_config:
-    decoding_type: Eagle
-    max_draft_len: 3
-    speculative_model_dir: <EAGLE3_DRAFT_MODEL_PATH>
-kv_cache_config:
-    enable_block_reuse: false
-" >> ${path_config}
+cat >"${path_config}" <<'EOF'
+enable_attention_dp: false
+speculative_config:
+  decoding_type: Eagle
+  max_draft_len: 3
+  speculative_model_dir: <EAGLE3_DRAFT_MODEL_PATH>
+kv_cache_config:
+  enable_block_reuse: false
+EOF

Minor, but it prevents accidental formatting issues for users following the doc.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fe9cc0 and 49edb97.

📒 Files selected for processing (6)
  • examples/models/core/qwen/README.md (2 hunks)
  • tests/integration/defs/accuracy/references/gsm8k.yaml (1 hunks)
  • tests/integration/defs/accuracy/references/mmlu.yaml (1 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (1 hunks)
  • tests/integration/test_lists/test-db/l0_gb200_multi_nodes.yml (1 hunks)
  • tests/integration/test_lists/waives.txt (0 hunks)
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: The code developed for TensorRT-LLM should conform to Python 3.8+.
Indent Python code with 4 spaces. Do not use tabs.
Always maintain the namespace when importing in Python, even if only one class or function from a module is used.
Python filenames should use snake_case (e.g., some_file.py).
Python classes should use PascalCase (e.g., class SomeClass).
Python functions and methods should use snake_case (e.g., def my_awesome_function():).
Python local variables should use snake_case. Prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (e.g., G_MY_GLOBAL).
Python constants should use upper snake_case (e.g., MY_CONSTANT).
Avoid shadowing variables declared in an outer scope in Python.
Initialize all externally visible members of a Python class in the constructor.
For interfaces that may be used outside a file, prefer docstrings over comments in Python.
Comments in Python should be reserved for code within a function, or interfaces that are local to a file.
Use Google style docstrings for Python classes and functions, which can be parsed by Sphinx.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the docstring for the class.
Avoid using reflection in Python when functionality can be easily achieved without reflection.
When using try-except blocks in Python, limit the except to the smallest set of errors possible.
When using try-except blocks to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,h,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (2)
tests/integration/test_lists/test-db/l0_gb200_multi_nodes.yml (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

🧬 Code Graph Analysis (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (2)
tensorrt_llm/llmapi/llm_args.py (3)
  • KvCacheConfig (818-897)
  • EagleDecodingConfig (386-412)
  • speculative_model_dir (1237-1238)
tests/integration/defs/conftest.py (1)
  • llm_models_root (77-83)
🔇 Additional comments (4)
tests/integration/test_lists/test-db/l0_gb200_multi_nodes.yml (1)

21-21: Verified: test_nvfp4[latency_moe_trtllm_eagle3] Exists

Confirmed in tests/integration/defs/accuracy/test_llm_api_pytorch.py at line 1899:

  • The parameter list includes "latency_moe_trtllm_eagle3" under the test_nvfp4 decorator.

No changes required.

tests/integration/defs/accuracy/test_llm_api_pytorch.py (3)

1891-1900: LGTM! Parameter addition for Eagle3 testing.

The parametrization correctly adds the eagle3 parameter with appropriate test configurations. The Eagle3 test case properly disables attention_dp, cuda_graph, and overlap_scheduler, which aligns with the documented limitations of Eagle3 speculative decoding.


1902-1903: LGTM! Method signature correctly updated.

The eagle3 parameter has been properly added to the method signature, maintaining consistency with the parametrization.


1926-1927: LGTM! Proper integration with LLM constructor.

The kv_cache_config and speculative_config are correctly passed to the LLM constructor, enabling Eagle3 speculative decoding when the parameter is set.

Signed-off-by: bhsueh <[email protected]>
@byshiue
Copy link
Collaborator Author

byshiue commented Jul 30, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13517 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13513 [ run ] completed with state ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13517 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10126 completed with status: 'SUCCESS'

@jhaotingc jhaotingc requested review from jhaotingc and removed request for jhaotingc July 31, 2025 01:19
@byshiue byshiue merged commit ae3a5fc into NVIDIA:main Jul 31, 2025
3 checks passed
lancelly pushed a commit to lancelly/TensorRT-LLM that referenced this pull request Aug 6, 2025
jain-ria pushed a commit to jain-ria/TensorRT-LLM that referenced this pull request Aug 7, 2025
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