Repository navigation
opencl: improve fa, allow dk512 for gemma-4, improve dk64 - #30266
Merged
max-krasnyansky merged 4 commits intoOct 11, 2026
Merged
Conversation
Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
lhez
marked this pull request as ready for review
October 10, 2026 18:19
Contributor
Author
|
@max-krasnyansky please review and ack when you get a chance |
max-krasnyansky
approved these changes
Oct 10, 2026
CISC
approved these changes
Oct 11, 2026
CISC
left a comment
Member
There was a problem hiding this comment.
I would have pushed the nits myself if I could. :)
| std::map<std::tuple<int, int, int>, cl_kernel> f32_f16_mq_decode; | ||
| std::map<std::tuple<int, int, int>, size_t> f32_f16_mq_decode_wg; | ||
| std::map<std::tuple<int, int, int>, int> f32_f16_mq_decode_hs; | ||
| std::set<std::tuple<int, int, int>> f32_f16_mq_decode_attempted; |
Member
There was a problem hiding this comment.
Suggested change
| std::set<std::tuple<int, int, int>> f32_f16_mq_decode_attempted; | |
| std::set<std::tuple<int, int, int>> f32_f16_mq_decode_attempted; |
| cl_int err; | ||
| const std::string & compile_opts = backend_ctx->kernel_compile_opts; | ||
| const std::string opencl_c_std = "CL" + std::to_string(backend_ctx->opencl_c_version.major) + | ||
| "." + std::to_string(backend_ctx->opencl_c_version.minor); |
Member
There was a problem hiding this comment.
Suggested change
| "." + std::to_string(backend_ctx->opencl_c_version.minor); | |
| "." + std::to_string(backend_ctx->opencl_c_version.minor); |
This one just because it wasn't an even 4.
Member
Yeah, I need to figure out how to allow updates from ggml-maintainers in our fork. |
This was referenced Oct 13, 2026
1 task done
wanghqc
added a commit
to qualcomm/llama.cpp
that referenced
this pull request
Oct 22, 2026
ggml-opencl keeps this branch's implementation where upstream added its own version of the same feature: cooperative-K dp4a GEMM (ggml-org#30741, = cok), the act_vload4 dp4a GEMMs (ggml-org#30753, = alds4), the narrow l4_lm / q1_0 nsg1 variants (ggml-org#30850), the FA rework (ggml-org#30266), the expert-sort buf+offset (ggml-org#30418, kept the aligned-copy path) and the PREC_F32 MUL_MAT_ID decline (ggml-org#30365, covered by the src1 precision floor). The gemm_coopk_* kernels are not carried. Taken from upstream: IM2COL_3D (ggml-org#30895), get_rows i32 and cpy i32<->f32 (ggml-org#30756), CLAMP on non-contiguous views (ggml-org#30186), the A6X fixes (ggml-org#30176: a623 detection, constant-fold workaround, no cpy pack kernel), rms_norm full subgroup (ggml-org#30310), the rope build fix (ggml-org#30893), the mxfp4 flat GEMV row bound, the extra q5_0/q5_1/q5_K GEMV tail clamps (ggml-org#30421) and query_valid after the softcap in the q4_0/q8_0 FA prefill (ggml-org#30546). The q4_0 q1_vec FA decode now applies the softcap on the dp4a path too. Speculative decoding keeps this branch's llama_batch path: LiliCorr drafters (ggml-org#30506) are refused at load. The server keeps the tree verify and gives the logprobs of ggml-org#27196 the batch row each accepted token was sampled from. The two GDN n_tokens > K tests are dropped with upstream's relaxed contract.
edwardyoon
pushed a commit
to edwardyoon/focus-llama
that referenced
this pull request
Oct 24, 2026
…0266) * opencl: enable Gemma-4 E4B GPU decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: extend Gemma-4 GPU decode to E2B Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: optimize DK64 GQA8 decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: optimize DK128 GQA4 decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> --------- Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
auRose94
pushed a commit
to auRose94/llama.cpp
that referenced
this pull request
Oct 28, 2026
…0266) * opencl: enable Gemma-4 E4B GPU decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: extend Gemma-4 GPU decode to E2B Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: optimize DK64 GQA8 decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> * opencl: optimize DK128 GQA4 decode Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com> --------- Co-authored-by: Hongqiang Wang <wangh@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR extracts part of #26430 and enables dk = 512 with gqa = 4 and gqa = 8 for FA so gemma-4 does not fall back to CPU when FA is enabled. It also improves dk = 64 with gqa = 8 for gpt-oss-20b.
Additional information
Details
gpt-oss-20b
master
PR
gemma-4-E4B
master
Fallback to CPU
PR
Requirements