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 权重-仅非对称分组量化应用于线性层,使用 uintx 量化,其中 x 是由 dtype 指定的位数。
- 参数:
dtype – torch.uint1 到 torch.uint7 的子字节数据类型
group_size – 量化的参数,控制量化的粒度,较小的尺寸意味着更精细的粒度,默认为 64
pack_dim – 我们用于打包的维度,默认为 -1
use_hqq – 是否使用 hqq 算法或默认算法来量化权重
set_inductor_config – 如果为 True,则将 torchinductor 设置调整为推荐值。