From ae275f2d0a44fc56324ddfc7a60e29e1e93865fa Mon Sep 17 00:00:00 2001 From: Paul Tsochantaris Date: Tue, 16 Jan 2024 17:01:34 +0000 Subject: [PATCH] Reduce diff noise --- ggml-metal.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ggml-metal.m b/ggml-metal.m index 30b00fa4a..a549e6713 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -2245,13 +2245,15 @@ static bool ggml_metal_graph_compute( }); // Wait for completion and check status of each command buffer - for (int cb_idx = 0; cb_idx < n_cb; ++cb_idx) { - id command_buffer = command_buffers[cb_idx]; + // needed to detect if the device ran out-of-memory for example (#1881) + + for (int i = 0; i < n_cb; ++i) { + id command_buffer = command_buffers[i]; [command_buffer waitUntilCompleted]; MTLCommandBufferStatus status = [command_buffer status]; if (status != MTLCommandBufferStatusCompleted) { - GGML_METAL_LOG_INFO("%s: command buffer %d failed with status %lu\n", __func__, cb_idx, status); + GGML_METAL_LOG_INFO("%s: command buffer %d failed with status %lu\n", __func__, i, status); return false; } }