From 89d896591ece62e7f554948b6599c6af0cdae9d7 Mon Sep 17 00:00:00 2001 From: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> Date: Thu, 9 Jul 2026 12:48:30 -0700 Subject: [PATCH] [nvbugs/6433376][fix] Align Qwen3.5 dense-VL SSM cache dtype test with narrowed resolver PR #15249 added test_qwen35_dense_vl_resolves_mamba_ssm_cache_dtype asserting the old resolve_ssm_cache_dtype semantics that honored mamba_ssm_dtype as a cache-dtype fallback. PR #16065 (nvbugs/6422332) narrowed the resolver to honor only the explicit mamba_ssm_cache_dtype field for performance (fp32 SSM cache disables the FlashInfer bf16-state GDN decode kernel and doubles state memory traffic). The MoE sibling test was updated to match, but the dense test was missed. Mirror the MoE sibling: assert the "auto" path returns bfloat16 (weight dtype fallback) and add an explicit float32 opt-in assertion. Remove waives.txt entries added for this bug. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> --- tests/integration/test_lists/waives.txt | 2 -- .../_torch/modeling/test_modeling_qwen3_5_vl.py | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_lists/waives.txt b/tests/integration/test_lists/waives.txt index 688f5710254e..f1389ddf90ae 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -417,8 +417,6 @@ test_e2e.py::test_ptp_quickstart_advanced_deepseek_r1_w4afp8_8gpus[DeepSeek-R1-W test_e2e.py::test_trtllm_bench_iteration_log[TRT-streaming-meta-llama/Llama-3.1-8B-llama-3.1-model/Meta-Llama-3.1-8B] SKIP (https://nvbugs/5448523) unittest/_torch/attention/sparse/deepseek_v4/test_compressor_kernel.py::test_prefill_varlen[varlen_hd512_overlap] SKIP (https://nvbugs/6426860) unittest/_torch/misc/test_share_tensor.py::TestShareTensor::test_share_tensor_different_dtypes SKIP (https://nvbugs/6418021) -unittest/_torch/modeling -k "modeling_qwen" SKIP (https://nvbugs/6433376) -unittest/_torch/modeling/test_modeling_qwen3_5_vl.py::test_qwen35_dense_vl_resolves_mamba_ssm_cache_dtype SKIP (https://nvbugs/6433376) unittest/_torch/modules/moe/test_moe_backend.py::test_moe_backend[act=Relu2-e60_k4_h2048_i1408-seq=8-dtype=torch.bfloat16-backend=TRTLLM-quant=NVFP4-routing=Renormalize] SKIP (https://nvbugs/5989912) unittest/_torch/modules/tests_lora_modules/test_nemotron_h_lora_sanity.py::TestNemotronHLoRA::test_lora_pp2_sanity SKIP (https://nvbugs/6428124) unittest/_torch/ray_orchestrator/multi_gpu/test_llm_update_weights_multi_gpu.py -m "part0" SKIP (https://nvbugs/6372711) diff --git a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py index fe097dabd79a..5c13c3a73853 100644 --- a/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py +++ b/tests/unittest/_torch/modeling/test_modeling_qwen3_5_vl.py @@ -143,15 +143,24 @@ def test_qwen35_dense_vl_resolves_mamba_ssm_cache_dtype( config = load_pretrained_config(str(_write_qwen35_dense_vl_config(tmp_path))) model_config = ModelConfig(pretrained_config=config) + # "auto" keeps the SSM cache in the model weights dtype for performance: + # the checkpoint's mamba_ssm_dtype=float32 expresses SSM compute intent, + # and honoring it for cache allocation disables the FlashInfer bf16-state + # GDN decode kernel and doubles state memory traffic. validate_and_set_mamba_ssm_cache_dtype(model_config, "auto") - assert model_config.quant_config.mamba_ssm_cache_dtype is torch.float32 + assert model_config.quant_config.mamba_ssm_cache_dtype is torch.bfloat16 mamba_params = extract_mamba_kv_cache_params( config.text_config, quant_config=model_config.quant_config, ) assert mamba_params.dtype is torch.bfloat16 - assert mamba_params.mamba_ssm_cache_dtype is torch.float32 + assert mamba_params.mamba_ssm_cache_dtype is torch.bfloat16 + + # Explicit opt-in honors the checkpoint's fp32 SSM state intent. + 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 def test_qwen35_dense_vl_resolves_model_and_mapper(tmp_path: Path) -> None: