昇腾社区首页
中文
注册

调测失败提示RuntimeError: run output data xxx not found

问题描述

执行Kernel显示结束,但最后报错提示没有找到output输出文件。

可能的原因

CPU/NPU的Kernel执行失败,导致输出路径下无输出文件生成。

处理方案

  1. 设置环境变量。
    在任意终端窗口打开CANN环境变量文件,缺省路径为“${INSTALL_DIR}/set_env.sh”,设置如下变量,放开日志打印等级:
    export ASCEND_GLOBAL_LOG_LEVEL=3         # 设置日志级别为ERROR
    export ASCEND_SLOG_PRINT_TO_STDOUT=1     # 开启日志打屏,日志将不会保存在log文件中
  2. 获取日志文件。

    无论命令行或API方式,日志落盘地址由NPU调测参数 > log-fileset_log_file接口指定,缺省为当前操作路径的debug_op.log。请根据实际路径打开日志文件。

  3. 截取CPU/NPU调测命令,重新执行后再分析。
    1. 在debug_op.log中找到“cpu kernel run start”或“npu kernel run start”关键字。
    2. 手动拷贝关键字后的所有命令,在终端窗口分别执行,通过打屏或者落盘的日志文件信息进一步分析问题。
    [CONSOLE] ascendc_debug_tool [3626213] 2024-05-21 19:15:35,513 ==================== cpu kernel run start ====================
    [CONSOLE] ascendc_debug_tool [3626213] 2024-05-21 19:15:35,513 execute_cmd: bash -c "cd /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/cpu/build && ./foreach_sigmoid_cpu | tee -a /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case.log && cd -"
    cpu run start
    [CONSOLE] ascendc_debug_tool [3626213] 2024-05-21 19:15:36,046 ==================== npu kernel run start ====================
    [CONSOLE] ascendc_debug_tool [3626213] 2024-05-21 19:15:36,046 /home/run_pkg/latest/toolkit/tools/ascendc_tools/npu_kernel_launch/npu_kernel_launch --kernel /home/ascendebug_smoking_test/op_contrib/data/op-contrib/build_out/binary/${chip_version}/bin/foreach_sigmoid/ForeachSigmoid_0885a6586f8e7f8dc8d03c4dabc73ef4_high_performance.o --name ForeachSigmoid --json_file /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/data/ForeachSigmoid.json --input_path /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/data --output_path /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/npu/output --tiling_data /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/tiling/tiling_data_tiling_key_1_block_dim_1_workspace_33554432.bin --tiling_key 1 --workspace 33554432 --block_dim 1 --timeout 600 --device 0 --core_type VectorCore --arg_lib /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/npu/build/launch_args.so
    kernel name: ForeachSigmoid
    kernel file: /home/ascendebug_smoking_test/op_contrib/data/op-contrib/build_out/binary/${chip_version}/bin/foreach_sigmoid/ForeachSigmoid_0885a6586f8e7f8dc8d03c4dabc73ef4_high_performance.o
    json file: /home/ascendebug_smoking_test/op_contrib/api_opcontrib_case/ForeachSigmoid/data/ForeachSigmoid.json
    ......