PyTorch Geometric (PyG) is the leading library for building and training Graph Neural Networks in PyTorch. It implements a huge range of published GNN architectures, from GCN and GAT to modern scalable and heterogeneous graph models, behind a unified, tensor-centric API that feels like vanilla PyTorch. With more than 24,000 stars on GitHub and thousands of forks, PyG is the default starting point for deep learning on graphs, molecules, meshes and other structured data.
Graph data does not fit the regular grids that standard deep learning tools expect. PyG solves this with an efficient message-passing engine, specialized storage and sampling components for graphs with millions of nodes, and loaders for many small graphs or single giant ones. It includes a large library of common benchmark datasets with simple interfaces for adding your own, transforms for graphs, 3D meshes and point clouds, and support for multi-GPU training and torch.compile. Most state-of-the-art GNN layers are implemented and ready to use, and the message-passing interface makes it straightforward to define custom layers, which is why PyG is used both for production graph applications and for research prototyping.
PyTorch Geometric is free and open source under the MIT license. There is no paid version; the library is maintained by the PyG team and community for use in research and production alike.
PyTorch Geometric is for machine learning researchers and engineers working with graph-structured data, including recommender systems, fraud detection, molecular property prediction, knowledge graphs and social network analysis.