draft-quant-packed-mapping.patch 1.2 KB

12345678910111213141516171819202122
  1. --- a/vllm/model_executor/models/deepseek_mtp.py
  2. +++ b/vllm/model_executor/models/deepseek_mtp.py
  3. @@ -306,6 +306,19 @@
  4. quant_config = _maybe_disable_unserialized_modelopt_fp4_nextn(
  5. config, vllm_config, get_draft_quant_config(vllm_config)
  6. )
  7. + if quant_config is not None:
  8. + # Draft quant configs are built fresh (get_draft_quant_config) and
  9. + # never pass through configure_quant_config, so fused-module shard
  10. + # expansion is empty; quant schemes whose targets name the
  11. + # constituent projections (q_a_proj / kv_a_proj_with_mqa) then
  12. + # fail to match the fused module and the block silently builds
  13. + # unquantized, breaking checkpoints with quantized NextN layers.
  14. + quant_config.packed_modules_mapping.setdefault(
  15. + "fused_qkv_a_proj", ["q_a_proj", "kv_a_proj_with_mqa"]
  16. + )
  17. + quant_config.packed_modules_mapping.setdefault(
  18. + "gate_up_proj", ["gate_proj", "up_proj"]
  19. + )
  20. self.enorm = RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
  21. self.hnorm = RMSNorm(config.hidden_size, eps=config.rms_norm_eps)