Skip to content

Conversation

chenfeiz0326
Copy link
Collaborator

@chenfeiz0326 chenfeiz0326 commented Aug 17, 2025

Description

This PR fixes Llama3.3 70B fp8/fp4 gsm8k's accuracy drop by adding max_tokens=256.

This PR fixes Llama3.3 70B fp4's illegal memory access by adding free_gpu_mem_fraction=0.5, max_batch_size=32.

FP8 MMLU on H200:
MMLU weighted average accuracy: 80.51 (4104)

FP8 GSM8K on H200:

Tasks Version Filter n-shot Metric Value Stderr
gsm8k 3 flexible-extract 5 exact_match 92.7976 ± 0.7121
strict-match 5 exact_match 91.2813 ± 0.7771

FP8 GPQA_Diamond on H200:

Tasks Version Filter n-shot Metric Value Stderr
gpqa_diamond_cot_zeroshot_aa 1 strict-match 0 exact_match 46.4646 ± 3.5534

FP8 MMLU on B200:
MMLU weighted average accuracy: 80.48 (4104)

FP8 GSM8K on B200:

Tasks Version Filter n-shot Metric Value Stderr
gsm8k 3 flexible-extract 5 exact_match 91.9636 ± 0.7488
strict-match 5 exact_match 90.5989 ± 0.8039

FP8 GPQA_Diamond on B200:

Tasks Version Filter n-shot Metric Value Stderr
gpqa_diamond_cot_zeroshot_aa 1 strict-match 0 exact_match 48.9899 ± 3.5616

FP4 MMLU on B200:
MMLU weighted average accuracy: 78.78 (4104)

FP4 GSM8K on B200:

Tasks Version Filter n-shot Metric Value Stderr
gsm8k 3 flexible-extract 5 exact_match 91.2055 ± 0.7801
strict-match 5 exact_match 87.3389 ± 0.9160

FP4 GPQA_Diamond on B200:

Tasks Version Filter n-shot Metric Value Stderr
gpqa_diamond_cot_zeroshot_aa 1 strict-match 0 exact_match 45.9596 ± 3.5507

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.

Summary by CodeRabbit

  • New Features

    • Exposed configurable generation limits (max_tokens, max_seq_len, max_batch_size) and kv-cache options in LLM calls.
  • Tests

    • Updated accuracy baselines for GSM8K and MMLU (minor increases and decreases).
    • Migrated tests to updated Llama 3.3 FP8/NVFP4 model variants and paths.
    • Standardized sampling caps (max_tokens=256), added kv-cache and batch sizing to LLM invocations, and switched evaluations to a chat-template evaluator configuration.

Copy link
Contributor

coderabbitai bot commented Aug 17, 2025

📝 Walkthrough

Walkthrough

Updated GSM8K and MMLU accuracy reference values for meta-llama/Llama-3.3-70B-Instruct and adjusted PyTorch integration tests: model paths, SamplingParams (added max_tokens), LLM ctor args (max_seq_len, max_batch_size, kv_cache_config), and evaluator calls now use extra_evaluator_kwargs (apply_chat_template).

Changes

