Skip to content

opencl: fix potential crash in aos reconstruct#25383

Merged
lhez merged 1 commit into
ggml-org:masterfrom
qualcomm:lh/fix-aos-reconstruct-crash
Jul 8, 2026
Merged

opencl: fix potential crash in aos reconstruct#25383
lhez merged 1 commit into
ggml-org:masterfrom
qualcomm:lh/fix-aos-reconstruct-crash

Conversation

@lhez

@lhez lhez commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Overview

ggml_cl_mul_mat_dequant_quant_to_f16 reconstruct the original quantization representation (AOS) from flattened representation (SOA). The reconstructed buffer (aos) is release right after it is determined that the caller didn't request it. Because aos is used in a kernel call, it will only be release after the kernel call.

However, aos may be used in another kernel call via src_buf at the end of the function. At that point, aos has been released if it was created. Adreno driver is permissive and this doesn't cause any issue. With less permissive driver, e.g., Intel, this causes incorrect results and crash.

This PR fixes this issue.

Additional information

Requirements

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend labels Jul 7, 2026
@lhez lhez marked this pull request as ready for review July 7, 2026 06:50
@lhez lhez requested a review from a team as a code owner July 7, 2026 06:50
@lhez

lhez commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@ggml-org/maintainers can I get another approval please?

@lhez lhez merged commit 931ca30 into ggml-org:master Jul 8, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants