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

rpdTraceControl as a context manager, callable in a loop #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpvillam-amd
Copy link

@jpvillam-amd jpvillam-amd commented Apr 12, 2024

The goal is to allow something like:

import torch
from rpdTracerControl import rpdTracerControl

for step in [1,2,3]:
    trace_file_name = f"{step}_torch.rpd"
    print(f"in {step}!!")
    with rpdTracerControl(trace_file_name, nvtx=True) as p:
        a =torch.rand(step).cuda()
        torch.add(a, 20)
    p.top_totals()
  • Make rpdTracerControl into a standalone context manager similar to the functionality of torch.profile
  • Make it all callable in a loop, regardless of the static nature of the library

@jpvillam-amd jpvillam-amd self-assigned this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant