图编译统计信息导出功能
功能简介
在线或离线图编译过程中,提供编译过程中统计信息导出功能(当前包括图融合和UB融合信息,即fusion_result.json),实现程序异常退出时也能生成编译结果,方便用户进行问题定位和分析。
使用方法
该功能通过torchair.get_npu_backend中compiler_config配置,示例如下,参数介绍参见表1。
1 2 3 4 5 | import torch_npu, torchair config = torchair.CompilerConfig() # 图编译过程统计信息导出功能开关 config.ge_config.export_compile_stat = "2" npu_backend = torchair.get_npu_backend(compiler_config=config) |
产物说明
开启本功能后,如果图编译完成时执行中断,依然会有文件落盘,默认在当前脚本执行路径下生成fusion_result.json,内容示例参见产物说明。
父主题: DFX功能