Skip to content

Commit

Permalink
metal : fix failure to load model (ggerganov#1817)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ikawrakow and Kawrakow authored Jun 12, 2023
1 parent fa84c4b commit 8c0a10e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ggml-metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ @implementation GGMLMetalClass

ctx->device = MTLCreateSystemDefaultDevice();
ctx->queue = [ctx->device newCommandQueue];
ctx->n_buffers = 0;

// determine if we can use MPS
if (MPSSupportsMTLDevice(ctx->device)) {
Expand Down

0 comments on commit 8c0a10e

Please sign in to comment.