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 function
gpu_qint4_repack_Q4_0
def gpu_qint4_repack_Q4_0[target: StringSlice[ImmStaticOrigin]](b_tt: TileTensor[DType.uint8, Storage=b_tt.Storage, linear_idx_type=b_tt.linear_idx_type], b_packed_tt: TileTensor[DType.uint8, Storage=b_packed_tt.Storage, linear_idx_type=b_packed_tt.linear_idx_type], ctx: Optional[DeviceContext] = None)
Launches the GPU kernel that repacks Q4_0 weights into the packed GEMM layout.
Parameters:
- βtarget (
StringSlice[ImmStaticOrigin]): The target platform string, which must identify a GPU.
Args:
- βb_tt (
TileTensor[DType.uint8, Storage=b_tt.Storage, linear_idx_type=b_tt.linear_idx_type]): The input Q4_0 quantized weight tile tensor in global memory. - βb_packed_tt (
TileTensor[DType.uint8, Storage=b_packed_tt.Storage, linear_idx_type=b_packed_tt.linear_idx_type]): The output repacked weight tile tensor in global memory. - βctx (
Optional[DeviceContext]): The device context used to enqueue the kernel.
Raises:
An error if the input tensors are not rank-2 or the target is not a GPU.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!