From d2937166d38e0149ff9474f3231399ca3e8e0c52 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Thu, 9 Jul 2026 17:42:49 +0100 Subject: [PATCH] fix(sdnq): sync benchmark prep mirror with kernel helpers upstream replaced math.log2/triton.next_power_of_2 with sdnq utils in the attention prep; mirror the same hadamard sizing in make_prep_fn. --- cli/sdnq-attention-benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/sdnq-attention-benchmark.py b/cli/sdnq-attention-benchmark.py index 127e0939c..effc584ed 100755 --- a/cli/sdnq-attention-benchmark.py +++ b/cli/sdnq-attention-benchmark.py @@ -478,15 +478,15 @@ def run_correctness(): def make_prep_fn(q, k, v, attn_mask, kwargs): # mirror sdnq_triton_atten's prep call so the prep column measures the same code path - import triton from modules.sdnq.kernels import triton_atten as atten_module from modules.sdnq.quant_utils import get_hadamard, get_hadamard_group_size + from modules.sdnq.utils import next_power_of_2 matmul_dtype = kwargs.get("matmul_dtype", "int8") do_quantize = kwargs.get("do_quantize", True) hadamard_group_size = kwargs.get("hadamard_group_size", 256) hadamard = None if kwargs.get("use_hadamard", False) and do_quantize and matmul_dtype not in {None, "none", "no"}: - channel_size = min(triton.next_power_of_2(q.shape[-1]), triton.next_power_of_2(k.shape[-1])) + channel_size = next_power_of_2(min(q.shape[-1], k.shape[-1])) hadamard_group_size = min(hadamard_group_size, channel_size) enabled, hadamard_group_size = get_hadamard_group_size(channel_size, hadamard_group_size) if enabled: