Performance Analysis of Deep Learning Models on Modern Hardware Accelerators: A Comparative Study of CPU, GPU, and TPU
Abstract
This paper presents a comprehensive empirical analysis of deep learning model performance across different hardware accelerators. Three distinct models, including a Custom Convolutional Neural Network for plant disease detection, a T5 Small language model fine-tuned on natural language inference, and EfficientNetB7 for image classification, are evaluated on CPU (Apple M1), GPU (NVIDIA T4 and P100), and TPU (v3-8) platforms. This study goes beyond model accuracy to systematically monitor and analyze system-level metrics including processor utilization, memory consumption, and epoch time. Using standardized datasets such as (CIFAR-10, Standford Natural Language Inference Corpus, and a plant disease dataset), we provide detailed insights into the hardware-software interactions that impact training performance. Our findings reveal distinct performance profiles: P100 GPUs demonstrated superior speed for T5 Small fine-tuning, followed by T4 GPUs, TPUs, and CPUs. Notably, TPUs encountered instability with smaller tasks, producing NaN values for EfficientNetB7 and Custom CNN models. This research highlights the importance of tailored data pipelines for TPUs and offers practical guidance for selecting appropriate hardware accelerators based on specific deep learning workloads and comprehensive performance metrics.