[Bugfix] Size and iterate w13 by shard count for non-gated MoE (#51125)

Signed-off-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: Matej Sirovatka <matej.sirovatka@gmail.com>
Co-authored-by: Rishi Puri <riship@nvidia.com>
Co-authored-by: Hsiao-Yuan Chen <littlecircle0730@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
aoshen02
2026-08-05 17:24:47 -07:00
committed by GitHub
co-authored by Matej Sirovatka Rishi Puri Hsiao-Yuan Chen Claude Opus 5
parent 811622c410
commit 7c77868cdf
16 changed files with 104 additions and 80 deletions
@@ -88,7 +88,7 @@ class INCMxfp4MoEMethod(FusedMoEMethodBase):
w13_weight = torch.nn.Parameter(
torch.empty(
num_experts,
2 * intermediate_size_per_partition,
self.moe.w13_num_shards * intermediate_size_per_partition,
hidden_size // 2,
dtype=torch.uint8,
),
@@ -113,7 +113,7 @@ class INCMxfp4MoEMethod(FusedMoEMethodBase):
w13_weight_scale = torch.nn.Parameter(
torch.empty(
num_experts,
2 * intermediate_size_per_partition,
self.moe.w13_num_shards * intermediate_size_per_partition,
hidden_size // self.group_size,
dtype=torch.uint8,
),