]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
opencl : fix buffer alignment (#12197)
authorHenry Linjamäki <redacted>
Thu, 6 Mar 2025 01:33:40 +0000 (03:33 +0200)
committerGitHub <redacted>
Thu, 6 Mar 2025 01:33:40 +0000 (02:33 +0100)
commit94bb63e4f0f6135579b88e5700ed40cefa374e09
tree8987448295de1283ca5a32365e521d4a163a89be
parentf79243992cd31e4e4844d5158d2f3325b1d2d811
opencl : fix buffer alignment (#12197)

Fix the following error:

```
ggml-alloc.c:99: not enough space in the buffer
ggml_tallocr_alloc: not enough space in the buffer to allocate blk.17.ffn_down.weight (needed 27525120, available 27521024)
```

which occurs when `ggml_backend_opencl_context::alignment` is larger
than `cl_ptr_base` (hard-coded to `0x1000`).

Also, fix `ggml_backend_opencl_context::alignment` was set to
`CL_DEVICE_MEM_BASE_ADDR_ALIGN` which was treated as bytes but the
value is reported in bits.
ggml/src/ggml-opencl/ggml-opencl.cpp