[Perf] Enable fast-math for JIT activations on Blackwell (#43236)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chunan Zeng
2026-10-13 15:18:05 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent d8f8522348
commit 7ff3a11284
+4 -5
View File
@@ -18,6 +18,7 @@ from sglang.kernels.jit.utils.common import (
is_hip_runtime,
is_musa_runtime,
)
from sglang.srt.utils.common import is_cuda
logger = logging.getLogger(__name__)
@@ -182,8 +183,6 @@ def is_arch_support_pdl() -> bool:
def get_activation_cuda_cflags() -> list[str]:
"""Match the AOT activation fast-math policy without changing other kernels."""
# Blackwell needs precise expf; HIP clang rejects --use_fast_math.
if is_hip_runtime() or get_jit_cuda_arch().major >= 10:
return []
return ["--use_fast_math"]
if is_cuda():
return ["--use_fast_math"]
return []