Repository navigation
fix(awq): validate candidate group sizes against kernel out_features constraints (#4095) - #4100
Prajwal7-2002 wants to merge 1 commit into
Conversation
…constraints (ModelCloud#4095) Phi-tiny-MoE expert gate_proj/up_proj have out_features=448 and in_features divisible by 128. AwqGEMMLinear requires out_features to be divisible by group_size, causing a crash during create_quant_module. Check candidate group sizes against kernel validation in _ensure_group_size_divisibility and _largest_supported_group_divisor, retuning to 64. Add out_features=448 regression test. Signed-off-by: Prajwal7-2002 <[email protected]>
|
Thank you for this — the diagnosis is right and the I'm closing this as superseded rather than merging, for two concrete reasons found during review, both worth recording:
Also: the deepest The fix that lands (#4104) keeps your approach but validates the candidate before recording it, calls the public Closing as superseded — not as invalid. |
Summary
Fixes item 3 of #4095.
In MoE architectures like \Phi-tiny-MoE, expert \gate_proj\ and \up_proj\ layers have \in_features = 1024\ (or 2048) and \out_features = 448. Under default \AWQConfig(bits=4, group_size=128), \in_features\ is divisible by 128, so _ensure_group_size_divisibility\ previously skipped these layers. However, \AwqGEMMLinear._validate\ requires \out_features % group_size == 0. Because \448 % 128 == 64 != 0, module creation crashed at packing time with:
\
NotImplementedError: AWQ GEMM requires a group size divisible by 32 and out_features divisible by that group size: got out_features=448, group_size=128
\\
Changes