Skip to content

Commit 920b5f4

Browse files
committed
checkpoint
1 parent 77b1864 commit 920b5f4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5916,15 +5916,20 @@ static void ggml_backend_metal_split_buffer_context_free(struct ggml_backend_met
59165916

59175917
// Tensor split calculation
59185918
static void get_row_split(int64_t * row_low, int64_t * row_high, const struct ggml_tensor * tensor, const float tensor_split[1], int id) {
5919+
GGML_LOG_DEBUG("%s: tensor '%s', id=%d, ne[1]=%lld\n", __func__, tensor->name, id, tensor->ne[1]);
5920+
59195921
// For Metal, we only have one device, so all rows go to device 0
59205922
if (id == 0) {
59215923
*row_low = 0;
59225924
*row_high = tensor->ne[1];
5925+
GGML_LOG_DEBUG("%s: assigning rows [%lld, %lld] to device %d\n", __func__, *row_low, *row_high, id);
59235926
} else {
59245927
*row_low = 0;
59255928
*row_high = 0;
5929+
GGML_LOG_DEBUG("%s: device %d gets no rows\n", __func__, id);
59265930
}
59275931

5932+
GGML_LOG_DEBUG("%s: tensor_split[0] = %f\n", __func__, (double)tensor_split[0]);
59285933
GGML_UNUSED(tensor_split);
59295934
}
59305935

@@ -6012,7 +6017,7 @@ static enum ggml_status ggml_backend_metal_split_buffer_init_tensor(ggml_backend
60126017
return GGML_STATUS_ALLOC_FAILED;
60136018
}
60146019

6015-
GGML_LOG_DEBUG("%s: tensor '%s' Metal buffer allocated at %p\n", __func__, tensor->name, extra->data_device[id]);
6020+
GGML_LOG_DEBUG("%s: tensor '%s' Metal buffer allocated at %p\n", __func__, tensor->name, (void *)extra->data_device[id]);
60166021

60176022
// Initialize buffer with zeros
60186023
GGML_LOG_DEBUG("%s: tensor '%s' initializing buffer with zeros\n", __func__, tensor->name);
@@ -6212,7 +6217,7 @@ GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_split_buffer_type(int m
62126217
ctx->tensor_split[0] = 1.0f; // All tensors go to the single Metal device
62136218
ctx->name = "Metal_Split";
62146219

6215-
GGML_LOG_DEBUG("%s: tensor_split[0] = %f\n", __func__, ctx->tensor_split[0]);
6220+
GGML_LOG_DEBUG("%s: tensor_split[0] = %f\n", __func__, (double)ctx->tensor_split[0]);
62166221

62176222
// Allocate a new buffer type structure each time
62186223
struct ggml_backend_buffer_type * buft = calloc(1, sizeof(struct ggml_backend_buffer_type));

0 commit comments

Comments
 (0)