output_path = './example.json'
input = torch.randn(2, 3).cuda()
with profile(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
with_stack=True,
schedule=torch.profiler.schedule(wait=0, warmup=0, active=2, repeat=2)
) as prof:
for i in range(10):
y = fn(input)
z = y + y
prof.step()
prof.export_chrome_trace(output_path)
DIPU ascend profiler对齐
Summary
将DIPU ascend profiler和torch profiler对齐
实现思路
测试
示例用法和结果