Skip to content
Merged
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
12 changes: 5 additions & 7 deletions python/sglang/srt/layers/quantization/unquant.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
LinearMethodBase,
QuantizeMethodBase,
)
from sglang.srt.layers.utils import MultiPlatformOp
from sglang.srt.layers.utils import MultiPlatformOp, copy_or_rebind_param
from sglang.srt.utils import (
cpu_has_amx_support,
get_bool_env_var,
Expand Down Expand Up @@ -233,14 +233,12 @@ def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
# because aiter CK kernels don't support all GEMM dimensions
_should_use_aiter_moe = _use_aiter and get_moe_runner_backend().is_auto()
if _should_use_aiter_moe:
layer.w13_weight = torch.nn.Parameter(
shuffle_weight(layer.w13_weight.data, (16, 16)),
requires_grad=False,
copy_or_rebind_param(
layer, "w13_weight", shuffle_weight(layer.w13_weight.data, (16, 16))
)
torch.cuda.empty_cache()
layer.w2_weight = torch.nn.Parameter(
shuffle_weight(layer.w2_weight.data, (16, 16)),
requires_grad=False,
copy_or_rebind_param(
layer, "w2_weight", shuffle_weight(layer.w2_weight.data, (16, 16))
)
torch.cuda.empty_cache()

Expand Down
Loading