Skip to content

Commit e591a67

Browse files
committed
fix(cuda): use N64 centroids in turbo4_64 decode
Assisted-by: OpenAI Codex
1 parent 3e02da7 commit e591a67

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ggml/src/ggml-cuda/mt_pagedattn_decode.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static __device__ __forceinline__ void decode_coop_stage_turbo4_64(
315315
#pragma unroll
316316
for (int l = 0; l < 2; ++l) {
317317
const uint8_t idx_nib = (packed >> (l * 4)) & 0xF;
318-
const float val = TURBO_CENTROIDS_4BIT[idx_nib] * norm_f;
318+
const float val = TURBO_CENTROIDS_4BIT_N64[idx_nib] * norm_f;
319319
smem_dst[smem_row_base + smem_col_base + l] = __float2half(val);
320320
}
321321
}

tests/test-paged-attn-vk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ int main() {
11211121
for (int ctx : { 128, 512 }) {
11221122
char l[64]; snprintf(l, sizeof l, "paged turbo4_64 hd64 decode ctx=%d", ctx);
11231123
const paged_case d64 { 64, 8, 2, 16, 1, ctx, 1, GGML_TYPE_TURBO4_64 };
1124-
all_ok = compare_paged_case(l, d64, vk, cuda, 5e-2) && all_ok;
1124+
all_ok = compare_paged_case(l, d64, vk, cuda, 1e-2) && all_ok;
11251125
}
11261126
}
11271127

0 commit comments

Comments
 (0)