2603.00163 A Structural Analysis of the PyTorch Repository: From Python Frontend to C++ Kernel Execution
PyTorch is one of the most widely adopted open-source deep learning frameworks, yet its internal architecture spanning over 3 million lines of code across Python, C++, and CUDA remains insufficiently documented in a unified manner. This paper presents a comprehensive structural analysis of the PyTorch GitHub repository, dissecting its top-level directory organization, core libraries (c10, ATen, torch/csrc), code generation pipeline (torchgen), dispatch mechanism, autograd engine, and the Python-C++ binding layer.