Tiny refactor condition to requant scale ue8m0 (#13286)

This commit is contained in:
fzyzcjy
2025-11-15 16:36:00 +08:00
committed by GitHub
parent 8e6083bfcf
commit 33f08a98b0
4 changed files with 27 additions and 18 deletions

View File

@@ -80,7 +80,11 @@ from sglang.srt.layers.vocab_parallel_embedding import (
VocabParallelEmbedding,
)
from sglang.srt.model_executor.forward_batch_info import ForwardBatch
from sglang.srt.model_loader.utils import maybe_executor_submit, should_async_load
from sglang.srt.model_loader.utils import (
maybe_executor_submit,
should_async_load,
should_deepgemm_weight_requant_ue8m0,
)
from sglang.srt.model_loader.weight_utils import default_weight_loader
from sglang.srt.models.deepseek_v2 import DeepseekV2AttentionMLA
from sglang.srt.server_args import get_global_server_args
@@ -774,11 +778,8 @@ class LongcatFlashForCausalLM(nn.Module):
# TODO(linguoyuan) EPMoE not support DEEPGEMM_BLACKWELL, DeepEP needs to be supported in the future
deep_gemm_wrapper.DEEPGEMM_SCALE_UE8M0 = False
if (
deep_gemm_wrapper.ENABLE_JIT_DEEPGEMM
and deep_gemm_wrapper.DEEPGEMM_SCALE_UE8M0
and hasattr(self.quant_config, "weight_block_size")
and self.quant_config.weight_block_size is not None
if should_deepgemm_weight_requant_ue8m0(
weight_block_size=getattr(self.quant_config, "weight_block_size", None)
):
self._weight_requant_ue8m0()