IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo module

qmatmul

Provides CPU kernels for block-wise quantized int4 matrix multiplication.

comptime values​

K_BATCH_SIZE​

comptime K_BATCH_SIZE = 512

Defines the batch size of K used to pack A and unpack B weights.

Functions​

  • ​matmul_qint4: Computes a matrix multiply of a float32 A matrix against block-wise quantized int4 B weights, producing a float32 result.
  • ​matmul_qint4_pack_b: Repacks block-wise quantized int4 weights into the tiled layout expected by the matmul_qint4 kernels.