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_gpu

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

Computes C = A @ B on the GPU, where B holds 4-bit quantized integer weights packed eight values per 32-bit word and A and C are bfloat16. The weights are dequantized in shared memory and fed through a multistage, software-pipelined tensor-core GEMM.

Limitations​

  • Requires an NVIDIA GPU target.
  • B must be repacked before the matmul: use gpu_qint4_repack_Q4_0 for GGUF Q4_0 weights or gpu_qint4_repack_GPTQ for GPTQ weights (with optional activation-order permutation).

Functions​

Was this page helpful?