UIntXWeightOnlyConfig¶
- class torchao.quantization.UIntXWeightOnlyConfig(dtype: dtype, group_size: int = 64, pack_dim: int = - 1, use_hqq: bool = False, set_inductor_config: bool = True)[源代码]¶
用于将 uintx 权重仅非对称逐组量化应用于线性层的配置,其中 x 是由 dtype 指定的位数,使用 uintx 量化。
- 参数:
dtype – torch.uint1 到 torch.uint7 的不足 1 字节的数据类型
group_size – 量化的参数,控制量化的粒度,尺寸越小粒度越细,默认为 64
pack_dim – 我们用于打包的维度,默认为 -1
use_hqq – 是使用 hqq 算法还是默认算法来量化权重
set_inductor_config – 如果为 True,则将 torchinductor 设置调整为推荐值。