From 8753729e9322f5b289584a9d80c09674ba0a00a3 Mon Sep 17 00:00:00 2001 From: bcloud Date: Sat, 14 Nov 2026 03:14:11 -0400 Subject: [PATCH] tests: hrx-loom-jit-test passes the V ROW stride, which is what the kernel and the dispatcher use FlashAttention's value_stride is one V row, not rows-times-heads: loom-libs/ops/flash_attention_f32_f16_wmma.loom:331 %value_row_stride = scf.select %transposed_value, %c1, %value_stride dispatch_registration/common/dispatch-flash-attention.cpp:577 static_cast(match.value->nb[1] / sizeof(ggml_fp16_t)) and V is [head_size, kv_capacity, kv_head_count, 1] -- the matcher requires ne[2] == key_value_head_count (:265) -- so a contiguous V gives nb[1]/2 = head_size exactly. The suite was passing key_value_head_count * head_size, which no dispatch can produce for any kv_head_count > 1, under a comment claiming dispatch-flash-attention.cpp emits it and the suite passes the same value. It cannot; that is the same 'config value no dispatch produces' class the config fixes were made for (engine#2404). Severity, stated plainly: low. This case is a compile check, so nothing ever executed with the wrong stride, which is why the suite was green. What was wrong is that it no longer exercised a production-representative configuration while asserting that it did. Verified at a21b25099, one gpu-hold ticket, dmesg resets 0 before / 0 after: compile [PASS], suite 5 passed / 1 failed of 6 -- the remaining failure is materialize, AMD's Dynamic-workload cache path that this line's cache does not implement (engine#2404), untouched by this change. --- tests/hrx-loom-jit-test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/hrx-loom-jit-test.cpp b/tests/hrx-loom-jit-test.cpp index 8ea9d23b7093..90b9a257bb89 100644 --- a/tests/hrx-loom-jit-test.cpp +++ b/tests/hrx-loom-jit-test.cpp @@ -239,10 +239,13 @@ static std::map flash_attention_config(const char * qu { "ggml.flash_attention.key_value_head_count", key_value_head_count }, { "ggml.flash_attention.qk_head_size", head_size }, { "ggml.flash_attention.value_head_size", head_size }, - // engine#2138: this line's prefill kernel takes the V row stride as a config (#95, MLA shapes); - // dispatch-flash-attention.cpp emits it, and test-hrx-loom-jit.cpp passes the same value. - { "ggml.flash_attention.value_stride", - std::to_string(std::stoll(key_value_head_count) * std::stoll(head_size)) }, + // engine#2138: this line's prefill kernel takes the V row stride as a config (#95, MLA shapes). + // It is ONE ROW: flash_attention_f32_f16_wmma.loom:331 names it `value_row_stride`, and + // dispatch-flash-attention.cpp:577 emits `match.value->nb[1] / sizeof(fp16)`. V is + // [head_size, kv_capacity, kv_head_count, 1] (the matcher requires ne[2] == key_value_head_count), so + // contiguous rows give nb[1]/2 = head_size -- multiplying by the head count would be a stride no + // dispatch produces. engine#2404. + { "ggml.flash_attention.value_stride", head_size }, { "ggml.flash_attention.attention_scale", attention_scale }, { "ggml.flash_attention.apply_gate", "0" }, { "ggml.flash_attention.gate_stride_head", "1" },