-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
How do you use the new Pytorch Profiler with Ignite #1916
Comments
Never mind I see, I need to add an event to Event.EPOCH_STARTED with the following: profiler = torch.profiler.profile(
schedule=torch.profiler.schedule(
wait=2,
warmup=2,
active=6,
repeat=1),
on_trace_ready=tensorboard_trace_handler,
with_trace=True
) and then add to the update step: profiler.step() |
@ryanwongsa Thank you for your feedback about this new profiling tool. In your opinion, does it make sense to provide a specific handler for this as you did ? |
@sdesrozis Yeah so I did something like: profiler = None
def init_profiler(engine):
global profiler
profiler = torch.profiler.profile(
schedule=torch.profiler.schedule(
wait=2,
warmup=2,
active=6,
repeat=1),
on_trace_ready=torch.profiler.tensorboard_trace_handler(dir_name="profiler")
)
profiler_handler = trainer.add_event_handler(
Events.EPOCH_STARTED, init_profiler
) and added I think it works for now, but might not be the best solution using the global |
@ryanwongsa Thank you ! |
Would it make sense and isn't it possible to add the profiler to the I think you can do
And in the
But otherwise, I am surprised this works without entering a context? There seem to be some things happening in May also be necessary to have the The following might be a better solution (if it works, haven't tried):
|
cc @Priyansi for visibility and tutorials |
Does the |
@arisliang it would work if everything is inside |
@vfdev-5 thanks for the prompt reply! |
❓ Questions/Help/Support
Recently Pytorch announced a new profiling tool. Is there a way to use it with Ignite. The example code given in the blog post looks like:
But the issue is that we don't have access to the main for loop with Ignite. Is there an easy way to get it to work with ignite. I am assuming there should be a way using the event handlers (Event. EPOCH_STARTED) maybe?
The text was updated successfully, but these errors were encountered: