aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-21 16:38:45 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-21 16:38:45 +0200
commita2907badacf6bb86e90d82f054419955be572d50 (patch)
tree4bea85140cf0908f62cc18d87ad07dc3d11c0877 /tests
parenta09b41dc4824eb33e11b1e71d95ec94d2411ead8 (diff)
downloadffwd-a2907badacf6bb86e90d82f054419955be572d50.tar.gz
ffwd-a2907badacf6bb86e90d82f054419955be572d50.zip
cuda: fix bf16 BERT batched-attention buffer-layout mismatch
Diffstat (limited to 'tests')
-rwxr-xr-xtests/check_cuda_fast_gemm_parity.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/check_cuda_fast_gemm_parity.py b/tests/check_cuda_fast_gemm_parity.py
index bc201f7..57adf72 100755
--- a/tests/check_cuda_fast_gemm_parity.py
+++ b/tests/check_cuda_fast_gemm_parity.py
@@ -42,6 +42,12 @@ DEFAULT_TEXTS = [
# (BERT/MiniLM/BGE max_position 512, XLM-R 514) accept it; larger 8x/14x inputs
# overflowed their position tables and were (correctly) rejected, which looked
# like a CUDA failure. Still long enough to stress packed-sequence attention.
+#
+# NOTE on coverage: these defaults are all DIFFERENT lengths, so they exercise
+# only the per-sequence (ragged) attention path. The CUDA batched-attention path
+# (cublasGemmBatchedEx) engages only when every sequence in the batch is the SAME
+# length (see attn_batched_setup). To exercise it, pass >=2 identical texts as
+# positional args, e.g. the same sentence four times with --batch-size 4.
def run_cuda(binary: str, model_dir: str, mode: str, weights: str,