[Perf][Qwen4Exp] Merge QSA QKVG and indexer QK projections (#59533)

Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: namgyu-youn <namgyu.dev@gmail.com>
This commit is contained in:
Thien Tran
2026-10-05 07:03:29 +00:00
committed by GitHub
co-authored by Codex namgyu-youn
parent 92044241a0
commit 042ab0305c
6 changed files with 181 additions and 119 deletions
+12 -6
View File
@@ -713,8 +713,8 @@ def test_low_latency_table_capability_routing(
def test_qwen4_exp_hopper_plans_are_valid() -> None:
plans = qwen4_exp_gemm.QWEN4_EXP_SM90_GEMM_PLANS
assert len(plans) == 9
assert sum(map(len, plans.values())) == 31
assert len(plans) == 7
assert sum(map(len, plans.values())) == 24
assert (320, 10240) in plans
assert (10240, 320) not in plans
for (n, k), shape_plans in plans.items():
@@ -728,10 +728,11 @@ def test_qwen4_exp_hopper_plans_are_valid() -> None:
@pytest.mark.parametrize(
"capability,expected_plans",
[
((10, 3), qwen4_exp_gemm.QWEN4_EXP_GEMM_PLANS),
((10, 3), qwen4_exp_gemm.QWEN4_EXP_SM103_GEMM_PLANS),
((10, 0), qwen4_exp_gemm.QWEN4_EXP_SM100_GEMM_PLANS),
((9, 0), qwen4_exp_gemm.QWEN4_EXP_SM90_GEMM_PLANS),
((12, 1), qwen4_exp_gemm.QWEN4_EXP_SM121_GEMM_PLANS),
((12, 0), {}),
((8, 0), {}),
],
)
@@ -742,11 +743,16 @@ def test_qwen4_exp_gemm_capability_routing(
) -> None:
monkeypatch.setattr(
qwen4_exp_gemm.current_platform,
"is_device_capability",
lambda target: capability == target,
"get_device_capability",
lambda: capability,
)
assert qwen4_exp_gemm._gemm_plans() == expected_plans
assert (
qwen4_exp_gemm.QWEN4_EXP_GEMM_PLANS_BY_CAPABILITY.get(
qwen4_exp_gemm.current_platform.get_device_capability(), {}
)
== expected_plans
)
def test_installation_is_shape_specific_and_unquantized(