- 编排:单题流水/双道队列/补跑队列/板端flock互斥器(死线28800s+编译感知看门狗) - 判分:224真任务指标(top1 rel≤5%)+16题参考对账引擎(cos/argmax/延迟) - 16模型双端推理代码(runners/)+任务卡模板+装配示例 - manifests:44模型ONNX sha256指纹(大文件不入库,获取方式见README §4) - 战果:cls@224 28/28全PASS;16题进行中(results16.csv) - 凭据零入库(board.sh已脱敏为环境变量模式) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
2.0 KiB
Markdown
49 lines
2.0 KiB
Markdown
# compile.yaml 旋钮说明(PTQ · hb_compile · hmct 2.6.5 / horizon_tc_ui 3.5.3)
|
||
|
||
`model_parameters` 段的 onnx_model / march / working_dir / output_model_file_prefix 按下表填(平台口径)。
|
||
其余三段照抄模板再按需改。写好后:`/data/oebench/venv-tc/bin/hb_compile -c compile.yaml`。
|
||
|
||
## 模板
|
||
|
||
```yaml
|
||
model_parameters:
|
||
onnx_model: /task/onnx/efficientnet.b2.onnx
|
||
march: nash-m
|
||
working_dir: /workspace/compile_work
|
||
output_model_file_prefix: efficientnet.b2
|
||
layer_out_dump: false
|
||
input_parameters:
|
||
input_type_rt: featuremap # 预处理在主机侧完成,模型吃特征图——不要改
|
||
input_type_train: featuremap
|
||
input_layout_train: NCHW
|
||
calibration_parameters:
|
||
cal_data_dir: /task/calib/npy_f32
|
||
calibration_type: default # default | max | kl | mix ← 主要旋钮
|
||
compiler_parameters:
|
||
compile_mode: latency
|
||
optimize_level: O2
|
||
debug: false
|
||
jobs: 8
|
||
```
|
||
|
||
## 可改旋钮(calibration_parameters 内)
|
||
|
||
| 旋钮 | 取值 | 说明 |
|
||
|---|---|---|
|
||
| calibration_type | default / max / kl / mix | default=自动搜索(首选);掉点大时试 kl 或 mix;skip=不校准(普通 PTQ 必崩,别选) |
|
||
| max_percentile | 0.9999–1.0 | 只对 max 有效,截激活长尾 |
|
||
| per_channel | true / false | 权重逐通道量化;对深度可分离卷积(MobileNet 系)常有帮助 |
|
||
| run_on_cpu | "node_a,node_b" | 敏感节点放 CPU float,逗号分隔 ONNX 节点名;run_on_bpu 反之 |
|
||
| optimization | set_model_output_int8 / set_model_output_int16 | 输出量化位宽 |
|
||
| quant_config | dict | 精细控制:`{model_config: {all_node_type: int8, model_output_type: int16}}` |
|
||
|
||
## 产物
|
||
|
||
编译成功后 `working_dir` 下生成 `<prefix>.hbm`(以及中间产物)。交卷文件名必须是 `model.hbm`。
|
||
|
||
## 常见失败
|
||
|
||
- 校准数据路径错 → 启动即报错,检查 cal_data_dir
|
||
- ONNX 输入维度与校准样本不符 → 检查是否 1x3x288x288 f32
|
||
- 内存不足 → jobs 降到 4
|