Expand description
QTensor — weight tensor with pluggable storage.
Two backings, one interface:
F32— owned dense floats (small models, tests). Every operation is bit-identical to the historical&[f32]code paths.Mapped— quantized bytes zero-copy from the CMF mmap (q8_row/q8_2f). The matvec is fused: int8 rows × f32 activations, the q8_2f column field folds into a pre-scale of the input (x'[i] = col[i]·x[i]), so the inner loop is the same i8 dot as q8_row. This is what lets a 15B file run in a few GB of RSS.
Extension point: new dtypes = new match arm here, nothing else moves.
Enums§
Functions§
- q2tp_
matmat_ for_ test - q2tp_
matvec_ for_ test - Batched q2tp matmat: scalar row kernel over every batch column. CPU prefill only — decode rides the graph, so plain and correct beats clever here. Test doors into the host 2-bit kernels: the stand’s heap corruption pointed at down-shaped tensors, and the private fns need a way to be held to a reference without a model file around them.
- set_
blocked_ override - Force the blocked GEMM on or off, ignoring the environment;
Nonerestores it. For tests that need to run BOTH paths and compare them:blocked_enabledcaches its answer for the life of the process, which is right when the environment is the only input, but leaves a test that flipsCMF_X86_BLOCKEDbetween two calls comparing a path against itself — or against whatever a test running in parallel latched first. - sgemm_
public - Row-major f32 GEMM, exposed for offline tools (the AWNP pass builds a per-layer projection and applies it to every expert; a naive triple loop would turn a two-minute job into half an hour).