Skip to content

Commit 14ee45b

Browse files
authored
Removed duplicate repack_mxfp4_mxfp4x4x2 function
1 parent 3c8522d commit 14ee45b

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,38 +1325,6 @@ static void init_row_mxfp4x4x2(block_mxfp4 * x, int64_t k) {
13251325
}
13261326
}
13271327

1328-
// repack mxfp4 data into mxfp4x4x2 tensor
1329-
static void repack_mxfp4_mxfp4x4x2(ggml_tensor * t, const void * data, size_t size) {
1330-
int64_t nrows = ggml_nrows(t);
1331-
1332-
size_t row_size = ggml_row_size(t->type, t->ne[0]);
1333-
size_t row_size_pd = ggml_row_size(t->type, hex_round_up(t->ne[0], QK_MXFP4x4x2)); // extra elements for the pad
1334-
size_t row_size_rp = row_size * 2; // extra space for tmp pad (if any)
1335-
1336-
void * buf_pd = ggml_aligned_malloc(row_size_pd);
1337-
GGML_ASSERT(buf_pd != NULL);
1338-
1339-
void * buf_rp = ggml_aligned_malloc(row_size_rp);
1340-
GGML_ASSERT(buf_rp != NULL);
1341-
1342-
HEX_VERBOSE("ggml-hex: repack-mxfp4-mxfp4x4x2 %s : data %p size %zu dims %ldx%ld row-size %zu\n", t->name, data,
1343-
size, t->ne[0], nrows, row_size);
1344-
1345-
init_row_mxfp4x4x2((block_mxfp4 *) buf_pd, t->ne[0]); // init padded buffer to make sure the tail is all zeros
1346-
1347-
for (int64_t i = 0; i < nrows; i++) {
1348-
const uint8_t * src = (const uint8_t *) data + (i * row_size);
1349-
uint8_t * dst = (uint8_t *) t->data + (i * row_size);
1350-
1351-
memcpy(buf_pd, src, row_size);
1352-
repack_row_mxfp4x4x2((uint8_t *) buf_rp, (const block_mxfp4 *) buf_pd, t->ne[0]);
1353-
memcpy(dst, buf_rp, row_size);
1354-
}
1355-
1356-
ggml_aligned_free(buf_pd, row_size_pd);
1357-
ggml_aligned_free(buf_rp, row_size_rp);
1358-
}
1359-
13601328
// repack mxfp4 data into mxfp4x4x2 tensor
13611329
static void repack_mxfp4_mxfp4x4x2(ggml_tensor * t, const void * data, size_t size) {
13621330
int64_t nrows = ggml_nrows(t);

0 commit comments

Comments
 (0)