专栏算法工具链遇到Calibrated Cosine正常但是Quantized Cosine很低

遇到Calibrated Cosine正常但是Quantized Cosine很低

解答中
puppy2026-02-04
78
11
我转hbm的yaml如下

# decoder config

calibration_parameters:
  cal_data_dir: ./calibration_data_dir_cup/decoder_inputs/noisy_action;./calibration_data_dir_cup/decoder_inputs/img_feature;./calibration_data_dir_cup/decoder_inputs/robot_feature;./calibration_data_dir_cup/decoder_inputs/text_feature;./calibration_data_dir_cup/decoder_inputs/text_token_mask;./calibration_data_dir_cup/decoder_inputs/timesteps;./calibration_data_dir_cup/decoder_inputs/joint_mask;./calibration_data_dir_cup/decoder_inputs/joint_relative_pos


  quant_config: {
    "model_config": {
      "all_node_type": "int16"

    }

  }



compiler_parameters:
  advice: 0
  balance_factor: 0
  cache_mode: enable
  cache_path: 'cache'
  compile_mode: latency
  core_num: 1
  jobs: 64
  max_time_per_fc: 0
  optimize_level: O2


input_parameters:
  input_layout_train: NCHW;NCHW;NCHW;NCHW;NCHW;NCHW;NCHW;NCHW
  input_name: noisy_action;img_feature;robot_feature;text_feature;text_token_mask;timesteps;joint_mask;joint_relative_pos
  input_shape: 1x64x14x8;1x1600x256;1x14x1x256;1x14x256;1x14;1;1x14;1x14x14


  input_type_rt: featuremap;featuremap;featuremap;featuremap;featuremap;featuremap;featuremap;featuremap
  input_type_train: featuremap;featuremap;featuremap;featuremap;featuremap;featuremap;featuremap;featuremap
  mean_value: ''
  scale_value: ''
  separate_batch: false
  std_value: ''


model_parameters:
  debug_mode: ''
  march: nash-e
  onnx_model: test_onnx_model_cup/decoder_step_patched1.onnx
  output_model_file_prefix: decoder_opt
  output_nodes: ''
  remove_node_name: ''
  remove_node_type: Quantize;Dequantize;Cast;Softmax
  # remove_node_type: Quantize;Dequantize
  working_dir: ./model_output_calib_decoder_cup

log以附件形式上传,麻烦各位看下是哪里的问题

附件:
算法工具链
技术深度解析
评论2
0/1000
  • Huanghui
    Lv.5

    另外,你的工具链版本多少呢?试试最新版本的情况~

    2026-02-05
    0
    0
  • Huanghui
    Lv.5

    收到,这个模型看着有点大呀,Calibrated Cosine正常Quantized很低的情况不多, 初步判断应该可能是量化转查表导致的,方便模型+yaml+校准集分享一下吗,这个要仔细分析一下看看才行

    2026-02-05
    0
    9
    • puppy回复Huanghui:

      yaml是这个

      2026-02-05
      0
    • Huanghui回复puppy:

      有可能, aLib到quantized这个步骤能做的事情很少, 所以需要你先确定一下工具链版本,然后模型文件这些需要分享一下,这个需要编译器的同事一起看看。

      2026-02-05
      0
    • Huanghui回复puppy:

      对了,也可以把有问题的层搞成FLOAT32取消量化看看~

      2026-02-05
      0
    • puppy回复Huanghui:

      是这样嘛

      2026-02-05
      0
    • Huanghui回复puppy:

      是的,测试结果如何?

      2026-02-05
      0
    • puppy回复Huanghui:

      变成这样了

      2026-02-05
      0
    • puppy回复Huanghui:

      我后面把transpose和他前一个算子head/output_layers/output_layers.4/MatMul也搞成float32,然后又变成了0.31

      2026-02-05
      0
    • Huanghui回复puppy:

      1. 日志中信息缺失,无法看到 Quantized Cosine 是从什么时候开始变差的。你是否可以分模块导出看看问题出在哪个子模块甚至哪个layer中。2. 你使用verifer工具真实测试过量化一致性嘛?

      2026-02-05
      0
    • puppy回复Huanghui:
      感谢指导,1.之前在附件里上传过,我看了下有一个bool变成0.08,其余均是1或者--,但结果是0.31
      2026-02-05
      0