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_GPTQ
def gpu_qint4_repack_GPTQ[group_size: Int, 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], perm_idx: OptionalReg[LayoutTensor[DType.int32, Layout.row_major(Int(-1)), ImmutAnyOrigin]] = None, ctx: Optional[DeviceContext] = None)
Launches the GPU kernel that repacks GPTQ weights into the packed GEMM layout.
Parameters:
- βgroup_size (
Int): The number of K elements sharing a single scale. - β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 GPTQ 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. - βperm_idx (
OptionalReg[LayoutTensor[DType.int32, Layout.row_major(Int(-1)), ImmutAnyOrigin]]): An optional permutation index tensor for the K dimension. - βctx (
Optional[DeviceContext]): The device context used to enqueue the kernel.
Raises:
An error if the input tensors are not rank-2, the target is not a GPU, or the input and output dimensions are mismatched.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!