diff options
author | Kawrakow <48489457+ikawrakow@users.noreply.github.com> | 2023-06-12 14:31:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 14:31:36 +0300 |
commit | 8c0a10e64dbf60fd9946c0cd5e6f59690800b123 (patch) | |
tree | fb69c71663c6c987160caf1f17f2bf9c254fe01e | |
parent | fa84c4b3e80199a5683438f062009c031a06c4fa (diff) |
metal : fix failure to load model (#1817)
The number of buffers in the ggml context was left unitialized.
This leads to sporadic failures to load the model on
startup. It is actually strange that the failure occurred so
infrequantly.
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
-rw-r--r-- | ggml-metal.m | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ggml-metal.m b/ggml-metal.m index 16a362fd..b73f51f2 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -86,6 +86,7 @@ struct ggml_metal_context * ggml_metal_init(void) { ctx->device = MTLCreateSystemDefaultDevice(); ctx->queue = [ctx->device newCommandQueue]; + ctx->n_buffers = 0; // determine if we can use MPS if (MPSSupportsMTLDevice(ctx->device)) { |