各位好,想确认一下 J6 / OpenExplorer QAT 链路中 activation per-channel quantization 的支持边界。
目前基于 Horizon 文档和源码看到的信息如下:
1. get_default_qconfig() 默认会把 weight 设置为 per-channel symmetric:
weight_qkwargs["qscheme"] = torch.per_channel_symmetric
weight_qkwargs["ch_axis"] = 0
2. activation 默认看起来是 per-tensor symmetric,即:
qscheme = torch.per_tensor_symmetric
ch_axis = -1
3. 官方文档中有一句说明:
Only weight supports per-channel quantization.
4. 但从源码看,QTensor / FakeQuantize / scale_quanti 似乎具备 per-channel 表达能力。例如可以构造:
FakeQuantize.with_args(
observer=MinMaxObserver,
dtype=qint8,
qscheme=torch.per_channel_symmetric,
ch_axis=1,
)
源码里也能看到类似 per_channel_8bit_fake_quant / per_channel_qat_8bit_qconfig 的定义。
所以想确认几个问题:
1. 在 J6 当前 OpenExplorer QAT + export + convert + compile 全链路中,activation per-channel quantization 是否受支持?
2. 如果支持,是否仅支持特定 op / 特定 tensor layout,例如 NCHW feature 的 ch_axis=1?
3. 如果 PyTorch QAT 阶段可以构造 activation per-channel fake quant,那么 export 到 HBIR、convert 到 quantized.bc、compile 到 hbm 是否都能保持一致?
4. 文档中 “Only weight supports per-channel quantization” 是否表示:
- activation per-channel 完全不支持;
- 还是只是不作为默认推荐配置;
- 或者仅部分算子/部分 backend 不支持?
5. 如果 activation per-channel 不支持,针对 x/y/z 坐标类 feature 共用 per-tensor scale 导致精度损失的场景,推荐方案是否是:
- 拆分 x/y/z 到不同 quant node;
- 对敏感 activation 使用 qint16;
- 使用 FixedScaleObserver;
- 或 high precision output?
环境版本大致为:
OpenExplorer / horizon_plugin_pytorch: 3.0.31
目标平台: J6
