Moore Perf Compute 最佳实践
场景一:首次使用 - 性能分析初体验
问题: "我刚写了一个 MUSA kernel,想知道性能表现"
解决步骤:
# 1. 安装确认
which mcu
mcu --version
# 2. 简单分析
mcu ./my_program
# 3. 查看结果
mcu-ui
# File > Open File > report1.mcu-rep
预期结果: 生成 report1.mcu-rep,可在 GUI 中查看
场景二:只想分析特定的 Kernel
问题: "程序有上百个 kernel,只想分析其中一个"
解决步骤:
# 精确匹配
mcu -k matmul ./my_program
# 正则匹配
mcu -k regex:"matmul|relu" ./my_program
预期结果: 只分析指定 kernel,时间缩短,报告更小
场景三:多 GPU 环境分析
问题: "4 卡服务器,只想分析第 2 和第 4 张卡"
解决步骤:
mcu --devices 2,4 ./my_program
场景四:MPI 多进程应用分析
问题: "MPI 程序,多进程多节点,能分析吗?"
解决步骤:
# 单节点多 rank
mcu mpirun -np 4 ./my_mpi_program
# 多节点
mpirun -np 16 mcu ./my_mpi_program