From 47dee17526ea6d02c5d3b3fdb0e44bcdb871a616 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sun, 19 Jul 2026 12:02:10 -0600 Subject: [PATCH] ssm_timing_test: add naive (gpu_deltanet_batched) timing line Notes: the naive impl dispatches via gpu_deltanet_batched (the meson-selected entry), so ssm_timing_test -- which links the wyut source set -- reports the wyut time for that line, not the naive time. Kept as a placeholder; a true naive isolated measurement needs a naive-set timing target. The in-pipeline SSM phase time (QXMX_PROFILE) is the authoritative number: 1.1 ms/layer. Tried + reverted M1.7b.14 (hoisting q,k L2-norm to a separate pre-kernel to eliminate the 3x GQA redundancy): net neutral -- the pre-kernel's launch + 16-key-head reduce work costs as much as the saved 32 redundant in-kernel L2-norms. Not worth the complexity. The in-kernel L2-norm stays. --- tests/ssm_timing_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ssm_timing_test.cpp b/tests/ssm_timing_test.cpp index 99351fc..bec1649 100644 --- a/tests/ssm_timing_test.cpp +++ b/tests/ssm_timing_test.cpp @@ -78,6 +78,7 @@ int main() { time("beta GEMM", [&]{ gemm_gpu_v4(q,s.beta.codes,s.beta.scales,bvn,sum,asc,bb,s.beta.M,s.beta.K,M,nullptr,false,true); }); time("deltanet_b (M1.5)", [&]{ gpu_deltanet_rmsnorm_b(q,proj,proj+2*QX_SSM_KEYD,ab,bb,s.a_log,s.dt_bias,s.ssm_norm,st,so,M,QX_SSM_CONVD,QX_SSM_CONVD,QX_SSM_VALD); }); time("deltanet_wyut (M1.7a)",[&]{ gpu_deltanet_wyut_b(q,proj,proj+2*QX_SSM_KEYD,ab,bb,s.a_log,s.dt_bias,s.ssm_norm,st,so,M,QX_SSM_CONVD,QX_SSM_CONVD,QX_SSM_VALD); }); + time("deltanet_naive (M1.7b.12)",[&]{ gpu_deltanet_batched(q,proj,proj+2*QX_SSM_KEYD,ab,bb,s.a_log,s.dt_bias,s.ssm_norm,st,so,M,QX_SSM_CONVD,QX_SSM_CONVD,QX_SSM_VALD); }); time("gate GEMM", [&]{ gemm_gpu_v4(q,s.gate.codes,s.gate.scales,bvn,sum,asc,zg,s.gate.M,s.gate.K,M,nullptr,false,true); }); time("silu_mul_q",[&]{ gpu_silu_mul_quant(q,so,zg,QX_SSM_VALD,bvn,sum,asc,M); }); time("out GEMM", [&]{ gemm_gpu_v4(q,s.out.codes,s.out.scales,bvn,sum,asc,x,s.out.M,s.out.K,M,x,false,true); }); -- 2.51.2