Cohort / File(s) Summary
Accuracy references
tests/integration/defs/accuracy/references/gsm8k.yaml, tests/integration/defs/accuracy/references/mmlu.yaml
Updated recorded accuracy numbers for meta-llama/Llama-3.3-70B-Instruct across NVFP4/FP8 configurations (GSM8K and MMLU).
PyTorch LLM API tests
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Switched FP8/FP4 model_path values to llama-3.3-models/*; added SamplingParams(max_tokens=256); LLM instantiation now includes max_batch_size=32 (and max_seq_len support) and kv_cache_config where applicable; GPQADiamond .evaluate() calls now use extra_evaluator_kwargs=dict(apply_chat_template=True).
Accuracy test core / evaluator usage
tests/integration/defs/accuracy/accuracy_core.py
GPQADiamond.evaluate and call sites updated to accept/use extra_evaluator_kwargs (apply_chat_template) instead of passing sampling_params directly in affected invocations.
Public API surface
tensorrt_llm/... (tensorrt_llm/llmapi.py, tests referencing tensorrt_llm)
SamplingParams.__init__ added max_tokens. LLM constructor now accepts max_seq_len and max_batch_size. No exported signatures removed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Tester as Test runner
  participant LLM as LLM instance
  participant Evaluator as GPQADiamond

  rect rgba(135,206,235,0.12)
  Tester->>LLM: init(model_path, max_seq_len?, max_batch_size?, kv_cache_config?)
  end

  Tester->>Evaluator: evaluate(dataset, extra_evaluator_kwargs={apply_chat_template: true})
  Evaluator->>LLM: generate(prompts, sampling_params{max_tokens: N, ...})
  alt generation success
    LLM-->>Evaluator: outputs
    Evaluator-->>Tester: metrics (accuracy)
  else generation error
    LLM-->>Evaluator: error
    Evaluator-->>Tester: failure
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Community want to contribute

Suggested reviewers

  • yilin-void
  • syuoni
  • LarryXFly

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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: 0

🧹 Nitpick comments (2)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (2)

468-472: Memory safety WAR parameters are appropriate here.

Passing max_seq_len=8192, max_batch_size=32 with KvCacheConfig(free_gpu_memory_fraction=0.5) provides headroom and is a pragmatic fix for the large 70B model warmup/decoding phases.

To document the rationale inline for future maintainers, consider adding a short comment:

-        with LLM(model_path,
+        # WAR: reduce KV cache footprint and cap shapes to avoid illegal memory access on 70B FP8/FP4.
+        # Keep in sync with accuracy references set with max_tokens=256.
+        with LLM(model_path,
                  tensor_parallel_size=4,
                  max_seq_len=8192,
                  max_batch_size=32,
                  kv_cache_config=kv_cache_config) as llm:

475-476: Minor refactor: de-duplicate SamplingParams across FP8/NVFP4.

Avoid repeating the same SamplingParams in both tests to reduce drift risk.

You could define a class-level constant and reuse it:

# Add inside class TestLlama3_3_70BInstruct
SAMPLING_PARAMS_70B = SamplingParams(
    max_tokens=256,
    temperature=0.0,
    add_special_tokens=False,
)

Then replace the two occurrences:

-            sampling_params = SamplingParams(
-                max_tokens=256,
-                temperature=0.0,
-                add_special_tokens=False,
-            )
+            sampling_params = self.SAMPLING_PARAMS_70B

Also applies to: 499-499

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1e72721 and d04d0f3.

📒 Files selected for processing (3)
  • 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 (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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.

Applied to files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🔇 Additional comments (4)
tests/integration/defs/accuracy/references/mmlu.yaml (1)

66-66: MMLU reference updates for Llama-3.3-70B-Instruct look consistent.

The three adjusted accuracies under meta-llama/Llama-3.3-70B-Instruct reflect the new evaluation settings. No schema or formatting issues spotted.

Also applies to: 69-69, 71-71

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

16-16: GSM8K reference updates align with the decoding changes.

  • NVFP4+FP8-KV decreased (expected due to quant/limits), FP8(+FP8-KV and plain FP8) increased, which matches the intent of bounding generations with max_tokens=256.
  • YAML structure remains valid.

Also applies to: 19-19, 21-21

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

466-476: Anchoring decode length and updating model path for 3.3-70B FP8 is the right fix.

  • Switching to llama-3.3-models path and adding SamplingParams(max_tokens=256, temperature=0.0, add_special_tokens=False) directly addresses the GSM8K regression from long generations.
  • No API issues; this matches the current LLM and SamplingParams signatures.

490-499: NVFP4 test changes (model path, KV cache fraction, LLM caps, max_tokens) are spot on.

  • Using the -FP4 variant and asserting QuantAlgo.NVFP4 is correct.
  • free_gpu_memory_fraction=0.5 + max_seq_len=8192 + max_batch_size=32 mitigate the illegal memory access you observed.
  • Adding max_tokens=256 for SamplingParams aligns this test with the references you updated.

@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15535 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@chenfeiz0326 chenfeiz0326 force-pushed the user/chenfeiz/fix-70b-acc-drop branch from 87b991b to bb15eb9 Compare August 18, 2025 07:33
@chenfeiz0326 chenfeiz0326 requested a review from a team as a code owner August 18, 2025 07:33
@chenfeiz0326 chenfeiz0326 requested a review from Superjomn August 18, 2025 07:33
@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15611 [ 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

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 87b991b and 3c6d849.

📒 Files selected for processing (3)
  • 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 (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/defs/accuracy/references/mmlu.yaml
  • tests/integration/defs/accuracy/references/gsm8k.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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.

Applied to files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧬 Code Graph Analysis (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (5)
tests/integration/defs/conftest.py (1)
  • llm_models_root (77-83)
tensorrt_llm/llmapi/llm_args.py (3)
  • KvCacheConfig (929-1024)
  • quant_config (2152-2155)
  • quant_config (2158-2159)
tensorrt_llm/llmapi/llm.py (1)
  • LLM (1079-1095)
tensorrt_llm/quantization/mode.py (1)
  • QuantAlgo (23-46)
tensorrt_llm/sampling_params.py (1)
  • SamplingParams (125-486)
⏰ 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 (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

466-476: Good fix: explicit model path + KV cache bound + generation cap to recover GSM8K accuracy

  • Updating to the Llama-3.3-70B FP8 path, bounding KV cache via free_gpu_memory_fraction=0.5, setting max_seq_len=8192/max_batch_size=32, and capping SamplingParams.max_tokens=256 with temperature=0.0 are all aligned with the stated goals and should stabilize accuracy and memory behavior for FP8 tp4.
  • No API misuses spotted: LLM accepts max_seq_len/max_batch_size via kwargs; SamplingParams.max_tokens is supported.

@tensorrt-cicd
Copy link
Collaborator

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

@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15692 [ run ] triggered by Bot

@chenfeiz0326 chenfeiz0326 force-pushed the user/chenfeiz/fix-70b-acc-drop branch from a9d8c0a to a40a399 Compare August 19, 2025 05:44
@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15722 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15692 [ run ] completed with state ABORTED

@chenfeiz0326 chenfeiz0326 force-pushed the user/chenfeiz/fix-70b-acc-drop branch from a40a399 to 86065fd Compare August 19, 2025 06:04
@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15764 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15722 [ run ] completed with state ABORTED

@tensorrt-cicd
Copy link
Collaborator

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

@chenfeiz0326 chenfeiz0326 force-pushed the user/chenfeiz/fix-70b-acc-drop branch from 86065fd to 278e8e8 Compare August 20, 2025 01:35
@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15838 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #15838 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #11904 completed with status: 'FAILURE'

Signed-off-by: Chenfei Zhang <[email protected]>
Signed-off-by: Chenfei Zhang <[email protected]>
Signed-off-by: Chenfei Zhang <[email protected]>
@chenfeiz0326 chenfeiz0326 force-pushed the user/chenfeiz/fix-70b-acc-drop branch from 278e8e8 to 3126650 Compare August 25, 2025 07:09
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: 0

♻️ Duplicate comments (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

526-535: 70B NVFP4 tp4 is missing max_seq_len=8192 (can cause illegal memory access per PR objective)

The FP8 tp4 block sets max_seq_len=8192, but the NVFP4 tp4 block omits it. The PR’s stated fix for 70B FP4 includes max_seq_len=8192 along with free_gpu_memory_fraction=0.5 and max_batch_size=32. Add max_seq_len to the NVFP4 ctor to avoid illegal memory access and keep configs consistent.

 with LLM(model_path,
          tensor_parallel_size=4,
+         max_seq_len=8192,
          max_batch_size=32,
          kv_cache_config=kv_cache_config) as llm:
#!/bin/bash
# Verify all 70B Llama-3.3 NVFP4 LLM ctor sites include max_seq_len
rg -nP -C2 '(Llama-3\.3-70B-Instruct-FP4)' tests/integration/defs/accuracy/test_llm_api_pytorch.py

# Also confirm FP8 tp4 already specifies max_seq_len=8192
rg -nP -C2 '(Llama-3\.3-70B-Instruct-FP8)' tests/integration/defs/accuracy/test_llm_api_pytorch.py | rg -n 'max_seq_len\s*=\s*8192' -n -C2
🧹 Nitpick comments (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

502-509: Optional: clarify why FP8 also uses free_gpu_memory_fraction=0.5

PR objective mentions 0.5 specifically for NVFP4 to avoid illegal memory access. If FP8 does not require it, consider removing it (default is 0.9) to reduce cache pressure and improve throughput; otherwise, add a short comment noting why 0.5 is desirable for FP8 here.

- kv_cache_config = KvCacheConfig(free_gpu_memory_fraction=0.5)
+ kv_cache_config = KvCacheConfig(free_gpu_memory_fraction=0.5)  # Keep at 0.5 for FP8 to mirror NVFP4 CI headroom
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 278e8e8 and 3126650.

📒 Files selected for processing (3)
  • 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 (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/defs/accuracy/references/gsm8k.yaml
  • tests/integration/defs/accuracy/references/mmlu.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+
Python indentation: 4 spaces, no tabs
Maintain module namespace in imports (from package.subpackage import foo; then use foo.SomeClass())
Python file names use snake_case
Python class names use PascalCase
Python functions/methods and local variables use snake_case; variables starting with a number get k_ prefix (e.g., k_99th_percentile)
Global variables use G_ prefixed UPPER_SNAKE_CASE (e.g., G_MY_GLOBAL)
Constants use UPPER_SNAKE_CASE in Python
Avoid shadowing variables from outer scopes in Python
Initialize all externally visible members of a Python class in init
Prefer docstrings for interfaces used outside a file; comments for local code
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes/variables inline with short docstrings
Avoid reflection when simple alternatives exist (e.g., prefer explicit parameters over dict(**locals()))
In try/except, catch the narrowest exceptions possible
For duck-typing with try/except, keep try body minimal and put logic in else

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (2)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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.

Applied to files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
📚 Learning: 2025-08-20T06:56:02.889Z
Learnt from: eopXD
PR: NVIDIA/TensorRT-LLM#6768
File: cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp:577-579
Timestamp: 2025-08-20T06:56:02.889Z
Learning: In cpp/tensorrt_llm/batch_manager/kvCacheManager.cpp, maxSequenceLength is now enforced as a non-optional argument in the BlockManager constructor, so concerns about std::nullopt defaulting to 0 are not applicable. When windowSize > maxSequenceLength, a warning should be added instead of handling optional parameter cases.

Applied to files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧬 Code graph analysis (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (5)
tests/integration/defs/conftest.py (1)
  • llm_models_root (77-83)
tensorrt_llm/llmapi/llm_args.py (1)
  • KvCacheConfig (944-1039)
tensorrt_llm/llmapi/llm.py (1)
  • LLM (1090-1106)
tensorrt_llm/quantization/mode.py (1)
  • QuantAlgo (23-46)
tensorrt_llm/sampling_params.py (1)
  • SamplingParams (125-486)
⏰ 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 (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

502-512: 70B FP8 tp4: Max tokens bound and harness settings look correct

Setting SamplingParams(max_tokens=256) with temperature=0.0 and disabling special tokens aligns with the PR objective to stabilize GSM8K accuracy. The LLM ctor uses tensor_parallel_size=4, max_seq_len=8192, max_batch_size=32, and a conservative KV cache allocation — good balance for CI stability. GPQA uses apply_chat_template via extra_evaluator_kwargs — consistent with other tests.

@chenfeiz0326
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16408 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

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