PyTorch
by PyTorch Foundation (Linux Foundation) · Framework · also known as torch, LibTorch
Open-source deep-learning framework with eager tensors, autograd, torch.compile and distributed training, governed by the PyTorch Foundation and the base of most LLM tooling
Overview
PyTorch is the BSD-3-Clause deep-learning framework originally developed at Facebook AI Research and governed since 2022 by the PyTorch Foundation under the Linux Foundation. It provides GPU-accelerated tensors with automatic differentiation, an eager execution model that behaves like ordinary Python, torch.compile for graph capture and kernel fusion, torch.distributed for data, tensor and pipeline parallelism, and a LibTorch C++ distribution. Backends include CUDA, ROCm, MPS on Apple Silicon and CPU, and the stable release requires Python 3.10 or later.
Most of the modern LLM stack is built on it: Hugging Face Transformers defines models in PyTorch, vLLM, Unsloth and Axolotl run on it, and Whisper and Sentence Transformers depend on it. The ecosystem adds torchvision, torchaudio, PyTorch Lightning, TorchServe, ExecuTorch for on-device deployment and a landscape of foundation-hosted projects. For researchers it is the default choice because papers and reference implementations target it. Caveats: wheels are large and tied to specific CUDA versions, MPS on Macs lags CUDA in operator coverage and performance, and major releases occasionally deprecate APIs that downstream libraries depend on.
Capabilities
- GPU tensors with automatic differentiation
- Eager execution plus torch.compile
- Distributed training (DDP, FSDP, tensor and pipeline parallel)
- CUDA, ROCm, MPS (Apple Silicon) and CPU backends
- LibTorch C++ API and ExecuTorch for edge
- Large ecosystem: torchvision, torchaudio, Lightning, TorchServe
Typical workflows
- Prototype a model in a notebook and scale it with FSDP
- Run Transformers models on an Apple Silicon Mac via MPS
- Export a trained model for serving or on-device inference
Strengths
- Default framework for research code and LLM libraries
- Vendor-neutral foundation governance
- Permissive BSD license
Limitations
- Large, CUDA-version-specific wheels
- MPS backend less complete than CUDA
- API deprecations across major versions
Prerequisites
- Python 3.10+; CUDA or ROCm drivers for GPU use
Who it is for
- ML researchers and students
- Engineers building training and inference systems
Alternatives & comparison
- Axolotl
YAML-configured open-source framework for fine-tuning and post-training LLMs: full, LoRA and QLoRA training, preference and RL methods, multimodal models and multi-GPU or multi-node runs
Open sourceOpen source - Core ML
Apple's on-device machine-learning runtime for iOS and macOS apps, with the open-source coremltools package for converting PyTorch and other models to its format
MixedFree - Create ML
Apple's app and Swift framework for training image, text, sound, tabular and activity models on a Mac without writing training code, exporting directly to Core ML
ProprietaryFree - JAX
Python library for NumPy-style array computing with composable transformations (jit, grad, vmap, shard_map) compiled through XLA to CPU, GPU and TPU
Open sourceOpen source - Metal
Apple's low-level GPU programming framework for graphics and parallel compute on iOS, macOS and visionOS, the layer beneath MLX, Core ML and most Apple Silicon ML runtimes
ProprietaryFree - MLX
Apple's open-source array framework for machine learning on Apple Silicon, with NumPy-like Python, C++ and Swift APIs and unified CPU/GPU memory
Open sourceOpen source - NumPy
Foundational Python library for n-dimensional arrays, vectorized math, linear algebra, random numbers and the array API used by the scientific stack
Open sourceOpen source - scikit-learn
BSD-licensed Python machine-learning library for classification, regression, clustering, dimensionality reduction, preprocessing and model selection on NumPy and SciPy
Open sourceFree - Transformers
Hugging Face's model-definition library for text, vision, audio, video and multimodal models, with Pipeline, Trainer and generate APIs used as the reference by training and inference engines
Open sourceOpen source - Unsloth
Open-source framework for fine-tuning and running LLMs with reduced memory, covering LoRA, QLoRA, full fine-tuning and RL, GGUF export, Dynamic quantizations and a local Studio/Desktop UI
Open sourceOpen source
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensehttps://github.com/pytorch/pytorch/blob/main/LICENSEchecked Nov 1, 2026
Supports: license_spdx, source_model
Three-clause BSD text with multiple copyright holders
- Official documentationchecked Nov 1, 2026
- Official sitechecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Broken · Nov 2, 2026
Spotted an error?
More in Training & fine-tuning
MLX LM
Apple Inc. · Apple Silicon ML & MLX
Python package and CLI for running, serving, quantizing and fine-tuning large language models on Apple Silicon with MLX
Ray
Ray project (Anyscale and contributors) · Distributed & parallel computing
Open-source Python framework for distributing tasks, actors and ML workloads across a cluster, with libraries for data processing, training, tuning, serving and reinforcement learning
Hugging Face Hub
Hugging Face · Training & fine-tuning
Hosting platform for open models, datasets and Spaces demo apps built on git repositories and Xet storage, with Inference Providers, Endpoints, Jobs and an open-source Python client and CLI
scikit-learn
scikit-learn developers · Mathematical & statistical computing
BSD-licensed Python machine-learning library for classification, regression, clustering, dimensionality reduction, preprocessing and model selection on NumPy and SciPy
Sentence Transformers
Hugging Face · Embeddings, reranking & retrieval
Python library for computing and training embedding, cross-encoder reranker, sparse and multi-vector retrieval models, maintained by Hugging Face with thousands of pretrained models on the Hub
Unsloth
Unsloth AI · Training & fine-tuning
Open-source framework for fine-tuning and running LLMs with reduced memory, covering LoRA, QLoRA, full fine-tuning and RL, GGUF export, Dynamic quantizations and a local Studio/Desktop UI