[Kernel] Drop the vendored dense BF16 GEMM port in favor of FlashInfer 0.6.18 (#38124)

Co-authored-by: Mohammad Angkad <mohammad.angkad@radixark.ai>
This commit is contained in:
Mohammad Miadh Angkad
2026-09-07 12:59:33 -07:00
committed by GitHub
co-authored by Mohammad Angkad
parent bf68369a18
commit a711785475
7 changed files with 44 additions and 1473 deletions
@@ -2,25 +2,25 @@ import pytest
from sglang.srt.environ import envs
from sglang.srt.layers.quantization.unquant import (
_FLASHINFER_PR4266_TUNED_TACTICS,
_BF16_SPLITK_TUNED_TACTICS,
Bf16GemmBackend,
should_enable_bf16_splitk_gemm,
use_flashinfer_pr4266_bf16_gemm,
use_bf16_splitk_gemm,
)
from sglang.test.ci.ci_register import register_cpu_ci
register_cpu_ci(est_time=11, suite="base-a-test-cpu")
@pytest.mark.parametrize("m,n,k", _FLASHINFER_PR4266_TUNED_TACTICS)
def test_flashinfer_pr4266_selects_tuned_oakhaven_shape(m: int, n: int, k: int):
assert use_flashinfer_pr4266_bf16_gemm(m, n, k)
@pytest.mark.parametrize("m,n,k", _BF16_SPLITK_TUNED_TACTICS)
def test_splitk_selects_tuned_oakhaven_shape(m: int, n: int, k: int):
assert use_bf16_splitk_gemm(m, n, k)
@pytest.mark.parametrize("m", [0, 33, 64])
@pytest.mark.parametrize("n,k", [(256, 8192), (512, 8192), (2304, 8192), (2560, 8192)])
def test_flashinfer_pr4266_keeps_large_m_on_existing_path(m: int, n: int, k: int):
assert not use_flashinfer_pr4266_bf16_gemm(m, n, k)
def test_splitk_keeps_large_m_on_existing_path(m: int, n: int, k: int):
assert not use_bf16_splitk_gemm(m, n, k)
@pytest.mark.parametrize(
@@ -32,12 +32,8 @@ def test_flashinfer_pr4266_keeps_large_m_on_existing_path(m: int, n: int, k: int
(32, 4096, 8192),
],
)
def test_flashinfer_pr4266_rejects_unmeasured_shapes(shape: tuple[int, int, int]):
assert not use_flashinfer_pr4266_bf16_gemm(*shape)
def test_flashinfer_pr4266_backend_is_explicit():
assert Bf16GemmBackend.FLASHINFER_PR4266.value == "flashinfer_pr4266"
def test_splitk_rejects_unmeasured_shapes(shape: tuple[int, int, int]):
assert not use_bf16_splitk_gemm(*shape)
def test_bf16_splitk_is_enabled_by_default():
@@ -168,15 +168,11 @@ class TestApplyWithAddend(CustomTestCase):
)
elif route == "splitk":
enter(patch.object(unquant, "_enable_bf16_splitk_gemm", True))
enter(
patch.object(
unquant, "use_flashinfer_pr4266_bf16_gemm", lambda *a: True
)
)
enter(patch.object(unquant, "use_bf16_splitk_gemm", lambda *a: True))
enter(
patch.object(
unquant,
"_flashinfer_pr4266_bf16_gemm",
"_bf16_splitk_gemm",
_fake_kernel(kernel_calls, route),
)
)