Ascend Pytorch Profile显存可视化失败
收藏回复举报
Ascend Pytorch Profile显存可视化失败
t('forum.solved') 已解决
新人帖
发表于2026-01-20 08:51:51
0 查看

我在测试性能时想得到可视化的显存图,根据昇腾社区说明进行设置后遇到如下问题,已经排除了工具bug,也不是因为数据量太大导致的超时,还会是什么问题呢?有无大佬帮助提供一下思路,感谢

image.png

prof设置如下

# ========== 性能统计代码部分 ==========

experimental_config = torch_npu.profiler._ExperimentalConfig(

    export_type=[

        torch_npu.profiler.ExportType.Text,

        torch_npu.profiler.ExportType.Db

        ],

    profiler_level=torch_npu.profiler.ProfilerLevel.Level0,

    msprof_tx=False,

    aic_metrics=torch_npu.profiler.AiCMetrics.AiCoreNone,

    l2_cache=False,

    op_attr=False,

    data_simplification=False,

    record_op_args=False,

    gc_detect_threshold=None,

    host_sys=[

        torch_npu.profiler.HostSystem.CPU,

        torch_npu.profiler.HostSystem.MEM],

    sys_io=False,

    sys_interconnection=False

)

def trace_handler(prof: torch_npu.profiler.profile):

    prof.export_memory_timeline(output_path="/data/wenjie/msprof_out/memory_timeline.html", device=device)

prof = torch_npu.profiler.profile(

    activities=[

        torch_npu.profiler.ProfilerActivity.CPU,

        torch_npu.profiler.ProfilerActivity.NPU

        ],

    schedule=torch_npu.profiler.schedule(wait=0, warmup=0, active=1, repeat=1, skip_first=0),

    #on_trace_ready=torch_npu.profiler.tensorboard_trace_handler("./msprof_out"),

    on_trace_ready=trace_handler,#显存可视化

    record_shapes=True,

    profile_memory=True,

    with_stack=True,

    with_modules=True,

    with_flops=False,

    experimental_config=experimental_config)

# ========== 性能统计代码部分结束 ==========

……

prof.start()

……

prof.stop()

本帖最后由 匿名用户2026/01/20 11:15:27 编辑

我要发帖子