File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1222,8 +1222,18 @@ struct test_case {
1222
1222
if (node->op != GGML_OP_NONE && node->src [0 ]) {
1223
1223
for (const auto & [buft, buf] : extra_buf_map) {
1224
1224
size_t id = ggml_hash_find (&hash_set, node);
1225
- ggml_status status = ggml_backend_buffer_init_tensor (buf, node_copies[id]);
1226
- if (status != GGML_STATUS_SUCCESS) {
1225
+ ggml_status status = ggml_backend_buffer_init_tensor (buf, node_copies[id]->src [0 ]);
1226
+ if (status == GGML_STATUS_SUCCESS) {
1227
+ if (node_copies[id]->src [0 ]->extra != nullptr ) {
1228
+ if (strcmp (ggml_backend_buft_name (buft)," CPU_REPACK" ) == 0 ) {
1229
+ if (node_copies[id]->op == GGML_OP_MUL_MAT || node_copies[id]->op == GGML_OP_MUL_MAT_ID) {
1230
+ if (ggml_n_dims (node_copies[id]->src [1 ]) == 2 ) {
1231
+ node_copies[id]->src [0 ]->buffer = buf;
1232
+ }
1233
+ }
1234
+ }
1235
+ }
1236
+ } else {
1227
1237
GGML_LOG_ERROR (" %s: failed to initialize tensor in extra buffer type '%s' for graph copy\n " , __func__, ggml_backend_buft_name (buft));
1228
1238
}
1229
1239
}
You can’t perform that action at this time.
0 commit comments