Skip to content

fix: skip layers the AWQ GEMM kernel cannot serve in AWQ export - #2456

Merged
wenhuach21 merged 3 commits into
intel:mainfrom
losewayy:fix-awq-unservable-layers
Oct 10, 2026
Merged

wenhuach21 merged 3 commits into
intel:mainfrom
losewayy:fix-awq-unservable-layers

Conversation

@losewayy

Copy link
Copy Markdown
Contributor

Description

AWQ export could pack layers whose shapes the AWQ GEMM kernel cannot serve. When in_features or out_features is not divisible by group_size, or out_features is not a multiple of the kernel's 64-wide CTA tile, the exported model either crashes vLLM at load time (OC is not multiple of Group size) or silently leaves the layer unquantized so the saved model grows instead of shrinking. This hits the small Gated-DeltaNet projections in Qwen3.5 hybrids (e.g. in_proj_ba, OC=64 with group_size=128) and the lm_head of some models.

This PR adds one shared predicate, awq_gemm_kernel_supported, and applies it at three points so unservable layers stay in fp16 and are listed in modules_to_not_convert:

  • Format resolution: unservable layers are marked fp16 (bits=16, data_type=fp) before quantization, so they are excluded from tuning and packing. The marking is re-applied after layer_config expansion in apply_layer_config_special_cases, since regex user entries share one dict across matches and could overwrite the mark.
  • Export packing: save_quantized_as_autoawq pre-scans and skips unservable layers and merges them into modules_to_not_convert, which covers the quantize() then save_quantized(format="auto_awq") split flow where format resolution happens after quantization. pack_layer also bails out on such shapes, and the same guard is applied to the auto_round:auto_awq packing path.
  • check_awq_gemm_compatibility now delegates to the same predicate, which also closes the missing out_features % 64 rule and fixes the stale "only supports 4 bits" message.

Type of Change

Bug fix

Related Issues

Fixes #1496, relates to #1650 and #2427

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed. (no doc changes needed)
  • New or updated tests are included where applicable.
  • The CUDA CI has passed. You can trigger it by commenting /azp run Unit-Test-CUDA-AutoRound.

Signed-off-by: losewayy <losemywayy@gmail.com>
@losewayy
losewayy force-pushed the fix-awq-unservable-layers branch from b5e1ecc to 8fc0b4a Compare October 10, 2026 01:37
@losewayy

Copy link
Copy Markdown
Contributor Author

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 2456 in repo intel/auto-round

…hapes

Layers matched by a user-supplied layer_config entry (exact name or expanded regex) keep their quantization setting instead of being forced to fp16. They are flagged on the module so the AWQ packers attempt packing, and a warning notes the shape may fail on the AWQ GEMM path in serving stacks. Layers that only fall back to the default scheme are still exported in fp16.

Signed-off-by: losewayy <104015127+losewayy@users.noreply.github.com>
@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

…attribute

apply_plan_to_model already writes fixed_by_user onto quantized modules, so a shared awq_layer_user_forced helper reads it directly, falling back to the layer_config entry for modules lacking the flag (e.g. lm_head added via quant_lm_head whose entry carries no fixed_by_user key). The marking pass, the export prescan, and pack_layer on both AWQ paths share the same rule, and nothing is written onto modules during export.

Signed-off-by: losewayy <104015127+losewayy@users.noreply.github.com>

@wenhuach21 wenhuach21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the PR!

@AutoRoundBot

Copy link
Copy Markdown
Collaborator

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@wenhuach21
wenhuach21 merged commit 7a660e1 into intel:main Oct 10, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AWQ export of Qwen3.5-9B (DeltaNet Hybrid) crashes in vLLM due to non-divisible Output Channels (in_proj_ba)

3 participants