Skip to content

Commit 560729e

Browse files
committed
fix unit test failure
1 parent b720e47 commit 560729e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml/src/ggml-qnn/npu/device/op_flash_attn.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ void flash_attn_impl(hexagon::tensor * out, const hexagon::tensor * q, const hex
105105
}
106106

107107
const npu_device_fp16_t * mp =
108-
mask_ptr ? reinterpret_cast<const npu_device_fp16_t *>(mask_ptr + iq1 * mask->get_nb(1)) : nullptr;
108+
mask_ptr ? reinterpret_cast<const npu_device_fp16_t *>(mask_ptr + iq1 * mask->get_nb(1) +
109+
(iq3 % mask->get_ne(2)) * mask->get_nb(2)) :
110+
nullptr;
109111

110112
// k indices
111113
const int ik3 = iq3 / rk3;

0 commit comments

Comments
 (0)