Skip to content

[None][fix] Fixed mamba cache issue for pp>1#12146

Merged
Wanli-Jiang merged 1 commit intoNVIDIA:mainfrom
Wanli-Jiang:user/williamj/fix-mamba-unwaive-superv3
Mar 13, 2026
Merged

[None][fix] Fixed mamba cache issue for pp>1#12146
Wanli-Jiang merged 1 commit intoNVIDIA:mainfrom
Wanli-Jiang:user/williamj/fix-mamba-unwaive-superv3

Conversation

@Wanli-Jiang
Copy link
Collaborator

@Wanli-Jiang Wanli-Jiang commented Mar 12, 2026

  • Also unwaived most test cases for super v3.

Summary by CodeRabbit

  • Tests

    • Enabled previously skipped test configurations, improving test coverage.
    • Optimized test batch size configurations to enhance CI stability and reduce out-of-memory errors.
  • Chores

    • Improved internal cache sequence handling alignment.

Description

Test Coverage

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

  • Update tava architecture diagram if there is a significant design change in PR.

  • 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

To see a list of available CI bot commands, please comment /bot help.

* Also unwaived most test cases for super v3.

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
@Wanli-Jiang
Copy link
Collaborator Author

/bot help

@github-actions
Copy link

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.

Details

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) --high-priority]

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.

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

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.

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38689 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

The changes update parameter naming in the Mamba cache manager from max_batch_size to max_num_sequences for better semantic clarity, reduce batch size configurations in integration tests from 512 to 32 to prevent memory issues, and remove test skip entries for NemotronV3Super test variants.

Changes

Cohort / File(s) Summary
Mamba Cache Manager Parameter Update
tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
Changed parameter name from max_batch_size to max_num_sequences in CppMambaCacheManager.__init__ and updated the corresponding call site in MambaCacheManager.__init__ to use max_num_sequences instead of max_batch_size.
Test Configuration Batch Size Reductions
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Reduced max_batch_size values from 512 to 32 across multiple CUDA Graph test cases for NVFP4/FP8-related tests, and removed conditional control flow for GSM8K execution to unconditionally execute it after llm setup.
Test Skip List Updates
tests/integration/test_lists/waives.txt
Removed six NemotronV3Super-related test skip entries for 4-GPU test configurations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is incomplete and lacks required detail about the issue and solution. Provide a detailed description explaining the mamba cache issue for pp>1, the root cause, and how this fix addresses it. Also clarify why test cases are being unwaived.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the core issue being fixed: a mamba cache problem specific to pipeline parallelism (pp>1).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

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

5986-6022: Parameterize this PP matrix over use_cpp_mamba too.

This file now covers pp_size > 1 and it separately covers TRTLLM_USE_CPP_MAMBA, but not in the same test. Since this PR is fixing a PP-specific Mamba cache path, folding the C++ toggle into test_nvfp4_parallelism would keep that branch explicitly covered as well.

♻️ Example adjustment
+    `@pytest.mark.parametrize`(
+        "use_cpp_mamba",
+        [False, True],
+        ids=["python_mamba_cache", "cpp_mamba_cache"],
+    )
-    def test_nvfp4_parallelism(self, tp_size, ep_size, pp_size, attention_dp):
+    def test_nvfp4_parallelism(self, tp_size, ep_size, pp_size, attention_dp,
+                               use_cpp_mamba, monkeypatch):
+        monkeypatch.setenv("TRTLLM_USE_CPP_MAMBA",
+                           "1" if use_cpp_mamba else "0")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/integration/defs/accuracy/test_llm_api_pytorch.py` around lines 5986 -
6022, Add a boolean param for the C++ mamba toggle to test_nvfp4_parallelism and
run the same PP/TP/EP matrix with both values: extend the
pytest.mark.parametrize signature to include use_cpp_mamba, update the ids
accordingly, and iterate the existing parameter tuples to include True/False for
use_cpp_mamba; inside test_nvfp4_parallelism set and restore the
TRTLLM_USE_CPP_MAMBA environment flag (or call the equivalent config toggle)
before creating the LLM context so the LLM(...) instantiation runs under both
C++-mamba enabled and disabled modes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/integration/defs/accuracy/test_llm_api_pytorch.py`:
- Around line 5986-6022: Add a boolean param for the C++ mamba toggle to
test_nvfp4_parallelism and run the same PP/TP/EP matrix with both values: extend
the pytest.mark.parametrize signature to include use_cpp_mamba, update the ids
accordingly, and iterate the existing parameter tuples to include True/False for
use_cpp_mamba; inside test_nvfp4_parallelism set and restore the
TRTLLM_USE_CPP_MAMBA environment flag (or call the equivalent config toggle)
before creating the LLM context so the LLM(...) instantiation runs under both
C++-mamba enabled and disabled modes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 844ffcc2-a18f-4f1f-8264-58416e2e2f4f

📥 Commits

Reviewing files that changed from the base of the PR and between a4e6745 and afefd48.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/pyexecutor/mamba_cache_manager.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38689 [ run ] completed with state SUCCESS. Commit: afefd48
/LLM/main/L0_MergeRequest_PR pipeline #30010 completed with status: 'SUCCESS'

CI Report

Link to invocation

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --only-multi-gpu-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38735 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38735 [ run ] completed with state SUCCESS. Commit: afefd48
/LLM/main/L0_MergeRequest_PR pipeline #30053 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --only-multi-gpu-test --disable-fail-fast --post-merge

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38790 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38790 [ run ] completed with state SUCCESS. Commit: afefd48
/LLM/main/L0_MergeRequest_PR pipeline #30104 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-PyTorch-Ray-1, DGX_H100-4_GPUs-AutoDeploy-1, GB200-8_GPUs-2_Nodes-PyTorch-Disagg-PerfSanity-CTX1-NODE1-GPU1-GEN1-NODE1-GPU2-Post-Merge-2"

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --stage-list "DGX_B200-4_GPUs-AutoDeploy-1, DGX_B200-4_GPUs-PyTorch-Ray-1, DGX_H100-4_GPUs-AutoDeploy-1, GB200-8_GPUs-2_Nodes-PyTorch-Disagg-PerfSanity-CTX1-NODE1-GPU1-GEN1-NODE1-GPU2-Post-Merge-2" --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38851 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38852 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38852 [ run ] completed with state SUCCESS. Commit: afefd48
/LLM/main/L0_MergeRequest_PR pipeline #30162 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@Wanli-Jiang
Copy link
Collaborator Author

/bot run --disable-fail-fast

@Wanli-Jiang Wanli-Jiang enabled auto-merge (squash) March 13, 2026 11:31
@tensorrt-cicd
Copy link
Collaborator

PR_Github #38866 [ run ] triggered by Bot. Commit: afefd48 Link to invocation

@tensorrt-cicd
Copy link
Collaborator

PR_Github #38866 [ run ] completed with state SUCCESS. Commit: afefd48
/LLM/main/L0_MergeRequest_PR pipeline #30176 completed with status: 'SUCCESS'

CI Report

Link to invocation

@Wanli-Jiang Wanli-Jiang merged commit 1a2849a into NVIDIA:main Mar 13, 2026
9 of 10 checks passed
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