Skip to content

Conversation

@crazydemo
Copy link
Collaborator

@crazydemo crazydemo commented Jul 28, 2025

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for Llama-4 Maverick and Scout models, adding new scenarios for chunked prefill and FP8/FP4 quantization across various parallelism and CUDA graph settings.
    • Introduced end-to-end tests for large sequence lengths and chunked prefill on 8 GPUs.
    • Updated test lists to include all new cases.
  • Documentation
    • Updated accuracy reference data for GSM8K and MMLU benchmarks to include results for new quantization configurations.

Description

Test Coverage

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update introduces new quantization configurations (FP8 and FP4) and their accuracy references for the Llama-4 Maverick and Scout models in GSM8K and MMLU benchmarks. It also adds comprehensive test coverage for chunked prefill and quantized model variants, including new parameterized integration and end-to-end tests, and updates the test invocation list accordingly.

Changes

Cohort / File(s) Change Summary
Accuracy Reference Data
tests/integration/defs/accuracy/references/gsm8k.yaml, tests/integration/defs/accuracy/references/mmlu.yaml
Added new entries for Llama-4 Maverick and Scout models with FP8 and NVFP4 quantization configurations, including corresponding accuracy values for GSM8K and MMLU benchmarks. No changes to existing entries.
LLM API PyTorch Accuracy Tests
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Introduced multiple new test methods in TestLlama4MaverickInstruct and TestLlama4ScoutInstruct to evaluate chunked prefill and various quantized model variants (FP8, FP4) with different parallelism and CUDA graph settings. Tests assert quantization algorithms and run MMLU/GSM8K tasks. Existing tests remain unchanged.
End-to-End Integration Test
tests/integration/defs/test_e2e.py
Added a new test function to run the quickstart_advanced.py example with chunked prefill enabled on 8 GPUs, covering FP8 and FP4 models, with/without CUDA graph, and long sequence lengths. No modifications to existing tests.
Test Invocation List
tests/integration/test_lists/qa/examples_test_list.txt
Updated test list by adding new entries for chunked prefill and quantized model tests (FP8, FP4) for both Maverick and Scout models in accuracy and end-to-end suites. No existing test entries were removed or modified.

Sequence Diagram(s)

sequenceDiagram
    participant Tester
    participant TestSuite
    participant LLM
    participant Benchmark

    Tester->>TestSuite: Run new quantized model test (FP8/FP4, chunked prefill, etc.)
    TestSuite->>LLM: Load model with quantization and prefill config
    LLM-->>TestSuite: Model instance with quantization set
    TestSuite->>Benchmark: Run MMLU / GSM8K evaluation
    Benchmark-->>TestSuite: Return accuracy result
    TestSuite-->>Tester: Assert quantization and accuracy, report result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#5549: Introduced the initial chunked prefill test method for Llama-4 models, which this PR extends with broader quantization and test coverage.
  • NVIDIA/TensorRT-LLM#6104: Implemented core chunked prefill support in speculative decode models; this PR’s test additions directly relate to that feature.

Suggested reviewers

  • LarryXFly
  • yilin-void
  • Shixiaowei02
  • pamelap-nvidia

Poem

In the warren of code, new tests now appear,
Chunked prefill and quantization—let’s give a cheer!
Maverick and Scout, with FP8 and FP4,
Run benchmarks and sequences, accuracy to explore.
With every new test, the coverage grows tight—
A rabbit’s delight, as features take flight!
🐇✨


📜 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 9674925 and 0fabb1f.

📒 Files selected for processing (5)
  • 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 (2 hunks)
  • tests/integration/defs/test_e2e.py (1 hunks)
  • tests/integration/test_lists/qa/examples_test_list.txt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/integration/defs/accuracy/references/gsm8k.yaml
  • tests/integration/test_lists/qa/examples_test_list.txt
  • tests/integration/defs/accuracy/references/mmlu.yaml
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/integration/defs/test_e2e.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 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.

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 (2)
tests/integration/defs/test_e2e.py (1)

1875-1876: Consider adding memory usage validation.

Unlike other similar tests in the file, this test doesn't include memory usage checking with _check_mem_usage(). Consider adding memory validation to ensure the test runs within expected memory bounds on 8 GPUs.

Add memory usage validation similar to other tests:

