MCPcopy Create free account
hub / github.com/Niko1221/Strata / block_buffers_bytes

Function block_buffers_bytes

engine/src/core/layer.cpp:1450–1462  ·  view source on GitHub ↗

================================ ONE WHOLE BLOCK ================================

Source from the content-addressed store, hash-verified

1448}
1449// ================================ ONE WHOLE BLOCK ================================
1450uint64_t block_buffers_bytes(const ModelGeometry& g) { const strata::kernels::GrShapes s{g.n_embd, g.hc, g.hc_lr}; uint64_t n = 0; n += (uint64_t) g.hc * g.n_embd * 4;
1451// R
1452n += (uint64_t) g.n_embd * 4;
1453// mixed
1454n += (uint64_t) g.n_embd * 4;
1455// block_out
1456n += (uint64_t) g.hc * 4;
1457// inject
1458n += (uint64_t) g.hc * 4 * 2 + 32;
1459// inject2, gr_rs
1460n += q8k_bytes(g.n_embd);
1461// head_q8k
1462n += strata::kernels::gr_workspace_bytes(s); return align_up16(n) + 256;}
1463uint64_t block_buffers_init(const ModelGeometry& g, void* base, BlockBuffers& b) { const strata::kernels::GrShapes s{g.n_embd, g.hc, g.hc_lr}; Cursor c{(uint8_t*) base}; b.R = c.take<float>((uint64_t) g.hc * g.n_embd); b.mixed = c.take<float>((uint64_t) g.n_embd); b.block_out = c.take<float>((uint64_t) g.n_embd); b.inject = c.take<float>((uint64_t) g.hc); b.inject2 = c.take<float>((uint64_t) g.hc); b.gr_rs = c.take<float>((uint64_t) g.hc); b.head_q8k = c.take_bytes(q8k_bytes(g.n_embd)); uint8_t* grw = c.take_bytes(strata::kernels::gr_workspace_bytes(s)); strata::kernels::gr_workspace_init(s, grw, b.gr); return c.used;}
1464// ---- THE HALF-LEVEL C1 ORACLE. `dump` is a HOST buffer of `2 * n_embd + 2 * hc + n_head * head_dim` floats
1465// per layer; this enqueues one slice of it as a device-to-host copy. **IT RUNS INSIDE THE CAPTURE**, which is

Callers 2

session_bytesFunction · 0.70
session_initFunction · 0.70

Calls 3

gr_workspace_bytesFunction · 0.85
q8k_bytesFunction · 0.70
align_up16Function · 0.70

Tested by

no test coverage detected