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

Method gemm

engine/src/core/dflash2.cpp:480–491  ·  view source on GitHub ↗

STRATA_DF2_NO_BIND

Source from the content-addressed store, hash-verified

478
479#endif // STRATA_DF2_NO_BIND
480void Dflash2Drafter::gemm(std::initializer_list<const char*> names, std::initializer_list<float*> outs, int ncols, cudaStream_t cs, const uint8_t* xq, const float* xd) {
481 kernels::Df2Mat mats[3];
482 int n = 0, n_in = 0;
483 auto o = outs.begin();
484 for (const char* name : names) {
485 const Tensor& t = find(name);
486 mats[n] = kernels::Df2Mat{blob_ + t.off, *o++, (int) t.rows, t.dtype == "q4_0"};
487 if (n == 0) n_in = (int) t.cols;
488 ++n;
489 }
490 kernels::df2_gemm(mats, n, xq, xd, n_in, ncols, cs);
491}
492
493// The part of a context update after the activations are quantized: per layer the keys and values (projection, k-norm, rope, ring write). Also what a ring
494// rebuild runs over logged rows: `xq` / `xd` are then the log's codes and scales, `pos` the rows' positions (device), rt_ctx_ their rope table.

Callers 4

mvMethod · 0.45
ingest_devMethod · 0.45
emit_draftMethod · 0.45
draft_batchMethod · 0.45

Calls 3

df2_gemmFunction · 0.85
findFunction · 0.70
beginMethod · 0.45

Tested by

no test coverage detected