The sketch explained
PyTorch: compute, differentiate, update
The forward pass produces a loss. Automatic differentiation computes gradients in reverse; the optimizer then uses them to change parameters.
On a small screen, scroll the diagram horizontally to read its labels.
- Input tensors
- Tensors contain the data used in this step.
- Model
- The model transforms inputs using its current parameters.
- Loss
- The loss function supplies the quantity to optimize.
- Gradients
- Autograd computes the required derivatives by traversing the graph backwards. The purple arrow represents this computation.
- Optimizer
- The optimizer applies the update rule; autograd does not update parameters itself.
UNDERSTANDING THE SYSTEM
PyTorch v2.14: from tensors to trainable systems
PyTorch connects tensor computation, gradients and optimization in a programmable environment. Version 2.14 expands compiler and communication capabilities, with hardware, shape and maturity constraints that need explicit validation.
An established release with features to qualify
The imported “PyTorch v2.14” record is preserved. This version is documented: both the general availability announcement and the 2.14.0 release tag date to September 2, 2026. This dossier therefore does not change 2.14 to 2.4 or attribute later developments to it. The November 4, 2026 review distinguishes the historical release from tutorial pages that have already moved to 2.15.
PyTorch is a computation and training framework, rather than a pretrained model or accelerator card. A program defines operations, differentiation computes gradients, and an optimizer updates parameters. Compilation and hardware libraries then determine how that work executes. Keeping these responsibilities separate helps diagnose a mathematical error before looking for a GPU kernel problem.
The developments below are reported for 2.14. They provide neither a universal speedup promise nor validation of every platform combination. Several interfaces are explicitly marked unstable, and the rewritten NCCL backend is a preview. An environment that runs eager code may still fail to meet compilation requirements.
| 2.14 development | Mechanism and limitation |
|---|---|
| NVGEMM and Inductor | Expanded epilogue fusion around matrix multiplications. Specific enablement and dependencies apply; NVFP4 paths require Blackwell. Announced as an unstable interface. |
| Declarative dynamic shapes | A specification describes variable dimensions across compilation, export and tracing. Shape constraints and recompilations still exist. |
| Rewritten NCCL communication | Preview with reconfiguration and remote-memory windows; this alone does not guarantee complete training recovery after failure. |
| Apple Silicon and complex numbers | Native linear algebra and further Metal migration; complex-tensor compilation is experimental and opt-in. Check operation coverage individually. |
| Python 3.15 | Announced support is eager-only in 2.14; compilation is not supported on this interpreter. |
A tensor defines computation and storage contracts
A tensor combines values with attributes: shape, numerical type, memory layout and device. A 32 × 128 matrix might represent 32 examples with 128 features; the program assigns those meanings to its axes. Two equally sized arrays are not interchangeable if their axes mean different things. Broadcasting can make an operation legal while concealing a modeling mistake.
Logical shape alone does not describe storage. A transpose can create a view sharing the same data with different strides, rather than an independent copy. Some operations require a particular layout and cause materialization. In a compute-intensive program, examining copies, conversions and transfers matters alongside counting multiplications.
For an illustrative calculation, 32 × 128 FP32 values occupy 16,384 bytes of raw data, or 16 KiB. This excludes Python objects, allocator reservations, gradients and optimizer states. It cannot establish total training memory. Having a GPU device also does not ensure every operation supports the requested numerical type on that device.
Forward computation, backpropagation and updates
During the forward pass, autograd records dependencies needed for derivatives when gradient tracking is enabled. Backpropagation applies the chain rule from the loss to the relevant parameters. It computes local sensitivities; it does not independently learn or choose an objective. An optimizer then consumes those gradients using a rule such as stochastic gradient descent, or SGD.
Consider one observation, prediction w × x, and squared loss L = (w × x − y)². With x = 2, y = 4 and w = 1, the prediction is 2 and the loss is 4. The derivative is 2 × x × (w × x − y) = −8. A learning rate of 0.1 updates w to 1.8, producing a new loss of 0.16. This exact calculation explains one step; it does not establish convergence in general.
Gradients accumulate by default. Clearing them before an independent step avoids accidentally summing several batches. Intentional accumulation instead requires consistent normalization. Out-of-domain operations, nondifferentiable conversions and in-place changes can invalidate the reasoning; a downward loss curve alone does not verify derivatives.
Illustrative scalar calculation matching the CPU example. Values are calculated, with no timing or benchmark.
- Forward pass: produce a loss
x = 2, y = 4, w = 1. The prediction is 2; L = (2 − 4)² = 4. Computation dependencies connect this loss back to w.
- Autograd: differentiate the loss
The chain rule gives dL/dw = 2 × 2 × (2 − 4) = −8. This gradient is a sensitivity, not yet an updated weight.
- SGD: update the weight
With η = 0.1: w ← 1 − 0.1 × (−8) = 1.8. The next forward pass produces 3.6 and a loss of 0.16.
Eager execution and compiled regions
In eager mode, Python drives operations as the program runs. This flexibility makes inspecting values and changing control flow straightforward. Compilation looks for computation regions a backend can transform, fuse and schedule. Inductor is the default backend of the compilation interface consulted. Compiling does not mean converting an arbitrary Python application into one GPU program.
A graph break separates compiled regions when a fragment cannot be captured. Guards check the assumptions under which compiled results can be reused; a change may trigger recompilation. Requiring a full graph turns an unsupported break into an error. This can help diagnosis, but does not prove the result will be faster.
Startup cost, the number of shape variants and the actual service lifetime determine whether compilation pays off. Measure startup separately from steady state, then verify outputs on identical inputs. In 2.14, declarative dynamic shapes simplify how the contract is expressed without making every Python path capturable. Short or highly variable regions may retain a better tradeoff in eager mode.
Logical diagram without a time scale. Returning to Python and recompiling are different events.
- Capture a region
Compatible operations form a region. A graph break returns control to Python before another region may start; it is not a boundary between two GPUs.
- Check guards
Shape, numerical type and other assumptions govern reuse. A new input may reuse an existing variant or require recompilation.
- Run generated kernels
The backend selects and fuses kernels within its constraints. Compare outputs and total cost with eager execution; the fusion shown is not a measured speedup.
Device, backend and practical portability
A device identifies where data resides; a backend is a software implementation for computation, compilation or communication. Those three backend meanings should be distinguished. An interface name does not always identify the hardware vendor: PyTorch’s HIP port notably reuses CUDA terminology for AMD GPUs.
Moving parameters and inputs does not automatically resolve unsupported types, operators or native extensions. Record a compatibility matrix covering PyTorch version, operating system, Python, driver, binary package and required libraries. A binary wheel package for a platform is not a promise that the entire operator catalog can be compiled on that platform.
| Target | Concrete validation point |
|---|---|
| CPU | Simple correctness baseline; fix thread counts and types when comparing runs. |
| NVIDIA GPU / CUDA | Check driver, installed package and extension compatibility; NVGEMM has additional prerequisites. |
| AMD GPU / ROCm | Check supported GPU and distribution; reused CUDA identifiers do not turn ROCm into NVIDIA CUDA. |
| Apple MPS / Intel XPU | Check operator and type coverage. A new capture or linear-algebra feature does not establish complete parity. |
Distributed work requires synchronization
Distributed Data Parallel, DDP, replicates a model across processes: each rank handles its data, then gradients are synchronized to support consistent updates. The application must partition examples and launch processes correctly. Adding replicas does not combine their memory into one space that automatically fits a larger model.
The figure assumes two equal-sized batches, mean losses and initially identical replicas. Local gradients of 2 and 6 average to 4, allowing the same update on both ranks. With different sizes or normalization, this simple average may no longer represent the intended global objective. Parameter-sharding approaches address a different memory problem from this replication.
The communication backend must match the devices and installed build: the documentation recommends Gloo for CPU, NCCL for CUDA GPUs and XCCL for XPU GPUs. Network configuration, collective ordering and hang diagnostics also need validation. Reconfiguration introduced in 2.14 does not by itself restore data position, optimizer states or application progress after failure.
Arithmetic example with two ranks, equal batches and mean loss. No physical topology or measured traffic is depicted.
- Each rank computes
Both replicas start from w = 1. Rank 0 obtains g₀ = 2 and rank 1 obtains g₁ = 6 on distinct batches of equal size.
- A collective aggregates
Reduction and normalization produce g = (2 + 6) / 2 = 4 on each rank. Processes must participate in compatible collectives.
- Each optimizer applies
With the same rate η = 0.1 and identical states: w ← 1 − 0.1 × 4 = 0.6 on both replicas. Their local data remains distinct.
A CPU step that can be checked by hand
The example uses a bias-free linear model, one observation and fixed initial values. FP64 makes the assertions comfortable without claiming improved model accuracy. It installs nothing, downloads no weights and uses no accelerator. It is documentary code for a compatible PyTorch environment; it was not executed during this work.
Evaluation mode and disabling gradient tracking address different needs. The former changes modules such as Dropout and BatchNorm; the latter avoids recording computations for derivatives. Inference mode is more restrictive than simply disabling gradients, and its tensors cannot be arbitrarily reused in autograd-recorded computations. Neither mode performs a parameter update.
The linear module here uses the same formula in evaluation mode. Both calls are nevertheless shown to preserve the distinction in responsibilities. Check the gradient before the step and the prediction after it: checking only the final loss could hide sign or initialization errors.
import torch
from torch import nn
x = torch.tensor([[2.0]], dtype=torch.float64, device="cpu")
target = torch.tensor([[4.0]], dtype=torch.float64, device="cpu")
model = nn.Linear(1, 1, bias=False, dtype=torch.float64, device="cpu")
with torch.no_grad():
model.weight.fill_(1.0)
optimizer = torch.optim.SGD(model.parameters(), lr=0.1)
model.train()
optimizer.zero_grad(set_to_none=True)
loss = (model(x) - target).square().mean()
loss.backward()
torch.testing.assert_close(model.weight.grad, torch.tensor([[-8.0]], dtype=torch.float64))
optimizer.step()
model.eval()
with torch.inference_mode():
prediction = model(x)
final_loss = (prediction - target).square().mean()
torch.testing.assert_close(prediction, torch.tensor([[3.6]], dtype=torch.float64))
torch.testing.assert_close(final_loss, torch.tensor(0.16, dtype=torch.float64))Save weights, resume training and deliver a model
A module state dictionary maps names to parameters and persistent buffers. It does not by itself contain the model definition or preprocessing. The following fragment saves the preceding example’s weights in memory and loads them into an identical architecture. Restricted loading is requested explicitly; it reduces the code-execution attack surface without making an arbitrary file harmless.
A training-resume checkpoint must also preserve the required optimizer, scheduler, random-generator and data-progress states, depending on the system. A weights dictionary alone restores values, rather than necessarily restoring the same learning trajectory. In a distributed system, consistency of the saved point across ranks belongs to the protocol.
A deployment artifact adds input and output contracts, data transformations, dependencies and possibly an exported or compiled program for a particular runtime. Exporting is more than renaming a checkpoint: shapes, operators and outputs need testing on the target. Also distinguish a recovery checkpoint from activation checkpointing, which recomputes activations to save memory during training.
import io
buffer = io.BytesIO()
torch.save(model.state_dict(), buffer)
buffer.seek(0)
state = torch.load(buffer, map_location="cpu", weights_only=True)
restored = nn.Linear(1, 1, bias=False, dtype=torch.float64, device="cpu")
restored.load_state_dict(state)
restored.eval()
with torch.inference_mode():
torch.testing.assert_close(restored(x), prediction)Qualify a workload before expanding its use
PyTorch fits teams that need control over computation, losses, gradients and specialized libraries. A hosted model API addresses a different need and delegates more of the system. JAX, TensorFlow and dedicated inference runtimes are alternatives to compare against the actual program and deployment, rather than an overall ranking without a workload.
For a 2.14 migration, record an eager baseline, numerical tolerances, the shape distribution, types and placement. Then test compilation and targeted libraries, separating first call, steady state, transfers and memory consumption. High throughput on a fixed batch predicts neither variable-request latency nor total distributed training time.
The 2.14 release notes also flag gradient changes at nondifferentiable boundaries and contract changes for some custom process groups. Replay edge cases and test real restoration before migrating. The final decision should retain a reproducible path, rollback strategy and model-specific acceptance criteria; a version number or new compilation option cannot replace that evidence.
- Correctness
- Outputs, gradients and tolerances on representative inputs, including boundaries and unusual shapes.
- Operations
- Startup time, peak memory, unsupported operators, collective diagnostics and state restoration.
- Reproducibility
- Keep version, environment, data, configuration and weight provenance alongside results.
ORIGINAL DOCUMENT
Catalog record
2. Low-level software, compilers and training frameworks
PyTorch pytorch.org v2.14 — Innovation: 9, Adoption: 10
Editorial source: Taxonomie des Technologies d'Intelligence Artificielle · § 5770. Addresses restored with dots; innovation and adoption scores remain those of the document.
VERIFY AND EXPLORE
References
This dossier covers version 2.14, announced on September 2, 2026. The release notes and 2.14 documentation establish that scope; the saving tutorial consulted already displays 2.15. No locally measured performance or executed PyTorch experiment is claimed.
- 01PyTorch 2.14.0 general availability
Confirms the September 2, 2026 release and announced binaries; no package was installed.
dev-discuss.pytorch.org · - 02PyTorch 2.14 technical announcement
Announced features and maturity; NVGEMM prerequisites, Python 3.15 limitations and NCCL preview. No local speedup reproduction.
pytorch.org · - 03PyTorch 2.14.0 release notes
Contracts and behavior changes, particularly boundary gradients and custom groups.
github.com · - 04Tensor attributes, 2.14 documentation
Types, devices and memory layouts; 16 KiB is an editorial calculation.
docs.pytorch.org · - 05Autograd mechanics, 2.14 documentation
Operation recording and differentiation; separates gradients, modes and mathematical domains.
docs.pytorch.org · - 06Optimizers, 2.14 documentation
Gradient clearing and update responsibilities; example values are derived by hand.
docs.pytorch.org · - 07Compilation interface, 2.14 documentation
Regions, guards, recompilation and the full-graph requirement. No universal acceleration inferred.
docs.pytorch.org · - 08HIP / ROCm semantics, 2.14 documentation
Explains the HIP port’s reuse of CUDA interfaces; does not establish general binary compatibility.
docs.pytorch.org · - 09Distributed communication, 2.14 documentation
Collectives, processes, backend selection and operational constraints.
docs.pytorch.org · - 10Distributed Data Parallel principles
DDP principle; the page warns that its design details describe version 1.4. They are not presented as 2.14 developments.
docs.pytorch.org · - 11Modules and evaluation mode, 2.14 documentation
Evaluation-mode effects on affected modules and module state dictionaries.
docs.pytorch.org · - 12Inference mode, 2.14 documentation
Does not automatically set evaluation mode; adds restrictions beyond simply disabling gradients.
docs.pytorch.org · - 13Serialization and restricted loading, 2.14 documentation
Restricted state-dictionary loading and security limitations; the option is not treated as a sandbox.
docs.pytorch.org · - 14Saving and loading: current tutorial
Consulted page displays 2.15; used only for the weights-versus-resume-checkpoint distinction, cross-checked against 2.14 documents.
docs.pytorch.org ·
Catalog provenance
Taxonomie des Technologies d'Intelligence Artificielle · Google DocsSource document consulted on . § 5770.
Websites cited in the record
A website’s inclusion in the catalog does not verify the versions, projections or results mentioned in the document.
FROM KNOWLEDGE TO PROJECT
Apply this knowledge to your context.
Scope, architecture, roadmap and notes: keep your decisions in the dedicated space.


