Skip to content

Vulkan: Fix mmq int dot float cache size #12722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq.comp
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ void main() {
#endif

#if QUANT_AUXF == 1
FLOAT_TYPE cache_a_dm[TM];
FLOAT_TYPE cache_a_dm[WMITER * TM];
#else
FLOAT_TYPE_VEC2 cache_a_dm[TM];
FLOAT_TYPE_VEC2 cache_a_dm[WMITER * TM];
#endif

FLOAT_TYPE_VEC2 cache_b_ds[TN];
Expand All @@ -247,7 +247,6 @@ void main() {
const uint iqs = loadr_a;
const uint buf_ib = loadc_a + l;

// Should ds be gated to a single thread?
if (iqs == 0) {
#if QUANT_AUXF == 1
buf_a_dm[buf_ib] = get_d(ib);
Expand Down Expand Up @@ -276,7 +275,6 @@ void main() {

const uint buf_ib = loadc_b + l;

// Should ds be gated to a single thread?
if (iqs == 0) {
buf_b_ds[buf_ib] = FLOAT_TYPE_VEC2(data_b[ib].ds);
}
Expand Down
4 changes: 2 additions & 2 deletions ggml/src/ggml-vulkan/vulkan-shaders/mul_mmq_funcs.comp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ i32vec2 repack(uint ib, uint iqs) {
}

ACC_TYPE mul_q8_1(int32_t q_sum, float da, vec2 dsb) {
return ACC_TYPE(da * (float(q_sum) * dsb.x - 8.0 * dsb.y));
return ACC_TYPE(da * (float(q_sum) * dsb.x - 8.0f * dsb.y));
}
#endif

Expand Down Expand Up @@ -51,7 +51,7 @@ i32vec2 repack(uint ib, uint iqs) {
}

ACC_TYPE mul_q8_1(int32_t q_sum, float da, vec2 dsb) {
return ACC_TYPE(da * (float(q_sum) * dsb.x - 16.0 * dsb.y));
return ACC_TYPE(da * (float(q_sum) * dsb.x - 16.0f * dsb.y));
}
#endif

Expand Down
Loading