+    mapping = {
+        "Llama-4-Maverick-17B-128E-Instruct-FP8": [expected_memory_per_gpu, 0, 0, 0],
+        "Llama-4-Scout-17B-16E-Instruct-FP8": [expected_memory_per_gpu, 0, 0, 0],
+        "Llama-4-Scout-17B-16E-Instruct-FP4": [expected_memory_per_gpu, 0, 0, 0],
+    }
+    with tempfile.NamedTemporaryFile(mode='w+t',
+                                     suffix=f".{model_name}.log",
+                                     dir="./",
+                                     delete=True,
+                                     delete_on_close=True) as running_log:
-    llm_venv.run_cmd(cmd)
+        llm_venv.run_cmd(cmd, stdout=running_log)
+        if model_name in mapping:
+            _check_mem_usage(running_log, mapping[model_name], 8)
tests/integration/test_lists/qa/examples_test_list.txt (1)

533-536: Mark the 22 k-token E2E examples as slow to avoid blocking quick CI passes

These 22 k-sequence, 8-GPU chunked-prefill runs will be among the slowest in the whole suite. Add an explicit timeout or move them to the “nightly / long” list so that core CI remains green.

Example patch:

-test_ptp_quickstart_advanced_8gpus_chunked_prefill_sq_22k[…]
+test_ptp_quickstart_advanced_8gpus_chunked_prefill_sq_22k[…] TIMEOUT (120)

(or whichever duration is realistic).

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a55c631 and 2da7905.

