Created
September 14, 2023 00:07
-
-
Save davidberard98/a9711961a78f50b1b0eff530322848df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
def fn(x, y): | |
return torch.cat([x + y, y]).sin() | |
a = torch.ones((1024, 256), dtype=torch.float32) | |
b = torch.ones((1024, 256), dtype=torch.float32) * 2 | |
with torch.profiler.profile(schedule=torch.profiler.schedule(wait=2, warmup=2, repeat=1, active=2), record_shapes=True) as prof: | |
for _ in range(8): | |
fn(a, b) | |
prof.step() | |
prof.export_chrome_trace("/home/dberard/matmul_prof.json") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment