专栏算法工具链QAT怎么设置全部节点为int16精度

QAT怎么设置全部节点为int16精度

已解决
张元彪2025-08-26
52
5

J6M

QAT过程中,我想将所有的节点设置成int16精度,来测试量化的上限,但只找到了fp16的,复制后修改int16会有问题 assert dtype in (torch.float16, torch.float32)

要怎么一键设置呢?像PTQ那样  "all_node_type": "int16"/"float16",

 

all_fp16_qconfig_setter = TemplateQconfigSetter(
QConfig(
FakeCast.with_args(dtype=torch.float16),
FakeCast.with_args(dtype=torch.float16),
FakeCast.with_args(dtype=torch.float16),

),

[],

)

算法工具链
征程6
评论1
0/1000
  • Huanghui
    Lv.5
    n你参考下这个,OE包里面的
    2025-08-26
    0
    4
    • 张元彪回复Huanghui:
      这个有看过,但只会将这个配置应用到某个节点上,不知道要怎么应用到所有节点上kuxiao_org.svg

      ModuleNameQconfigSetter({ "grid.quant": qconfig, }),

      2025-08-27
      0
    • Huanghui回复张元彪:
      2025-08-28
      0
    • Huanghui回复张元彪:

      这里配置下,配置这个qconfig_setter

      2025-08-28
      0
    • Huanghui回复张元彪:
      2025-08-28
      0