metal : revert the concurrnecy change because it was wrong

This commit is contained in:
Georgi Gerganov 2023-09-14 18:00:03 +03:00
parent 336afbcb76
commit e343b8b4d8
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
4 changed files with 6 additions and 7 deletions

View file

@ -610,15 +610,14 @@ void ggml_metal_graph_find_concurrency(
void ggml_metal_graph_compute(
struct ggml_metal_context * ctx,
struct ggml_cgraph * gf,
bool concurrent) {
struct ggml_cgraph * gf) {
@autoreleasepool {
// if there is ctx->concur_list, dispatch concurrently
// else fallback to serial dispatch
MTLComputePassDescriptor * edesc = MTLComputePassDescriptor.computePassDescriptor;
const bool has_concur = concurrent && ctx->concur_list_len && ctx->concur_list_len <= GGML_MAX_CONCUR;
const bool has_concur = ctx->concur_list_len && ctx->concur_list_len <= GGML_MAX_CONCUR;
const int n_nodes = has_concur ? ctx->concur_list_len : gf->n_nodes;
edesc.dispatchType = has_concur ? MTLDispatchTypeConcurrent : MTLDispatchTypeSerial;