Enable SGLANG_OPT_FP8_WO_A_GEMM by default (#25181)

This commit is contained in:
Yuhao Yang
2026-05-15 02:09:13 +08:00
committed by GitHub
parent 37f030a0de
commit 88d3ed7df1
3 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -619,7 +619,7 @@ class Envs:
SGLANG_OPT_USE_TOPK_V2 = EnvBool(False)
# GEMM / kernel fusion
SGLANG_OPT_FP8_WO_A_GEMM = EnvBool(False)
SGLANG_OPT_FP8_WO_A_GEMM = EnvBool(True)
SGLANG_OPT_BF16_FP32_GEMM_ALGO = EnvStr("cublas")
SGLANG_OPT_USE_JIT_EP_ACTIVATION = EnvBool(True)
SGLANG_OPT_USE_JIT_NORM = EnvBool(False)
+4 -1
View File
@@ -1095,7 +1095,10 @@ class DeepseekV4ForCausalLM(nn.Module):
def _setup_fp8_wo_a_scales(self, is_nextn: bool) -> None:
from deep_gemm import transform_sf_into_required_layout
layers = self.model.layers
if is_nextn:
layers = [self.model.decoder]
else:
layers = self.model.layers
for layer in layers:
attn = layer.self_attn
G = attn.n_local_groups
+9
View File
@@ -4259,6 +4259,15 @@ class ServerArgs:
"Debug mode for CUDA graph is enabled via breakable CUDA graph. "
"All operations will run eagerly through the graph capture/replay path."
)
# FP8 W_o GEMM requires Blackwell (sm100+). Auto-disable on Hopper.
if is_cuda() and envs.SGLANG_OPT_FP8_WO_A_GEMM.get() and get_device_sm() < 100:
if envs.SGLANG_OPT_FP8_WO_A_GEMM.is_set():
logger.warning(
"Disabling SGLANG_OPT_FP8_WO_A_GEMM: requires sm100+ (Blackwell), "
"detected sm%d.",
get_device_sm(),
)
envs.SGLANG_OPT_FP8_WO_A_GEMM.set(False)
def _handle_cache_compatibility(self):
if self.enable_hierarchical_cache and self.disable_radix_cache: