-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[None][fix] Fix Qwen3.8-27B NVFP4 checkpoint loading #18387
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
|
|
||
| import json | ||
| from types import SimpleNamespace | ||
| from unittest.mock import Mock, patch | ||
|
|
||
| import pytest | ||
| import torch | ||
|
|
@@ -236,3 +237,22 @@ def test_qwen_image_bench_forwards_speculative_interface(): | |
| assert model.model is text_model | ||
| assert model.lm_head is lm_head | ||
| assert model.load_draft_weights("weights") is sentinel | ||
|
|
||
|
|
||
| def test_qwen_image_bench_mapper_uses_normalized_inner_model_config(): | ||
| inner_model_config = object() | ||
| llm = SimpleNamespace(model_config=inner_model_config, load_weights=Mock()) | ||
| model = QwenImageBenchModel.__new__(QwenImageBenchModel) | ||
| object.__setattr__(model, "llm", llm) | ||
|
|
||
| with ( | ||
| patch( | ||
| "tensorrt_llm._torch.models.modeling_qwen_image_bench._is_mm_disagg", | ||
| return_value=True, | ||
| ), | ||
| patch.object(Qwen3_5MoeHfWeightMapper, "init_model_and_config") as init_mapper, | ||
| ): | ||
| model.load_weights({}) | ||
|
|
||
| init_mapper.assert_called_once_with(llm, inner_model_config) | ||
| llm.load_weights.assert_called_once() | ||
|
Comment on lines
+242
to
+258
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Register the added regression tests in the standard test lists. The new QwenImageBench mapper test and the Qwen3.5/Qwen3.8 configuration tests are not listed in the corresponding 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Scope the MoE description to the MoE checkpoints.
The paragraph says that all listed models use the
qwen3_5_moe_textdecoder and have 512 routed experts with top-10 routing. That is false forQwen3.8-27B dense, which usesQwen3_5ForCausalLMand has no experts. This can direct users to incompatible MoE deployment settings.Update the surrounding introduction so that the shared architecture statement applies only to the two MoE checkpoints. Also update the opening sentence to include the dense checkpoint.
Proposed wording
The dense configuration test verifies that
num_expertsis absent or zero.🧰 Tools
🪛 LanguageTool
[style] ~9-~9: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...h mixed NVFP4 and FP8 quantization. * Qwen3.5-397B-A17B MoE NVFP4 — 397 billion t...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🤖 Prompt for AI Agents