-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
[Bugfix][ROCm] Fix WNA16 MoE quant config init and Qwen3-VL tie_word_embeddings #34630
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
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 |
|---|---|---|
|
|
@@ -376,6 +376,12 @@ def apply( | |
| f"Only SiLU activation is supported, not {layer.activation}." | ||
| ) | ||
|
|
||
| # Lazy init: moe_quant_config may not yet be set if | ||
| # ensure_moe_quant_config_init() hasn't run (e.g. during the first | ||
| # compiled forward pass with piecewise backends). | ||
| if self.moe_quant_config is None: | ||
| self.moe_quant_config = self.get_fused_moe_quant_config(layer) | ||
|
Comment on lines
+382
to
+383
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. Similar to the fix in |
||
|
|
||
| return fused_experts( | ||
| x, | ||
| layer.w13_qweight, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -341,7 +341,7 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): | |
| quant_config=self.quant_config, | ||
| prefix=maybe_prefix(prefix, "lm_head"), | ||
| ) | ||
| if self.config.tie_word_embeddings: | ||
| if getattr(self.config, "tie_word_embeddings", False): | ||
|
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. |
||
| self.lm_head.weight = self.model.embed_tokens.weight | ||
| self.logits_processor = LogitsProcessor(self.config.vocab_size) | ||
| self.make_empty_intermediate_tensors = ( | ||
|
|
||
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.
The lazy initialization of
moe_quant_confighere is critical for correctness when the standard initialization sequence is bypassed, such as during the first compiled forward pass. Without this,fused_expertswould default to an unquantized configuration, leading to incorrect results for WNA16 quantized layers.