📒 Files selected for processing (5)
  • 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 (2 hunks)
  • tests/integration/defs/test_e2e.py (1 hunks)
  • tests/integration/test_lists/qa/examples_test_list.txt (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code 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 Python file, prefer docstrings over comments.
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 it.
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/test_e2e.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,h,hpp,cc,cxx,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/test_e2e.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧬 Code Graph Analysis (1)
tests/integration/defs/test_e2e.py (2)
tests/integration/defs/conftest.py (3)
  • llm_root (180-181)
  • llm_venv (707-723)
  • llm_models_root (77-83)
tests/integration/defs/triton_server/conftest.py (1)
  • llm_models_root (16-25)
🪛 Ruff (0.12.2)
tests/integration/defs/accuracy/test_llm_api_pytorch.py

502-502: Undefined name CudaGraphConfig

(F821)

⏰ 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 (13)
tests/integration/defs/accuracy/references/gsm8k.yaml (2)

17-19: LGTM on Maverick FP8 configuration.

The FP8 quantization configuration for Llama-4-Maverick with accuracy 83.30 follows the established pattern and has a reasonable accuracy value.


22-27: Confirm placeholder 0.00 accuracy entries for quantized Scout

It looks like the FP8 and NVFP4 entries for Llama-4-Scout in gsm8k.yaml report accuracy: 0.00—the same pattern we see for other models:

  • gsm8k.yaml (Llama-4-Scout-17B-16E) lines 22–27:
    • quant_algo: FP8accuracy: 0.00
    • quant_algo: NVFP4accuracy: 0.00
  • mmlu.yaml (mistralai/Mistral-7B-v0.1) lines 74–79:
    • FP8 & NVFP4 entries both have accuracy: 0.00
  • gsm8k.yaml (deepseek-ai/DeepSeek-V3-Lite) lines 25–27:
    • One NVFP4+kv_cache entry also shows accuracy: 0.00 while others have nonzero scores

Please confirm whether these zeros are:

  1. Placeholders awaiting actual benchmark results
  2. Intentional (quant mode unsupported or known issue)
  3. Incorrect values that need updating

Depending on your answer, we should either update these with real measurements, mark them “N/A” with a comment, or remove the unsupported configurations.

tests/integration/defs/accuracy/references/mmlu.yaml (2)

69-71: LGTM on Maverick FP8 configuration.

The FP8 quantization configuration for Llama-4-Maverick with accuracy 86.45 follows the established pattern and shows reasonable accuracy for MMLU benchmark.


74-79: Quantized Scout accuracies are zero across benchmarks – please confirm and document

We observed that for the Scout model, both FP8 and NVFP4 entries report accuracy: 0.00 in GSM8K and MMLU:

• tests/integration/defs/accuracy/references/gsm8k.yaml
Lines showing:

  - quant_algo: FP8
    kv_cache_quant_algo: FP8
    accuracy: 0.00
  - quant_algo: NVFP4
    accuracy: 0.00

• tests/integration/defs/accuracy/references/mmlu.yaml
Lines 74–79 showing the same zero values.

This consistency suggests these quantized runs aren’t yet producing valid metrics (perhaps unimplemented or placeholder values). Please verify that these zeros are expected and, if so, document this behavior—either in the YAML reference files or the README—to avoid confusion.

tests/integration/defs/test_e2e.py (2)

1863-1874: Well-structured test decorators and parametrization.

The test properly uses architecture-specific skip conditions and covers the expected model variants with appropriate marks. The parametrization for cuda_graph boolean and different model configurations is comprehensive.


1875-1895: Verify GPU memory and configuration for aggressive sequence length

This is the only integration test in test_e2e.py using --max_seq_len=22000 with --kv_cache_fraction=0.85. Please confirm:

  • The test environment has sufficient GPU memory headroom to handle a 22 k token context at 85% KV cache usage.
  • The CI/test harness reliably allocates all 8 GPUs before this test runs.
  • The --moe_ep_size=8 setting matches the 8-way tensor parallelism (TP) and that experts are evenly distributed.
tests/integration/test_lists/qa/examples_test_list.txt (2)

455-461: Great coverage boost — check infra can actually run these heavy Maverick cases

The added chunked-prefill and FP8 pre-quantized tests are valuable, but each variant (22 k ctx, 8-GPU, CUDA-graph) is memory- and time-intensive.
Before merging, please verify that:

  1. The Jenkins lanes these lists feed have nodes with >= 8 GPUs and enough HBM for the 17 B model in FP8.
  2. The parametrizations (attn_backend=…, tp8ep8, tp8ep4, tp8) exactly match what the underlying pytest.mark.parametrize in accuracy/test_llm_api_pytorch.py exposes; a typo here silently drops the test.
  3. Expected wall-clock fits within the configured timeout (many existing slow tests have an explicit TIMEOUT (…) tag – consider adding one if these exceed ~90 min).

465-470: Scout FP8/FP4 additions look fine – ensure tp4 parameter exists

LGTM functionally. One nit: the new Scout entries use the shorthand tp4-cuda_graph=True while earlier tests for this class use tp8ep*. Double-check that tp4 is indeed a valid id in the test’s parameter matrix; otherwise pytest will raise “parameter set not found”.

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

401-417: LGTM! Well-structured chunked prefill test.

The test method properly configures chunked prefill with appropriate parameters and covers both attention backends. The GPU requirements and model configuration are correctly set.


418-439: LGTM! Comprehensive FP8 quantization test.

The test method correctly verifies the quantization configuration and covers multiple evaluation tasks. The parametrization for different parallel configurations is appropriate.


440-462: LGTM! Good combination of FP8 and chunked prefill testing.

The test method effectively combines FP8 quantization with chunked prefill, properly verifies the quantization configuration, and runs comprehensive evaluations.


511-531: LGTM! Proper FP8 chunked prefill test for Scout model.

The test method correctly implements FP8 quantization with chunked prefill, uses the proper CUDA graph configuration, and includes comprehensive evaluation tasks.


532-574: LGTM! Comprehensive FP4 quantization test coverage.

Both FP4 test methods are well-implemented:

  • Proper architecture requirements with @skip_pre_blackwell
  • Correct quantization algorithm assertions (NVFP4 + FP8 KV cache)
  • Good coverage of both standalone and chunked prefill variants
  • Appropriate parallel configuration testing

The implementation follows established patterns and provides thorough test coverage for FP4 quantization.

@crazydemo crazydemo force-pushed the add_llama4_case branch 4 times, most recently from 590fb23 to 9674925 Compare July 29, 2025 04:05
@crazydemo crazydemo marked this pull request as ready for review July 29, 2025 05:01
@crazydemo crazydemo requested a review from a team as a code owner July 29, 2025 05:01
@crazydemo
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13297 [ run ] triggered by Bot

Signed-off-by: Ivy Zhang <[email protected]>
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13297 [ run ] completed with state SUCCESS
/LLM/release-0.21/L0_MergeRequest_PR pipeline #263 completed with status: 'FAILURE'

@crazydemo
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13306 [ run ] triggered by Bot

@LarryXFly LarryXFly merged commit 94de3c1 into NVIDIA:release/0.21 Jul 29, 2025
2 of 3 checks passed
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13306 [ run ] completed with state SUCCESS
/LLM/release-0.21/L0_MergeRequest_PR pipeline #264 completed with status: 'FAILURE'

dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Aug 1, 2025
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Aug 1, 2025
dc3671 pushed a commit to dc3671/TensorRT-LLM that referenced this pull request Aug 4, 2025
dc3671 pushed a commit that referenced this pull request Aug 4, 2025
lancelly pushed a commit to lancelly/TensorRT-LLM that referenced this pull request Aug 6, 2025
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Lanyu Liao <[email protected]>
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.

4 participants