Slide 1

Slide 1 text

ANALYZING MODEL PERFORMANCE USING TENSORFLOW PROFILER - Ashwin Phadke AI and Deep learning Engineer | Mentor | Trainer

Slide 2

Slide 2 text

FIRST UP CONSUL TANTS TENSORFLOW : INTROCUCTION AND BASICS We need some good libraries i.e. base code to do amazing operations of convolutions over image, videos etc. Developed by Google Brain team and released in 2015. Available as: • TensorFlow • TensorFlow Lite • TensorFlow JS • TensorRT (NVidia). The name TensorFlow derives from the operations that such neural networks perform on multidimensional data arrays, which are referred to as tensors. TensorFlow computations are expressed as stateful dataflow graphs. A familiar dataflow programming language example can be VHDL. You can do following : • Preprocessing • Building models. • Evaluate , test and deploy models to production. 2

Slide 3

Slide 3 text

FIRST UP CONSUL TANTS OVERVIEW OF TENSORFLOW AND IT’S FUNCTIONS Here we look at what some basic and common functions and operations mean while using TensorFlow Tensor : • A tensor is a vector or matrix of n-dimensions that represents all types of data. • Kind of np.arrays(). • They have identical data type and shape is the shape of the array. Graph : • In TensorFlow, all the operations are conducted inside a graph. The graph is a set of computation that takes place successively. Each operation is called an op node and are connected to each other. • The graph outlines the ops and connections between the nodes • All the computations in the graph are done by connecting tensors togetherA tensor has a node and an edge. • The node carries the mathematical operation and produces an endpoints outputs. • The edges explain the input/output relationships between nodes. 3 - Guru99

Slide 4

Slide 4 text

FIRST UP CONSUL TANTS EXAMPLE USAGE Here is an example of how a tensor is initialized and how various operations are done on the defined tensors 4 - TensorFlow documentation

Slide 5

Slide 5 text

FIRST UP CONSUL TANTS WHY PROFILE? Let’s check out why it is important for a ML workflow. • Performance is a key consideration for solutions. • Faster model training leads to faster iterations and reduced overhead. • To make a particular ML solution feasible. • However, it is not always clear what should be optimized. • Is there an issue with a specific operation (op), or the input pipeline? [TF Blog]

Slide 6

Slide 6 text

FIRST UP CONSUL TANTS TENSORFLOW PROFILER The TensorFlow Profiler (or the Profiler) provides a set of tools that you can use to measure the training performance and resource consumption of your TensorFlow models. This new version of the Profiler is integrated into TensorBoard, and builds upon existing capabilities such as the Trace Viewer. [TF Blog]

Slide 7

Slide 7 text

FIRST UP CONSUL TANTS HOW TO START ON THAT PROFILING

Slide 8

Slide 8 text

FIRST UP CONSUL TANTS WHAT YOU GET : Here’s an overview. CPU – GPU and TPU Overview Page • Provides a top-level view of model performance and recommendations to optimize it. Input Pipeline Analyzer • Analyzes your model’s data input pipeline for bottlenecks and recommends improvements to improve performance. TensorFlow Stats • Displays performance statistics for every TensorFlow operation executed during the profiling session. GPU Kernel Stats • Displays performance statistics and the originating operation for every GPU accelerated kernel.

Slide 9

Slide 9 text

FIRST UP CONSUL TANTS Insert or Drag & Drop your photo PROFILER

Slide 10

Slide 10 text

FIRST UP CONSUL TANTS STATS PAGE

Slide 11

Slide 11 text

FIRST UP CONSUL TANTS CHANGES IN PERFORMANCE FOR TYPE OF IMPROVEMENT USED. Reference :https://www.kdnuggets.com/2020/03/tensorflow-optimizing-training-time-performance.html

Slide 12

Slide 12 text

FIRST UP CONSUL TANTS SOME HANDS ON Alright! Get your laptops out and be quick. Colab Notebook: - Simple example - Tensorflow Profiler with Keras callback on a standard dataset. - Colab notebook 12

Slide 13

Slide 13 text

FIRST UP CONSUL TANTS 13 Machine Learning Deep Learning Computer Vision NLP Credits to all Github awesome lists makers

Slide 14

Slide 14 text

FIRST UP CONSUL TANTS REFERENCES : Here are references that helped me a lot and you should give it a try if I may suggest. • Deep Learning book : https://deeplearningbook.org, Goodfellow et.al * • Tensorflow Documentation. • TF dev summit TF profiler and TF data recordings on YouTube. • https://machinelearningmastery.com/ • Andrej Karpathy’s blog : http://karpathy.github.io/ • Coursera : Neural networks, Introduction to Tensorflow, Laurence Moroney • People to follow on LinkedIn : Dat Tran, Jason Mayes, Yogesh Kulkarni, Rahee Agate- Walambe, Usha Rangarajan, Laurence Moroney • PowerPoint Template : PowerPoint template store. • Google images and GIF search. 14

Slide 15

Slide 15 text

THANK YOU FIRST UP CONSUL TANTS 15