]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
opencl : fix buffer alignment (llama/12197)
authorHenry Linjamäki <redacted>
Thu, 6 Mar 2025 01:33:40 +0000 (03:33 +0200)
committerGeorgi Gerganov <redacted>
Fri, 7 Mar 2025 13:19:59 +0000 (15:19 +0200)
commit9b022c41b64f0b1127df64cb5b7b64bce0022020
tree8a13b0563445deed06ede1eef5ac8298bc196285
parentec6d53694fdeb03c88005bc4f0d78b1efcbb1844
opencl : fix buffer alignment (llama/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.
src/ggml-opencl/ggml-opencl.cpp