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 設定調整為推薦值。