Skip to content

Commit 22cae83

Browse files
authored
metal : adaptive CPU/GPU interleave based on number of nodes (ggml-org#19369)
1 parent 449ec2a commit 22cae83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ggml/src/ggml-metal/ggml-metal-context.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ bool ggml_metal_cpy_tensor_async(ggml_metal_t ctx_src, ggml_metal_t ctx_dst, con
415415

416416
enum ggml_status ggml_metal_graph_compute(ggml_metal_t ctx, struct ggml_cgraph * gf) {
417417
// number of nodes encoded by the main thread (empirically determined)
418-
const int n_main = 64;
418+
const int n_main = MAX(64, 0.1*gf->n_nodes);
419419

420420
// number of threads in addition to the main thread
421421
const int n_cb = ctx->n_cb;

0 commit comments

Comments
 (0)