-
Notifications
You must be signed in to change notification settings - Fork 1.8k
tests: Add llama4 functional cases #6392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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 passesThese 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
📒 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.pytests/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.pytests/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 ScoutIt looks like the FP8 and NVFP4 entries for Llama-4-Scout in
gsm8k.yamlreportaccuracy: 0.00—the same pattern we see for other models:
- gsm8k.yaml (Llama-4-Scout-17B-16E) lines 22–27:
quant_algo: FP8→accuracy: 0.00quant_algo: NVFP4→accuracy: 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.00while others have nonzero scoresPlease confirm whether these zeros are:
- Placeholders awaiting actual benchmark results
- Intentional (quant mode unsupported or known issue)
- 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 documentWe observed that for the Scout model, both FP8 and NVFP4 entries report
accuracy: 0.00in 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_graphboolean and different model configurations is comprehensive.
1875-1895: Verify GPU memory and configuration for aggressive sequence lengthThis is the only integration test in test_e2e.py using
--max_seq_len=22000with--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=8setting 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 casesThe 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:
- The Jenkins lanes these lists feed have nodes with >= 8 GPUs and enough HBM for the 17 B model in FP8.
- The parametrizations (
attn_backend=…,tp8ep8,tp8ep4,tp8) exactly match what the underlyingpytest.mark.parametrizeinaccuracy/test_llm_api_pytorch.pyexposes; a typo here silently drops the test.- 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 – ensuretp4parameter existsLGTM functionally. One nit: the new Scout entries use the shorthand
tp4-cuda_graph=Truewhile earlier tests for this class usetp8ep*. Double-check thattp4is 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.
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
590fb23 to
9674925
Compare
|
/bot run |
|
PR_Github #13297 [ run ] triggered by Bot |
Signed-off-by: Ivy Zhang <[email protected]>
9674925 to
0fabb1f
Compare
|
PR_Github #13297 [ run ] completed with state |
|
/bot run |
|
PR_Github #13306 [ run ] triggered by Bot |
|
PR_Github #13306 [ run ] completed with state |
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]> Signed-off-by: Lanyu Liao <[email protected]>
Signed-off-by: Ivy Zhang <[email protected]>
Summary by CodeRabbit
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 thestage-listparameter 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.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip 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-pipelineReuse 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.