- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10.9k
[Fix][Spec Decode] Fix llama4 draft loading with different quantization #27136
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 | 
|---|---|---|
|  | @@ -60,16 +60,23 @@ def __init__( | |
| prefix=maybe_prefix(prefix, "embed_tokens"), | ||
| ) | ||
|  | ||
| self.layers = nn.ModuleList( | ||
| [ | ||
| Llama4DecoderLayer( | ||
| vllm_config=vllm_config, | ||
| prefix=maybe_prefix(prefix, f"layers.{i + start_layer_id}"), | ||
| config=self.config, | ||
| ) | ||
| for i in range(self.config.num_hidden_layers) | ||
| ] | ||
| ) | ||
| # Temporarily modify vllm_config.quant_config for draft model layers | ||
| original_quant_config = vllm_config.quant_config | ||
| vllm_config.quant_config = quant_config | ||
| try: | ||
| self.layers = nn.ModuleList( | ||
| [ | ||
| Llama4DecoderLayer( | ||
| vllm_config=vllm_config, | ||
| prefix=maybe_prefix(prefix, f"layers.{i + start_layer_id}"), | ||
| config=self.config, | ||
| ) | ||
| for i in range(self.config.num_hidden_layers) | ||
| ] | ||
| ) | ||
| finally: | ||
| # Restore original quant_config | ||
| vllm_config.quant_config = original_quant_config | ||
| 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. when do we see the exception? 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. When target model and draft model have different quantization, e.g. target model is bf16, while draft model uses fp8 quantization. | ||
| self.fc = torch.nn.Linear( | ||
| self.config.hidden_size * 2, self.config.hidden_size, bias=False | ||
| ) | ||
|  | ||
Uh oh!
There was an error while loading. Please reload this page.