flâneur — a map of the web's best reading

Counting FLOPS in PyTorch using CPU PMU counters | B. Nikolic Software and Computing Blog

bnikolic.co.uk · 561 words · saved by 1 readers

PyTorch has a useful third-party module THOP which calculates the number of floating point (multiply/accumulate) operations needed to make an inference from a PyTorch neural network model. Here I compare THOP estimates of FLOPs to measurements made using CPU Performance monitors in order to cross-validate both techniques.

PyTorch has a useful third-party module THOP which calculates the number of floating point (multiply/accumulate) operations needed to make an inference from a PyTorch neural network model. Here I compare THOP estimates of FLOPs to measurements made using CPU Performance monitors in order to cross-validate both techniques. THOP works by having a registry of simple functions that predict the number of FLOPs needed for each stage of neural networks. The registry is pre-populated with following neural network stages: nn . Conv1d nn . Conv2d nn . Conv3d nn . ConvTranspose1d nn . ConvTranspose2d nn

Explore this link on the map →

related reading