DeepLink-org / deeplink.framework

BSD 3-Clause "New" or "Revised" License
55 stars 28 forks source link

[Feature] Align ascend profiler with torch profiler #895

Closed DoorKickers closed 1 month ago

DoorKickers commented 1 month ago

DIPU ascend profiler对齐

Summary

将DIPU ascend profiler和torch profiler对齐

实现思路

测试

示例用法和结果

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)

image

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.