"""Trimmed inference-only utils for the self-loading quantized checkpoint.""" import torch from .qtip_misc import clean from .qtip_matmul_had import get_hadK, matmul_hadU_cuda, matmul_hadUt_cuda from .qtip_kernel_check import has_kernel from .qtip_kernel_decompress import decode_compressed def dtype_from_str(s): return {"torch.int64": torch.int64, "torch.int32": torch.int32, "torch.int16": torch.int16, "torch.uint8": torch.uint8, "torch.int8": torch.int8}[s]