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 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:

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?