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.
Bmust be repacked before the matmul: usegpu_qint4_repack_Q4_0for GGUF Q4_0 weights orgpu_qint4_repack_GPTQfor GPTQ weights (with optional activation-order permutation).
Functionsβ
- β
gpu_qint4_repack_GPTQ: Launches the GPU kernel that repacks GPTQ weights into the packed GEMM layout. - β
gpu_qint4_repack_Q4_0: Launches the GPU kernel that repacks Q4_0 weights into the packed GEMM layout. - β
matmul_gpu_qint4: Launches a GPU int4 quantized matrix multiplication for the given tile tensors. - β
matmul_gpu_qint4_impl: Dispatches a GPU int4 quantized matrix multiplication to the tuned kernel configuration for the runtime M dimension.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!