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

Function kv_cache_free

ds4.c:8526–8538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8524 if (w->type != DS4_TENSOR_Q8_K) ds4_die("expected a Q8_K expert tensor");
8525 if (n_expert < 1 || (uint32_t)n_expert > DS4_N_EXPERT_USED) ds4_die("unexpected routed expert count");
8526
8527 uint64_t in_dim0 = 0;
8528 uint64_t out_dim0 = 0;
8529 matvec_q8_k_accum_ctx ctx = {
8530 .out = out,
8531 .n_expert = n_expert,
8532 };
8533
8534 for (int i = 0; i < n_expert; i++) {
8535 uint64_t in_dim, out_dim;
8536 ctx.base[i] = tensor_expert_bytes(m, w, (uint32_t)selected[i],
8537 &in_dim, &out_dim, &ctx.row_bytes[i]);
8538 if (i == 0) {
8539 in_dim0 = in_dim;
8540 out_dim0 = out_dim;
8541 } else if (in_dim != in_dim0 || out_dim != out_dim0) {

Callers 4

generate_raw_swa_cpuFunction · 0.85
session_cpu_reset_cacheFunction · 0.85
ds4_session_freeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected