1 min readfrom Machine Learning

Profiling PyTorch training without accidentally stalling the GPU [D]

Profiling PyTorch training has an interesting measurement problem: the more you measure, the more you can change the behavior of the run itself.

A simple example is torch.cuda.synchronize(). It gives cleaner timing boundaries, but it also inserts synchronization points into an otherwise asynchronous CUDA workload.

An alternative is to use CUDA events around selected boundaries and read them later, so timing can be captured without forcing synchronization in the hot path. This does not replace PyTorch Profiler or Nsight, but it can work as a lightweight first pass before deeper operator-level profiling.

I wrote a short technical note about this while working on an open-source PyTorch training diagnostics tool:

https://medium.com/p/19adf1054bcf

submitted by /u/traceml-ai
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#rows.com
#enterprise-level spreadsheet solutions
#no-code spreadsheet solutions
#PyTorch
#profiling
#training
#GPU
#CUDA
#torch.cuda.synchronize()
#asynchronous
#synchronization
#timing
#CUDA events
#Nsight
#PyTorch Profiler
#operator-level profiling
#measurement problem
#performance tuning
#open-source
#diagnostics tool