Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def __init__(
else:
scale = kInt4StaticGroupScale
elif self.num_bits == 8:
assert self.group_size == -1
scale = kInt8StaticGroupScale
else:
raise ValueError(
Expand Down
9 changes: 8 additions & 1 deletion vllm/model_executor/layers/quantization/moe_wna16.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def __init__(self, quant_config: MoeWNA16Config, moe: "FusedMoEConfig") -> None:
else:
scale = kInt4StaticGroupScale
elif num_bits == 8:
assert group_size == -1
quant_type = INT8_DTYPE
scale = kInt8StaticGroupScale
else:
Expand Down Expand Up @@ -254,6 +253,14 @@ def create_weights(
group_size = self.quant_config.group_size
group_size_div_factor = 1

# group_size == -1 means per-channel: one scale per output row, i.e. a
# single group spanning the whole reduction axis. The loop below cannot
# normalise it (x % -1 == 0 for every x, so it exits immediately and
# leaves a negative divisor for the scale shapes), so map it to the
# axis length up front.
if group_size == -1:
group_size = min(intermediate_size_per_partition, hidden_size)

# make intermediate_size and hidden_size divisible by group_size
# we reduce the group size to ensure that
# and we would repeat the loaded_weight later
Expand Down
Loading