sophgo / tpu-mlir

Machine learning compiler based on MLIR for Sophgo TPU.
Other
612 stars 154 forks source link

生成量化表过程中报错 #182

Closed dzy1128 closed 3 months ago

dzy1128 commented 3 months ago

The dir path of compiler_profile is "./" bmcpu init: skip cpu_user_defined Cannot open libusercpu.so, disable user cpu layer. can't open calibration table file! UNREACHABLE executed at /workspace/tpu-mlir/lib/Dialect/Top/Transforms/ImportCalibration.cpp:44! PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump:

  1. Program arguments: tpuc-opt yolov8.mlir --init "--processor-assign=chip=bm1684x num_device=1 num_core=1 addr_mode=auto" "--import-calibration-table=file=yolov8_cali_table asymmetric=False" --processor-top-optimize "--convert-top-to-tpu=mode=INT8 asymmetric=False doWinograd=False ignore_f16_overflow=False q_group_size=0" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolov8.mlir.INT8.tune.mlir

    0 0x0000557b4c85c777 (/workspace/tpu-mlir/bin/tpuc-opt+0x7e8777)

    1 0x0000557b4c85a49e (/workspace/tpu-mlir/bin/tpuc-opt+0x7e649e)

    2 0x0000557b4c85d0fa (/workspace/tpu-mlir/bin/tpuc-opt+0x7e90fa)

    3 0x00007f126eab1520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)

    4 0x00007f126eb059fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)

    5 0x00007f126eab1476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)

    6 0x00007f126ea977f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)

    7 0x0000557b4c85a2c1 (/workspace/tpu-mlir/bin/tpuc-opt+0x7e62c1)

    8 0x0000557b4dbbe117 (/workspace/tpu-mlir/bin/tpuc-opt+0x1b4a117)

    9 0x0000557b4dccca14 (/workspace/tpu-mlir/bin/tpuc-opt+0x1c58a14)

    10 0x0000557b4dccd041 (/workspace/tpu-mlir/bin/tpuc-opt+0x1c59041)

    11 0x0000557b4dccf4e8 (/workspace/tpu-mlir/bin/tpuc-opt+0x1c5b4e8)

    12 0x0000557b4c84de2b (/workspace/tpu-mlir/bin/tpuc-opt+0x7d9e2b)

    13 0x0000557b4c84d1f4 (/workspace/tpu-mlir/bin/tpuc-opt+0x7d91f4)

    14 0x0000557b4dee26a8 (/workspace/tpu-mlir/bin/tpuc-opt+0x1e6e6a8)

    15 0x0000557b4c8474fa (/workspace/tpu-mlir/bin/tpuc-opt+0x7d34fa)

    16 0x0000557b4c8479c4 (/workspace/tpu-mlir/bin/tpuc-opt+0x7d39c4)

    17 0x0000557b4c84640a (/workspace/tpu-mlir/bin/tpuc-opt+0x7d240a)

    18 0x00007f126ea98d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)

    19 0x00007f126ea98e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)

    20 0x0000557b4c845815 (/workspace/tpu-mlir/bin/tpuc-opt+0x7d1815)

    Aborted (core dumped) Traceback (most recent call last): File "/workspace/tpu-mlir/python/tools/run_qtable.py", line 54, in searcher.run() File "/workspace/tpu-mlir/python/calibration/mix_precision.py", line 912, in run int8_model = MixQuantModel(self.fp32_mlir, self.chip, self.calib_table) File "/workspace/tpu-mlir/python/calibration/mix_precision.py", line 98, in init mlir_lowering(self.fp32_mlir, self.quanted_mlir_file, self.mode, self.chip, 1, 1, File "/workspace/tpu-mlir/python/utils/mlir_shell.py", line 138, in mlir_lowering _os_system(cmd, mute=mute) File "/workspace/tpu-mlir/python/utils/mlir_shell.py", line 56, in _os_system raise RuntimeError("[!Error]: {}".format(cmd_str)) RuntimeError: [!Error]: tpuc-opt yolov8.mlir --processor-assign="chip=bm1684x num_device=1 num_core=1 addr_mode=auto" --import-calibration-table="file=yolov8_cali_table asymmetric=False" --processor-top-optimize --convert-top-to-tpu="mode=INT8 asymmetric=False doWinograd=False ignore_f16_overflow=False q_group_size=0" --canonicalize --weight-fold -o yolov8.mlir.INT8.tune.mlir

HarmonyHu commented 3 months ago

这个错误是因为yolov8_cali_table文件不存在,需要用run_calibration.py生成该table @dzy1128