Int8DynamicActivationInt8WeightConfig¶
- class torchao.quantization.Int8DynamicActivationInt8WeightConfig(layout: Optional[Layout] = PlainLayout(), act_mapping_type: Optional[MappingType] = MappingType.SYMMETRIC, weight_only_decode: bool = False, set_inductor_config: bool = True)[源代码]¶
用于将 int8 动态对称每 token 激活和 int8 每通道权重量化应用于线性层的配置。
- 参数:
layout – Optional[Layout] = PlainLayout() - 量化权重的张量布局。控制如何存储和访问量化数据。
act_mapping_type – Optional[MappingType] = MappingType.SYMMETRIC - 激活量化的映射类型。SYMMETRIC 在零周围使用对称量化。
weight_only_decode – bool = False - 如果为 True,则在前向传播期间仅量化权重,并在解码操作期间将激活保持为原始精度。
set_inductor_config – bool = True - 如果为 True,则将 torchinductor 设置调整为推荐值,以获得此量化方案的更好性能。