Repository navigation
[XPU] Route INC WNA16 MoE to oracle backend instead of bf16 dequant #48555
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 3 commits
27b4a92
04c483b
320d4b7
014bdcb
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 |
|---|---|---|
|
|
@@ -97,8 +97,11 @@ def get_moe_method( | |
| layer_config: "INCLayerConfig", | ||
| ): | ||
| del config, prefix | ||
| # XPU and CPU do not support MoE quantization yet | ||
| if current_platform.is_xpu() or current_platform.is_cpu(): | ||
| # CPU does not support quantized MoE yet; fall back to dequantized bf16. | ||
| # XPU is supported via the WNA16 oracle backend (routes through | ||
| # _resolve_gptq_moe -> MoeWNA16Method -> XPUExpertsWNA16), so it must | ||
| # NOT take this dequant fallback, which OOMs materializing bf16 experts. | ||
| if current_platform.is_cpu(): | ||
| from vllm.model_executor.layers.fused_moe import ( | ||
| UnquantizedFusedMoEMethod, | ||
| ) | ||
|
|
@@ -128,7 +131,12 @@ def _resolve_gptq_moe(layer: "torch.nn.Module", layer_config: "INCLayerConfig"): | |
| (4, True): scalar_types.uint4b8, | ||
| (8, True): scalar_types.uint8b128, | ||
| } | ||
| use_marlin = (layer_config.bits, layer_config.sym) in gptq_type_map | ||
| # Marlin is a CUDA-only path; XPU uses the WNA16 oracle backend instead | ||
| # (check_moe_marlin_supports_layer is platform-agnostic, so gate it here). | ||
| use_marlin = ( | ||
| layer_config.bits, | ||
| layer_config.sym, | ||
| ) in gptq_type_map and not current_platform.is_xpu() | ||
|
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. For this part, do we really need this gate?
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. Vllm-xpu-kernels uses XPUExpertsWNA16, so here is expected. |
||
| if use_marlin: | ||
| use_marlin = check_marlin_supported( | ||
| gptq_type_map[(layer_config.bits, layer_config.sym)], | ||
|
|
||
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.
Hi @sgurwinderr, this part looks good to me. Thanks for the fix!
There is a similar fix in #47124.