[Bugfix] Fix moe_wna16 w13 zero-point shard split for 8-bit asym GPTQ MoE (#58950)
Signed-off-by: Spandan Tiwari <sptiwari@amd.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Claude
Andreas Karatzas
parent
8a497d7557
commit
9b29370524
@@ -635,10 +635,14 @@ class MoeWNA16Method(FusedMoEMethodBase):
|
||||
tensor = loaded_weight.view(
|
||||
layer.moe_config.tp_size, -1, loaded_weight.size(1)
|
||||
)[tp_rank]
|
||||
# qzeros are packed along the intermediate dim by
|
||||
# bit8_pack_factor, so the w1/w3 boundary is in packed units
|
||||
# (equals shard_size // 2 only for 4-bit).
|
||||
shard_zp_size = shard_size // layer.quant_config.bit8_pack_factor
|
||||
if shard_id == "w1":
|
||||
param.data[expert_id, : shard_size // 2] = tensor
|
||||
param.data[expert_id, :shard_zp_size] = tensor
|
||||
else:
|
||||
param.data[expert_id, shard_size // 2 :] = tensor
|
||||
param.data[expert_id, shard_zp_size:] = tensor
|
||||
return True if return_success else None
|
||||
elif "w2_qzeros" in weight_name:
|
||||
param.data[expert_id] = loaded_weight.view(
|
||||
|
||||
Reference in New Issue
Block a user