[Refactor] Clean up custom op (#15995)

This commit is contained in:
DarkSharpness
2026-01-01 21:41:56 +08:00
committed by GitHub
parent a3b1e8ef3d
commit f6f7af4068
23 changed files with 382 additions and 658 deletions
@@ -1115,7 +1115,7 @@ class CompressedTensorsWNA16MoEMethod(CompressedTensorsMoEMethod):
layer: torch.nn.Module,
dispatch_output: StandardDispatchOutput,
) -> CombineInput:
from sglang.srt.layers.moe.fused_moe_triton.fused_marlin_moe import ( # noqa
from sglang.srt.layers.moe.fused_moe_triton.fused_marlin_moe import (
fused_marlin_moe,
)
from sglang.srt.layers.moe.token_dispatcher import StandardCombineInput
@@ -1139,7 +1139,7 @@ class CompressedTensorsWNA16MoEMethod(CompressedTensorsMoEMethod):
if expert_map is not None:
global_num_experts = self.moe_runner_config.num_experts
output = torch.ops.sglang.fused_marlin_moe(
output = fused_marlin_moe(
x,
layer.w13_weight_packed,
layer.w2_weight_packed,
@@ -18,6 +18,7 @@ from sglang.srt.layers.quantization.compressed_tensors.schemes import (
from sglang.srt.layers.quantization.modelopt_quant import (
FLASHINFER_FP4_GEMM_BACKEND,
enable_flashinfer_fp4_gemm,
fp4_gemm,
fp4_quantize,
)
from sglang.srt.layers.quantization.utils import swizzle_blockscale
@@ -153,7 +154,7 @@ class CompressedTensorsW4A4Fp4(CompressedTensorsScheme):
w = layer.weight_packed.T
w_blockscale = layer.weight_scale.T
out = torch.ops.sglang.fp4_gemm(
out = fp4_gemm(
x_fp4,
w,
x_blockscale,