metal: initialize encode_async in ggml_backend_metal_init (#2334)
ggml_metal_init leaves ctx->encode_async nil, but ggml_backend_metal_graph_compute invokes it unconditionally, so a Metal backend created without a prior set_n_cb call segfaults on its first graph. This affects rpc-server and ggml_backend_reg_metal_init; the llama.cpp path is unaffected, since llama_graph_compute sets n_cb before every compute. Upstream added the same call in cad341d88 (#9698), the commit that introduced encode_async. ik_llama.cpp carries the block but not the initialization.
This commit is contained in:
parent
28fbe34ce9
commit
850320be8b
|
|
@ -4509,6 +4509,8 @@ ggml_backend_t ggml_backend_metal_init(void) {
|
||||||
/* .context = */ ctx,
|
/* .context = */ ctx,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ggml_backend_metal_set_n_cb(metal_backend, 1);
|
||||||
|
|
||||||
return metal_backend;
|
return metal_backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue