Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiler采集的数据还存在问题 #10543

Open
18liumin opened this issue Jul 9, 2024 · 0 comments
Open

profiler采集的数据还存在问题 #10543

18liumin opened this issue Jul 9, 2024 · 0 comments
Labels
bug community events from community

Comments

@18liumin
Copy link

18liumin commented Jul 9, 2024

import time
use_oneflow =True

import oneflow as torch

import torch

name = "oneflow" if use_oneflow else "pytorch"
device = torch.device('cuda:0')
time_data_to_device = []

with torch.profiler.profile(
activities=[torch.profiler.ProfilerActivity.CPU, torch.profiler.ProfilerActivity.CUDA]
) as p:
for i in range(8):
x = torch.rand((1024, 32,32,16))
y = torch.rand((1024,))
start = time.perf_counter()
x = x.to(device)
y = y.to(device)
time_data_to_device.append((time.perf_counter() - start) * 1000.0)

print(name, time_data_to_device)
print(p.key_averages().table())

image

image

@18liumin 18liumin added bug community events from community labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community events from community
Projects
None yet
Development

No branches or pull requests

1 participant