How do you use the new Pytorch Profiler with Ignite
See original GitHub issue❓ 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:
with torch.profiler.profile(
schedule=torch.profiler.schedule(
wait=2,
warmup=2,
active=6,
repeat=1),
on_trace_ready=tensorboard_trace_handler,
with_trace=True
) as profiler:
for step, data in enumerate(trainloader, 0):
print("step:{}".format(step))
inputs, labels = data[0].to(device=device), data[1].to(device=device)
outputs = model(inputs)
loss = criterion(outputs, labels)
optimizer.zero_grad()
loss.backward()
optimizer.step()
profiler.step()
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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
BasicTimeProfiler — PyTorch-Ignite v0.4.10 Documentation
High-level library to help with training and evaluating neural networks in PyTorch flexibly and transparently.
Read more >How-to Guides - PyTorch-Ignite
Install PyTorch-Ignite from pip, conda, source or use pre-built docker images ... using Engine's State, BasicTimeProfiler and HandlersTimeProfiler.
Read more >What is the new PyTorch profiler? - eduCBA
The Profiler makes use of a new GPU profiling engine that is based on Nvidia CUPTI APIs and can record GPU kernel activities...
Read more >PROFILING AND OPTIMIZING PYTORCH APPLICATIONS ...
PyTorch Profiler is a tool that allows the collection of the performance metrics during the ... The Profiler's context API can be used...
Read more >pytorch-ignite - PyPI
A lightweight library to help with training neural networks in PyTorch. ... Library approach and no program's control inversion - Use ignite where...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Never mind I see, I need to add an event to Event.EPOCH_STARTED with the following:
and then add to the update step:
@vfdev-5 thanks for the prompt reply!