MCPcopy Create free account
hub / github.com/antirez/ds4 / hc_post_batch

Function hc_post_batch

ds4.c:6558–6578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6556 ds4_die("deepseek4.attention.compress_ratios is shorter than the layer count");
6557 }
6558
6559 memset(g_ds4_compress_ratios, 0, sizeof(g_ds4_compress_ratios));
6560 ds4_cursor c = cursor_at(m, arr.data_pos);
6561 for (uint32_t il = 0; il < DS4_N_LAYER; il++) {
6562 uint32_t got = 0;
6563 if (arr.type == GGUF_VALUE_UINT32) {
6564 if (!cursor_u32(&c, &got)) ds4_die(c.error);
6565 } else {
6566 int32_t v = 0;
6567 if (!cursor_read(&c, &v, sizeof(v))) ds4_die(c.error);
6568 if (v < 0) ds4_die("metadata array contains a negative value");
6569 got = (uint32_t)v;
6570 }
6571
6572 const uint32_t expected = ds4_expected_layer_compress_ratio(il);
6573 if (got != expected) {
6574 fprintf(stderr,
6575 "ds4: unexpected DeepSeek4 compression ratio at layer %u for %s: got %u, expected %u\n",
6576 il, DS4_MODEL_SHAPE_NAME, got, expected);
6577 exit(1);
6578 }
6579 g_ds4_compress_ratios[il] = got;
6580 }
6581}

Callers 3

layer_ffn_batchFunction · 0.85
layer_ffn_shared_batchFunction · 0.85

Calls 1

Tested by

no test coverage detected