Skip to content

[None][fix] Align dense Qwen3.5-VL SSM cache dtype test with #16065 semantics - #16264

Merged
nv-guomingz merged 1 commit into
NVIDIA:mainfrom
moraxu:dev-mguzek-update-qwen35-dense-mamba-ssm-cache-test
Jul 14, 2026
Merged

[None][fix] Align dense Qwen3.5-VL SSM cache dtype test with #16065 semantics#16264
nv-guomingz merged 1 commit into
NVIDIA:mainfrom
moraxu:dev-mguzek-update-qwen35-dense-mamba-ssm-cache-test

Conversation

@moraxu

@moraxu moraxu commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Tests
    • Updated validation coverage for automatic Mamba SSM KV-cache dtype selection.
    • Confirmed automatic allocation uses bfloat16, while explicit float32 configuration remains supported.

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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • 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.

Signed-off-by: Michal Guzek <mguzek@nvidia.com>
@moraxu

moraxu commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The dense Qwen3.5-VL Mamba SSM cache dtype test now expects automatic resolution to torch.bfloat16, verifies the extracted cache parameters, and retains torch.float32 for explicit opt-in.

Changes

Qwen3.5-VL Mamba cache dtype validation

Layer / File(s) Summary
Update cache dtype assertions
tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py
The test now validates torch.bfloat16 for automatic cache dtype resolution and extracted parameters, while retaining the explicit float32 expectation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: achartier

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is mostly template text and lacks a real issue summary, solution details, and test coverage. Replace the placeholder text with a short problem/solution summary and add concrete test coverage for the changed test.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the change and follows the required [None][fix] format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py (1)

160-163: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider asserting extract_mamba_kv_cache_params for the explicit float32 path too.

The auto path verifies both quant_config.mamba_ssm_cache_dtype and the downstream extract_mamba_kv_cache_params(...).mamba_ssm_cache_dtype (lines 153-158), but the explicit "float32" opt-in path only asserts quant_config.mamba_ssm_cache_dtype. For symmetry and to catch regressions in _coerce_torch_dtype handling of torch.float32 on the extraction side, consider adding the same extraction-path check here.

🧪 Proposed addition
     opt_in_config = ModelConfig(pretrained_config=config)
     validate_and_set_mamba_ssm_cache_dtype(opt_in_config, "float32")
     assert opt_in_config.quant_config.mamba_ssm_cache_dtype is torch.float32
+
+    opt_in_mamba_params = extract_mamba_kv_cache_params(
+        config.text_config,
+        quant_config=opt_in_config.quant_config,
+    )
+    assert opt_in_mamba_params.mamba_ssm_cache_dtype is torch.float32

As per path instructions for tests/**, coverage here is largely sufficient but this symmetric check would close a small gap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py` around lines 160
- 163, Extend the explicit float32 opt-in test around
validate_and_set_mamba_ssm_cache_dtype to also call
extract_mamba_kv_cache_params and assert its mamba_ssm_cache_dtype is
torch.float32, matching the existing auto-path coverage and validating
downstream dtype coercion.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py`:
- Around line 160-163: Extend the explicit float32 opt-in test around
validate_and_set_mamba_ssm_cache_dtype to also call
extract_mamba_kv_cache_params and assert its mamba_ssm_cache_dtype is
torch.float32, matching the existing auto-path coverage and validating
downstream dtype coercion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a416c4de-da88-4d0b-bd4a-88184eed1ddc

📥 Commits

Reviewing files that changed from the base of the PR and between b4e7808 and ac278c5.

📒 Files selected for processing (1)
  • tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58719 [ run ] triggered by Bot. Commit: ac278c5 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #58719 [ run ] completed with state SUCCESS. Commit: ac278c5
/LLM/main/L0_MergeRequest_PR pipeline #47302 completed with status: 'SUCCESS'

CI Report

Link to invocation

@nv-guomingz
nv-guomingz merged commit 7d7c364 into NVIDIA:main Jul 14, 2026
14 of 15 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.

3 participants