{"cells":[{"metadata":{},"cell_type":"markdown","source":"![](https://cdn.igromania.ru/mnt/news/2/1/c/a/c/d/89417/3a515960a4229c6a_1200xH.jpg)"},{"metadata":{},"cell_type":"markdown","source":"*It is said that if CPU is brain of a Computer then GPU is its soul. <br>\nGPU has been one of the greatest invention in the human history with extensive features most of them <br>\nare in high performance in gaming, high intensity graphics software, deep learning, rendering 3D \nanimations & video and much more.*"},{"metadata":{},"cell_type":"markdown","source":"## GPU Architecture"},{"metadata":{},"cell_type":"markdown","source":"Graphics card connect to the computer through the motherboard. The motherboard supplies power to the \ncard and lets it communicate with the CPU. Newer graphics cards often require more power than the motherboard\ncan provide, so they may have a direct connection to the computer's power supply.\nMost of computers with low prices have integrated GPUs where the graphics processing unit (GPU) is built onto\nthe same die as the CPU. A dedicated graphics card is a piece of hardware used to manage the graphics performance\nof a computer with upto thousands of cores. It has its own dedicated RAM, fan for cooling purpose and cache memory although less compared to CPU as it only helps in same repetitve tasks."},{"metadata":{},"cell_type":"markdown","source":"## What makes GPU special ??"},{"metadata":{},"cell_type":"markdown","source":"Looking at the architecture, CPU is composed of few core with heavy amount of cache memory that can handle few  \nsoftware threads simultaneously, While GPU concerns technology of parallel computing.\nEach GPUs core is simpler and runs at a lower frequency. Hence, their single - thread performance is much lower\nthan that of CPUs but when they work on the large scale and parallely to perform a task, tasks are successivly \nexecuted faster than CPU as they have multiple core and all the instructions are executing at a time the GPU architecture is suitable to finish the specific job much faster. Meanwhile in CPU each core is strong and considering high frequency its processing power is significant so a CPU core can execute a big instruction set but not too many times and also cannot perform execution of single task parallely. Hence these methods in GPU makes itself precise in its very own applications. As more sophisticated the GPU, the higher the resolution and the faster and smoother the motion in games and applications."},{"metadata":{},"cell_type":"markdown","source":"## Why not GPU instead of CPU ??"},{"metadata":{},"cell_type":"markdown","source":"In simple language GPU is very good at data-parallel computing while CPU is good at parallel processing.\nIt focuses on distributing the data across different nodes, which operate on the data in parallel.\nParallel computing is a type of computation in which many calculations or the execution of processes are \ncarried out simultaneously. Means GPU can execute one task at a time parallely with different cores, meanwhile \nCPU can execute task but keeping other processess parallel like keeping drivers, system softwares, output devices etc up to date. Hence, GPUs are not suited to handle tasks that do not significantly benefit from or cannot be parallelized, including many common consumer applications such as word processors or spreadsheets etc.<br>\n   As OS needs to look at 100s of different types of data and make various decisions which all depends on each other<br>\nand as GPU cannot perform this tasks single handedly we need CPU."},{"metadata":{},"cell_type":"markdown","source":"![](https://analyticsindiamag.com/wp-content/uploads/2019/01/gpu_2.jpg)"},{"metadata":{},"cell_type":"markdown","source":"##                                            GPU vs TPU"},{"metadata":{},"cell_type":"markdown","source":"GPU is a processor designed to accelerate the rendering of graphics and for parallel computing while TPU is \ndesigned to perform deep & machine learning's complex task by using tensorflow framework. GPU is general purpose processor while TPU is matrix processor. GPU can be used in 3D applications, photo editing, high level experience in gaming etc, while TPU is actually developed to help researches and developers in the era of cutting edge technology in AI & ML."},{"metadata":{},"cell_type":"markdown","source":"## TPU Architecture"},{"metadata":{},"cell_type":"markdown","source":"Each TPU version defines the specific hardware characteristics of a TPU device.<br> \nTPU v2 has upto 512 total TPU cores and 4 TiB of total memory & <br>\nTPU v3 has 2048 total TPU cores and 32 TiB of total memory. <br>\nEach TPU core has scalar, vector, and matrix units (MXU). <br>\nThe MXU provides the bulk of the compute power in a TPU chip. <br>\nEach MXU is capable of performing 16K multiply-accumulate operations in each cycle.<br>"},{"metadata":{},"cell_type":"markdown","source":"## What TPUs do"},{"metadata":{},"cell_type":"markdown","source":"TPU resources accelerate the performance of linear algebra computation by orgainizing multiplications and additions \nby doing matrix multiplication which is used heavily in deep learning as well machine learning applications.\nTPUs minimize the time-to-accuracy when you train large, complex neural network models.\nModels that previously took weeks to train on other hardware platforms can converge in hours on TPUs.\nTPUs can't run word processors or execute bank transactions, but they can handle the massive multiplications\nand additions for neural networks, at blazingly fast speeds while consuming much less power."},{"metadata":{},"cell_type":"markdown","source":"## References\nhttps://cloud.google.com/tpu/docs/system-architecture <br>\nhttps://www.quora.com/What-is-the-difference-between-CPU-and-a-GPU-for-parallel-computing <br>"}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}