-
Notifications
You must be signed in to change notification settings - Fork 0
2023 01 25 Python Profiling
The standard library has deterministic profiling available via the cProfile and profile packages. These can be formatted using the pstats module, whilst the former (cProfile
) output can be visualised using Snakeviz.
The deep neural network framework TensorFlow which utilises both CPU and GPU processors has its own profiling tools available which are useful to identify bottlenecks and improve performance.
Because of the inter-play between CPU and GPU processing and scheduling between the two one very simple improvement in execution time of code can be obtained by using preprocessing so that the CPU prepares the next chunk of data for processing whilst the GPU is processing the current chunk. This shortens the length of a cycles and reduces the time either CPU or GPU are idle.