PyTorch 2.14.0 Release
PyTorch 2.14.0 Release Notes
- Highlights
- Backwards Incompatible Changes
- Deprecations
- New Features
- Improvements
- Bug fixes
- Performance
- Documentation
- Security
- Developers
Highlights
For more details about these highlighted features, you can look at the release blogpost. Below are the full release notes for this release.
Backwards Incompatible Changes
torch.nn
-
torch.nn.LinearCrossEntropyOptionsno longer acceptsacc_policy="balanced"; use"compact"instead (#188283)The
"balanced"policy was removed because"compact"provides the same weight-gradient accumulation precision with lower memory use on CUDA, already uses the equivalent scratch layout for mixed-precision inputs on other devices, and was never selected by"auto". Constructing the options withacc_policy="balanced"now raisesValueError: invalid acc_policy: 'balanced'; expected one of 'auto', 'accurate', 'compact'.Before:
options = torch.nn.LinearCrossEntropyOptions(acc_policy="balanced") loss = torch.nn.functional.linear_cross_entropy( input, linear_weight, target, options=options )After:
options = torch.nn.LinearCrossEntropyOptions(acc_policy="compact") loss = torch.nn.functional.linear_cross_entropy( input, linear_weight, target, options=options )
Autograd
-
Clamp and min/max boundary subgradients now follow the selected dispatcher schema's input space (#191142)
This affects gradients exactly at nondifferentiable bounds or ties. A scalar clamp bound is a fixed parameter, so the input gradient at equality changes from
1to the minimum-norm subgradient0. A Tensor bound is part of the differentiable input space, soclamp,clamp_min, andclamp_maxnow split the gradient evenly between the input and bound at an ordinary tie instead of assigning it entirely to the input.fminandfmaxuse the same even tie split, and forward-mode AD for the min/max family is aligned with these rules. Code that intentionally depends on the old tie-breaking behavior can express it explicitly withtorch.where, such astorch.where(value >= bound, value, bound).Version 2.13:
import torch x = torch.tensor(0.0, requires_grad=True) torch.clamp_min(x, 0.0).backward() print(x.grad) # tensor(1.) value = torch.tensor(0.0, requires_grad=True) bound = torch.tensor(0.0, requires_grad=True) torch.clamp_min(value, bound).backward() print(value.grad, bound.grad) # tensor(1.) tensor(0.)Version 2.14:
import torch x = torch.tensor(0.0, requires_grad=True) torch.clamp_min(x, 0.0).backward() print(x.grad) # tensor(0.) value = torch.tensor(0.0, requires_grad=True) bound = torch.tensor(0.0, requires_grad=True) torch.clamp_min(value, bound).backward() print(value.grad, bound.grad) # tensor(0.5000) tensor(0.5000)
Distributed
-
Custom Python process groups that implement
new_group()must now accept abackendkeyword argument (#188489)This applies when the default process group supplies its own
new_group()method andtorch.distributed.new_group()delegates subgroup creation to it. PyTorch now forwards the resolved backend so custom implementations can construct the requested subgroup correctly. Existing implementations without this parameter will raiseTypeError: ... got an unexpected keyword argument 'backend'. Accept and use the argument, or accept and ignore it when the implementation has only one backend.Before:
class MyProcessGroup(...): def new_group( self, ranks, *, timeout=None, pg_options=None, group_name=None, group_desc=None ): ...After:
class MyProcessGroup(...): def new_group( self, ranks, *, timeout=None, backend=None, pg_options=None, group_name=None, group_desc=None ): ... -
NCCL symmetric-memory pools no longer automatically upgrade segments allocated after
register_mem_pool(..., symm=True)to symmetric windows (#192112)Registering those late segments from the CUDA allocator callback could invoke a collective NCCL operation on only some ranks while holding the allocator lock, causing an unrecoverable hang. Late segments now remain ordinary registered NCCL buffers. Applications that need newly allocated segments to use symmetric-window algorithms must collectively deregister and register the pool again after those allocations are created.
Before:
backend.register_mem_pool(pool, symm=True) with torch.cuda.use_mem_pool(pool): tensor = torch.empty(size, device="cuda") # Newly allocated segments were automatically upgraded, but this could hang.After:
backend.register_mem_pool(pool, symm=True) with torch.cuda.use_mem_pool(pool): tensor = torch.empty(size, device="cuda") # Collectively refresh registration after the pool grows. backend.deregister_mem_pool(pool) backend.register_mem_pool(pool, symm=True) -
Nonmember ranks now receive
GroupMember.NON_GROUP_MEMBERinstead ofNonefrom experimentaltorch.distributed.split_group()(#190725)When the calling rank is absent from every requested split,
split_group()now returns the same nonmember sentinel asnew_group(). Code that identifies nonmembers withis Nonemust compare againsttorch.distributed.GroupMember.NON_GROUP_MEMBERinstead.Before:
group = torch.distributed.split_group( split_ranks=[[0, 1], [2, 3]] ) if group is None: returnAfter:
group = torch.distributed.split_group( split_ranks=[[0, 1], [2, 3]] ) if group == torch.distributed.GroupMember.NON_GROUP_MEMBER: return
Linear Algebra Frontend
-
Remove the deprecated
torch.cholesky()andTensor.cholesky()APIs (#186817)Calls now raise a
RuntimeErrordirecting users totorch.linalg.cholesky(). The replacement returns a lower-triangular factor; callers that previously requestedupper=Trueshould take the conjugate transpose with.mH.Version 2.13:
lower = torch.cholesky(a) upper = torch.cholesky(a, upper=True)Version 2.14:
lower = torch.linalg.cholesky(a) upper = torch.linalg.cholesky(a).mH -
Remove the deprecated
torch.qr()andTensor.qr()APIs (#186815)Calls now raise a
RuntimeErrordirecting users totorch.linalg.qr(). Replace the Booleansomeargument withmode="reduced"ormode="complete".Version 2.13:
q, r = torch.qr(a) q_full, r_full = torch.qr(a, some=False)Version 2.14:
q, r = torch.linalg.qr(a, mode="reduced") q_full, r_full = torch.linalg.qr(a, mode="complete")
Profiler
-
The deprecated
use_cudaargument has been removed fromtorch.profiler.profileandtorch.autograd.profiler.profile(#192543)Passing
use_cudato either profiler now raisesTypeError: profile.__init__() got an unexpected keyword argument 'use_cuda'. Select CUDA explicitly throughactivitieswhen usingtorch.profiler.profile, or useuse_device="cuda"withtorch.autograd.profiler.profile.Version 2.13:
with torch.profiler.profile(use_cuda=True) as prof: run_workload() with torch.autograd.profiler.profile(use_cuda=True) as prof: run_workload()Version 2.14:
with torch.profiler.profile( activities=[ torch.profiler.ProfilerActivity.CPU, torch.profiler.ProfilerActivity.CUDA, ] ) as prof: run_workload() with torch.autograd.profiler.profile(use_device="cuda") as prof: run_workload()
Dynamo
-
The
tvmbackend now uses TVM's relax frontend exclusively; the relay path has been removed (#190766, #189639)Relay was removed in TVM 0.20, so the backend now requires a TVM providing
tvm.relax.frontend.torch. Two things are gone with it: the relay-onlyscheduler/trialsoptions, replaced by a TVM pipeline passed asoptions={"pipeline": ...}; and thetvm_meta_schedule/tvm_auto_schedulerbackend entry points, which no longer exist intorch._dynamo.backends.tvm. With an older TVM installed,torch.compile(..., backend="tvm")now raisesImportError: Please install apache-tvm to use the tvm backend.Version 2.13:
opt = torch.compile(model, backend="tvm", options={"scheduler": "meta_schedule", "trials": 20000}) # or through the relay-only entry points from torch._dynamo.backends.tvm import tvm_meta_schedule, tvm_auto_schedulerVersion 2.14:
import tvm pipeline = tvm.relax.get_pipeline("static_shape_tuning", target="llvm", total_trials=2000) opt = torch.compile(model, backend="tvm", options={"pipeline": pipeline}) # tvm_meta_schedule / tvm_auto_scheduler no longer exist: # ImportError: cannot import name 'tvm_meta_schedule'
C++ Frontend
-
Remove the deprecated zero-argument C++ overloads
c10::Scalar::isIntegral()andc10::isIntegralType(ScalarType)(#187115)Code that calls either overload without specifying whether Boolean values count as integral will no longer compile. Pass
includeBoolexplicitly; usefalseto preserve the removed overloads' behavior.Version 2.13:
bool scalar_is_integer = scalar.isIntegral(); bool dtype_is_integer = c10::isIntegralType(dtype);Version 2.14:
bool scalar_is_integer = scalar.isIntegral(/*includeBool=*/false); bool dtype_is_integer = c10::isIntegralType(dtype, /*includeBool=*/false);
Release Engineering
-
setup.pyis now a deprecation shim; build PyTorch through pip orpython -m build(#180248)setup.pyis now a thin shim.installanddevelopstill forward to pip, butbuild,bdist_wheel,clean,sdistand the rest print the replacement command instead of falling through to setuptools. Builds that already go through a PEP 517 frontend are unaffected, since pip andpython -m buildnever ransetup.py. The shim prints the schedule:install/developkeep forwarding through 2.15, every command stops working in 2.16, andsetup.pyis removed in 2.18.Version 2.13:
python setup.py bdist_wheelVersion 2.14:
python -m build --wheel --no-isolation
MPS
-
The C++ MPS macOS-version helper and its enum members have been renamed (#188645)
Downstream C++ code that includes
<ATen/mps/MPSDevice.h>must replace the exportedat::mps::is_macos_13_or_newer()function withat::mps::is_macos_at_least(). The associatedMacOSVersionmembers also drop theVERandPLUSportions of their names. No compatibility aliases are provided, so code using the old names will no longer compile.Version 2.13:
const bool supported = at::mps::is_macos_13_or_newer( at::mps::MacOSVersion::MACOS_VER_15_0_PLUS);Version 2.14:
const bool supported = at::mps::is_macos_at_least( at::mps::MacOSVersion::MACOS_15_0);
Complex Frontend
-
Complex type promotion for
bfloat16now uses the newtorch.bcomplex32shell dtype instead oftorch.complex64(#186928)torch.bcomplex32stores real and imaginary components asbfloat16. Operations that combine abfloat16tensor with a complex scalar or otherwise request its corresponding complex type can therefore producebcomplex32instead ofcomplex64. Becausebcomplex32is a shell dtype with limited operator support, an operation that previously ran incomplex64may now raise a not-implemented error. Explicitly cast tocomplex64when the previous precision or operator coverage is required.Version 2.13:
x = torch.ones(4, dtype=torch.bfloat16) assert torch.result_type(x, 1j) == torch.complex64Version 2.14:
x = torch.ones(4, dtype=torch.bfloat16) assert torch.result_type(x, 1j) == torch.bcomplex32 # Preserve the previous complex64 behavior explicitly. y = x.to(torch.complex64) + 1j
Deprecations
Autograd
-
Selective activation checkpointing will change to honor surrounding
saved_tensors_hooksby default; use the newrespect_saved_tensors_hooksargument to choose the behavior explicitly (#190581)The current default,
None, preserves the legacy behavior in which tensors retained by selective activation checkpointing bypass user hooks, but now emits aFutureWarningwhen hooks are active. PassTrueto opt into the future behavior orFalseto preserve the legacy behavior without a warning. This option requiresuse_reentrant=False.Before:
with torch.autograd.graph.saved_tensors_hooks(pack, unpack): output = torch.utils.checkpoint.checkpoint( function, input, use_reentrant=False, context_fn=sac_context_fn, )After:
with torch.autograd.graph.saved_tensors_hooks(pack, unpack): output = torch.utils.checkpoint.checkpoint( function, input, use_reentrant=False, context_fn=sac_context_fn, respect_saved_tensors_hooks=True, )
Distributed
-
Use
torch.compiler.config.compile_on_one_rankinstead oftorch.distributed.config.compile_on_one_rank(#187869)The distributed spelling remains as a forwarding alias but now emits a
FutureWarning. The preferred environment variable is alsoTORCH_COMPILE_ON_ONE_RANK; the olderTORCH_DISTRIBUTED_COMPILE_ON_ONE_RANKremains supported for compatibility.Before:
import torch.distributed.config torch.distributed.config.compile_on_one_rank = TrueAfter:
import torch.compiler.config torch.compiler.config.compile_on_one_rank = True
Profiler
-
The experimental
profiler_metricsandprofiler_measure_per_kerneloptions no longer enable CUPTI range profiling and now emit aFutureWarningwhen set to a non-default value (#187204)Kineto no longer supports this range-profiler path on PyTorch's supported CUDA versions. The arguments remain accepted temporarily for compatibility, but they are ignored and have no direct replacement.
Before:
config = torch.profiler._ExperimentalConfig( profiler_metrics=["sm__cycles_elapsed.avg"], profiler_measure_per_kernel=True, )After:
config = torch.profiler._ExperimentalConfig() -
The
with_modulesprofiler option is deprecated and now emits aFutureWarning(#192808)with_modules=Trueonly collected module hierarchy for TorchScript models and did nothing in eager mode. For eager models, usewith_stack=Trueto recordnn.Moduleevents.Before:
with torch.profiler.profile(with_modules=True) as prof: run_workload()After:
with torch.profiler.profile(with_stack=True) as prof: run_workload()
Dynamo
-
torch._dynamo.config.enable_faithful_generator_behavioris deprecated and is now a no-op (#189894)Faithful (lazy) generator tracing has been the default and is the only supported behavior, so the dead eager-exhaustion path was removed. The config is kept as a deprecated setting that always behaves as
True, so setting it does not error but no longer changes anything.Version 2.13:
# generators were eagerly exhausted on first execution with torch._dynamo.config.patch(enable_faithful_generator_behavior=False): torch.compile(fn)(x)Version 2.14:
# the flag is ignored; generators are always traced lazily torch.compile(fn)(x)
CUDA
-
Deprecate
CUDAGraph.register_generator_state(); CUDA graphs now register generator state lazily on first RNG use during capture (#176753)The method is now a no-op and emits a deprecation warning. Remove explicit registration calls; the graph automatically retains the required state when the generator is used during capture.
Before:
graph = torch.cuda.CUDAGraph() state = generator.graphsafe_get_state() graph.register_generator_state(state) with torch.cuda.graph(graph): generator.graphsafe_set_state(state) output = torch.rand(16, device="cuda", generator=generator)After:
graph = torch.cuda.CUDAGraph() state = generator.graphsafe_get_state() with torch.cuda.graph(graph): generator.graphsafe_set_state(state) output = torch.rand(16, device="cuda", generator=generator) -
Deprecate
GreenContext.set_context()andGreenContext.pop_context(); use custom streams to activate a green context instead (#188419)These methods now emit a
FutureWarning. Create a stream from the green context and use it withtorch.cuda.stream()instead. Synchronization with streams outside the green context remains the caller's responsibility and should use CUDA events when needed.Before:
ctx = torch.cuda.green_contexts.GreenContext(num_sms=1) ctx.set_context() try: output = model(input) finally: ctx.pop_context()After:
ctx = torch.cuda.green_contexts.GreenContext(num_sms=1) stream = ctx.Stream() with torch.cuda.stream(stream): output = model(input)
JIT
-
TorchScript APIs now emit visible
FutureWarnings instead of normally hiddenDeprecationWarnings (#189914)Calls such as
torch.jit.script,torch.jit.trace,torch.jit.save, andtorch.jit.loadnow visibly direct users towardtorch.compileortorch.export. Imports oftorch.utils.mkldnn,torch.fx.experimental.optimization, andtorch.distributed.optimalso avoid eagerly compiling TorchScript when those modules are merely imported.Before:
scripted = torch.jit.script(model) torch.jit.save(scripted, "model.pt")After:
exported = torch.export.export(model, example_inputs) torch.export.save(exported, "model.pt2")
New Features
Python Frontend
- Add
torch.accelerator.initial_seed(),torch.accelerator.get_rng_state(), andtorch.accelerator.get_rng_state_all()for backend-agnostic accelerator RNG inspection (#186597) - Add read-only DLPack export through
Tensor.__dlpack__(read_only=True)andtorch.utils.dlpack.ReadOnlyTensorWrapper, including copy-on-write-preserving exchange with compatible consumers (#188554) - Add
torch.Generator.philox_state()so Python-authored kernels can reserve Philox counter ranges that remain correct across CUDA Graph capture and replay (#191019)
Autograd
-
torch.utils.checkpoint.checkpoint()can now be called without a function to create an eager-mode decorator with checkpoint configuration separated from the wrapped function's arguments (#189411)checkpointed_function = torch.utils.checkpoint.checkpoint( use_reentrant=False )(function) output = checkpointed_function(*args, **kwargs)The curried form is initially supported in eager mode; existing direct calls remain the compatible form under
torch.compile. -
Add
torch.autograd.graph.node_creation_hook, a thread-local context manager whose callback receives every fully populated autograd graph node created within its scope. The callback can inspect nodes, store metadata, or register backward pre-hooks and post-hooks, including for nodes created during higher-order differentiation and checkpoint recomputation (#189284) -
Add
ctx.set_output_grad_dtype(*dtypes)for customtorch.autograd.Functionimplementations. Called once fromforwardorsetup_context, it declares the gradient dtype expected for each output independently of the output's storage dtype; a concrete dtype converts incoming gradients, whileNoneleaves their dtype unchanged (#189634) -
Add second-order gradient support for
torch.cdistandtorch.nn.functional.pdist, so grad-grad computations no longer fail because_cdist_backwardor_pdist_backwardlacks a derivative (#188901)
Distributed
- Add portable JSON serialization through
DebugMode.save_logs()andDebugMode.load_logs()so distributed execution logs can be compared across separate processes or model configurations (#185010) - Add the public
torch.distributed.set_timeout()API; the private_set_pg_timeout()alias remains available with a deprecation warning (#187387) - Add
torch.distributed.tensor.logspacefor constructing distributed logarithmically spaced tensors (#186398) - Add experimental
torch.distributed.get_backend_impl()andProcessGroup.get_backend()accessors for custom backend development (#187494) - Add
torch.distributed.tensor.linspacefor constructing distributed linearly spaced tensors (#187933) - Add fault-tolerant reconfiguration and one-sided window operations to the experimental
nccl2backend (#189359, #189360) - Add the experimental
nccl-lazybackend, which creates per-peer NCCL point-to-point communicators on demand (#189362) - Add the
CheckpointableTensorprotocol so distributed checkpointing can save and loadtorch.Tensorobjects exposingglobal_shape,global_offsets,local_offsets, andlocal_sizesmetadata (#189492) - Add an explicit
nccl-legacybackend and theTORCH_DIST_USE_NCCL2=1opt-in for selecting the experimental replacement behind thencclname (#191272) - Allow
ProcessGroupNCCL.Options.config.comm_nameto assign readable communicator names for NCCL logs and profiler tools (#191001) - Add
torchrun --log-line-prefix-templateand a${hostname}template variable for identifying the host that emitted each worker log line (#191265) - Allow pipeline schedules to consume explicitly pre-split positional inputs, keyword inputs, and targets through
arg_mbs,kwarg_mbs, andtarget_mbs(#188500) - Add optional shell-completion generation to
torchrunthrough--print-completionand theshtabpackage (#191289)
Symmetric Memory
- Add XPU support for symmetric-memory operations used by asynchronous tensor parallelism, enabling communication/computation overlap on Intel GPUs (#185102)
Linear Algebra Frontend
- Add
torch.linalg.polar()for computingA = U @ Hfor matrices with at least as many rows as columns, using a portable SVD implementation and cuSOLVER QDWH acceleration for eligible CUDA inputs (#185837) - Add
torch.linalg.matrix_sqrthfor computing the principal square root of symmetric or Hermitian positive-definite matrices, with support for batched inputs, autograd,vmap, andtorch.compile(#187987) - Add CUDA cuBLASLt support to TunableOp, including controls for the number of heuristic candidates through
torch.cuda.tunable.set_cublaslt_requested_algo_count()andPYTORCH_TUNABLEOP_CUBLASLT_REQUESTED_ALGO_COUNT(#186270)
Profiler
-
Memory snapshots can now include CPU pinned-memory allocations by passing
record_pinned_host_memory=Truetotorch.cuda.memory._record_memory_history()(#182407)Pinned-memory allocator state and history are available in the snapshot's
host_segmentsandhost_tracesfields. Passrecord_cuda=Falseto record only pinned host memory; the web memory visualizer does not yet display host-memory data. -
Profiler events now expose Kineto metadata as typed values through
FunctionEvent.metadatawhenexpose_kineto_event_metadata=Trueis enabled (#191756)The new dictionary avoids reparsing JSON strings and automatically includes metadata fields supported by the active profiler backend.
Dynamo
- Add
torch.compiler.nonstrict_traceas a public API (#187737) - Add the prototype
switchhigher-order op, which selects between N branches by index and mirrorsjax.lax.switch. It is available asfrom torch._higher_order_ops.switch import switchand lowers totorch.ops.higher_order.switch; autograd is not yet supported (#182902, #188374, #189028) - Declare dynamic shapes explicitly with
ShapesSpec/ParamsSpec, now accepted by strict and non-stricttorch.export.export,make_fx(tracing_mode="fake"), andtorch.compilethrough a shareddynamic_shapes=keyword (#185982, #186751, #187602, #187010) - Support Dynamo and AOTAutograd tracing of permitted input mutations in the prototype
scan,map, andswitchhigher-order ops when gradients are disabled; Inductor lowering for these mutations is not yet supported (#186474, #187568, #188903) - Support
torch.cuda.use_mem_poolinside a compiled region, so allocations in the context - including fallback and extern kernels - are routed to the pool (#185057) - Support calls to
logging.Loggermethods that are explicitly registered intorch._dynamo.config.reorderable_logging_functions, so supported positional-argument logging calls run after the compiled region instead of causing graph breaks (#190840)
Inductor
- Add NVGEMM epilogue fusion so supported pointwise operations and output casts can be fused into autotuned matrix multiplications (#186183)
- Add NVGEMM autotuning support for
torch.addmm, including fused bias and supported pointwise epilogues (#189774) - Support FlexAttention FLASH-backend backward graphs that differentiate through the returned log-sum-exp output (#189784)
- Add an opt-in
torch._inductor.config.reorder_for_locality_in_trainingsetting for applying locality-based graph reordering to training graphs (#186643) - Add opt-in CUDA Graph Trees generation cloning through
torch._inductor.config.triton.cudagraph_trees_generation_cloning = "user_visible", preserving live user-visible outputs across generations (#188078) - Add
bfloat16support totorch.fftoperations andtorch.stfton CUDA and addfloat16/bfloat16support on XPU. Native CUDAbfloat16cuFFT execution requires SM80 or newer and power-of-two transform sizes; unsupported CUDA and XPU cases promote tofloat32. CPU FFT continues to reject these low-precision dtypes (#180766) - Add the opt-in
autotuning_inputslog artifact, enabled withTORCH_LOGS=autotuning_inputs, to report Triton autotuning input shapes, dtypes, strides, and scalar values (#184399) - Add Inductor support for the prototype
switchcontrol-flow operator on CPU and GPU, including dynamic shapes, multiple outputs, and AOTInductor; CUDA graphs remain unsupported for graphs containingswitch(#188976) - Add dynamic-shape support to
torch.compiler.precompilefor dimensions marked withtorch._dynamo.decorators.mark_unbacked, allowing one artifact to serve multiple runtime sizes without guarding on the marked dimension (#189165) - Add
torch.compiler.cudagraph_mark_warmup_incomplete()so code can request another CUDA Graph Trees warmup iteration (#191386)
Ahead-Of-Time Inductor (AOTI)
-
Add
AOTInductorModelContainerCreateWithExternalConstants, allowing callers to construct an AOTInductor model container from caller-owned weight tensors for zero-copy sharing such as CUDA IPC (#188643)The new C API skips loading constants from the package and leaves ownership with the caller. Existing model-container creation and constant-loading paths are unchanged unless external constants are explicitly provided.
-
Support explicit user-defined streams in the AOTInductor C++ wrapper. A compiled region that selects a stream with
torch.cuda.stream(...)now emits stream-guard code so its kernels run on the requested stream, instead of always running on the default stream (#182971)
Export
- Add the
torch.fx.experimental.dynamic_spec.dynamic_specdecorator for attaching a dynamic-shape specification to a function ornn.Module.forward.torch.compile,torch.export.export, andmake_fxautomatically use the attached specification; passing a conflicting call-site specification raises an error (#187639)
Composability
- Add a
lengthargument to the prototypetorch._higher_order_ops.scan, allowing a scan to run for a fixed number of steps whenxs=None, matching the correspondingjax.lax.scanusage pattern (#188349) - Add grouped-query attention to the CUDA memory-efficient backend for
torch.nn.functional.scaled_dot_product_attention, including native grouped key/value heads, implicit multi-query attention broadcasting, and backward support undervmap(#191085)
C++ Frontend
- Add
torch::stable::tensor_from_pyobjectandtorch::stable::tensor_to_pyobjectfor converting between Pythontorch.Tensorobjects andtorch::stable::Tensor(#183323) - Move the
c10/util/complex_utils.hhelpers and theATen/NumericUtils.h_isinfand_isnanimplementations into the header-only ABI (#192552, #192557) - Add stable-ABI
torch::stable::permuteand the dtype overload oftorch::stable::view(#192083) - Add stable-ABI
torch::stable::Tensoroverloads forbitwise_and,bitwise_or,bitwise_left_shift,bitwise_right_shift,index_select,floor_divide, andis_pinned(#191973, #192097) - Add
torch::stable::Tensor::has_storage()(#189877)
Release Engineering
-
Expand Python 3.15 and free-threaded (no-GIL) Python 3.15t binary coverage to Windows and macOS, completing support across the PyTorch release matrix (#189722, #190360, #190361, #186033)
PyTorch 2.14 publishes Python 3.15 and 3.15t wheels for Linux on x86-64 and aarch64, Windows x86-64, and macOS on Apple silicon, covering the applicable CPU, CUDA, ROCm, and XPU builds.
torchvision0.29.0 publishes matching Python 3.15 and 3.15t wheels for the same supported platform and accelerator combinations. This is binary and eager-runtime support;torch.compileremains unsupported on Python 3.15 in this release.
CUDA
-
Add a cuBLASLt backend for grouped GEMM on Hopper and Blackwell GPUs with CUDA 13.3 or newer (#177037, #190372)
The backend supports
float16andbfloat16, works withtorch.compileand CUDA Graphs, and is selected by default for eligiblefloat16workloads. Settorch.backends.cuda.matmul.prefer_cublaslt_grouped_gemm = Trueto opt into it forbfloat16. Matrices and leading dimensions must be 16-byte aligned, so some shapes may require padding and slicing. -
Add
torch.cuda.memory._annotate_tensor()for attaching metadata to a live CUDA tensor allocation after it is created (#190575)Each annotation is recorded as a timestamped memory-history event, multiple annotations accumulate without replacing allocation-time metadata, and memory snapshot tools display the annotations alongside the affected allocation. Memory history must be enabled with
torch.cuda.memory._record_memory_history()for annotations to be observable. Only the native CUDA caching allocator supports annotations. -
Add the public
torch.cuda.graph_annotationsmodule (#189417) -
Annotate backward kernels in
mark_kernelsvianode_creation_hook(#191563) -
Allow multiple memory pools in a single
CUDAGraph(#187929) -
Add CUDA graph support for
torch.while_loop(#186055) -
Add destroy callbacks and object retention to
torch.cuda.CUDAGraph(#190582) -
Add replay start/end hooks to
torch.cuda.CUDAGraph(#190602) -
Add global CUDA graph capture-start/end and replay-start/end hooks, plus
torch.cuda.CUDAGraph.register_capture_start_hook()(#192162)
cuDNN
- Add cuDNN SDPA support for head dimension 256 on SM90 and SM10.x GPUs with cuDNN newer than 9.22 and cuDNN Frontend 1.24 or newer; backward currently supports only
(d_qk, d_v) = (256, 256)(#185553)
MPS
- Add native MPS support for binomial sampling (#187078)
- Add MPS forward and backward support for
torch.nn.functional.ctc_loss(#187716, #188187) - Add MPS support for
torch.linalg.matrix_exp, including complex inputs, on macOS 15 or newer (#188954) - Add native MPS Poisson sampling, eliminating its CPU fallback (#173319)
- Add native
float32andcomplex64MPS implementations oftorch.linalg.svd,svdvals,eigh,eigvalsh, andlstsq, while retaining CPU fallbacks for small matrices and matrices that exceed threadgroup memory (#185954)
ROCm
- Add initial, technology-preview support for AMD
gfx1250; CK SDPA/GEMM, FP8 grouped GEMM, and int4 matrix multiplication remain unsupported (#187548, #188597, #188612) - Enable hipFile on Linux with ROCm 7.14 or newer (#191069, #192803)
XPU
- Add FP8 blockwise scaling support for MXFP8/MXFP4/NVFP4 recipes to
torch._scaled_mmandtorch._scaled_mm_v2on XPU (#181726, #181727, #187315) - Add XPU Graph native recording mode on non-PVC devices when PyTorch is built with oneAPI 2026.1 or newer (#188874)
- Add
torch.xpu.list_gpu_processesto query per-process GPU memory usage on XPU (#185192)
Improvements
Python Frontend
- Allow
torch.quantileandtorch.nanquantileto processfloat32andfloat64inputs larger than2**24elements on devices withfloat64support by computing ranks infloat64(#187574)
torch.nn
- Allow the chunked path of
torch.nn.functional.linear_cross_entropyto handle probability targets forreduction="mean"andreduction="sum"when the target dtype matches the input and the target does not require gradients (#187053) - Improve static typing for
torch.nn.Sequentialindexing so integer keys resolve toModuleand slices resolve toSequential(#187758) - Add the documented
memory_formatoverload totorch.nn.Module.to()so static type checkers accept calls such asmodule.to(memory_format=torch.channels_last)(#185117)
Optimizer
- Add the
"spectral_unclamped"scaling option to theadjust_lr_fnparameter oftorch.optim.Muon(#187402) - Add a
maximizeparameter totorch.optim.LBFGS(#187309) - Make
torch.optim.LBFGS.step()a no-op for an empty parameter group (#191666)
Distributed
- Expand
DTensorsharding strategies for matrix, attention, sorting, scanning, softmax, and related operations (#186667, #179068) - Allow custom Python
ProcessGroupimplementations to usebatch_isend_irecvand the coalescing manager (#186964) - Improve the Flight Recorder diagnostic emitted when a
TCPStorecheck fails (#187191) - Allow pipeline parallel stages to use separate forward and backward point-to-point communicators, reducing cross-batch ordering hazards (#186173)
- Add fault-tolerant reconfiguration support to Gloo process groups (#187381)
- Make compile-on-one-rank graphs portable across ranks by replacing baked accelerator device indices with a runtime current-device operation (#186892)
- Expand active
DTensorsingle-dimension strategies for tensor operations (#186754) - Auto-qualify bare backend names and pass process-group options through custom TorchComms backend creation (#187856)
- Add complete collective coverage to custom Python process groups, including single-tensor gather/scatter and the remaining point-to-point and collective operations (#188548, #188570)
- Make TorchElastic NUMA binding and
ShardedTensordevice transfers work with accelerator backends beyond CUDA (#185266, #187939) - Use generic collective coalescing when aborting process groups so third-party backends can avoid multi-communicator teardown deadlocks (#189770)
- Mark CUDA symmetric-memory allocations as GPUDirect RDMA capable on supported systems (#189941)
- Add communicator memory suspend/resume support to the experimental
nccl2backend (#189361) - Allow unknown device-qualified TorchComms backend names to register as custom backends without requiring manual changes to internal backend maps (#191034)
- Add eager
split_groupsupport, completeWorksemantics, nonblocking communicators, and uneven list collectives to the experimentalnccl2backend (#190943, #191517, #191528, #191542) - Include
nccl-lazypair communicators in error reporting, suspend/resume operations, and memory statistics, and expand its shared backend coverage (#191553, #191556) - Add memory-pool registration and deregistration support to the experimental
nccl2backend (#192108) - Add per-process-group collective sequence numbers and accurate split-group membership metadata to
nccl2profiler traces (#192114, #192115) - Support non-overlapping final-spatial-dimension
DTensorsharding forConv1d,Conv2d, andConv3dforward and backward (#192147) - Pass process-group descriptions and names to NCCL's
commNamefield while preserving user-specified communicator names (#192487) - Support
DTensorredistribution from final-dimension sharding toPartial("sum")(#191828)
Distributed (c10d)
- Upgrade NCCL to 2.30.7 for CUDA 13.0 and CUDA 13.2 builds (#187528)
- Enable Inductor's
simple_overlapscheduler pass by default for compiled distributed workloads, moving collective starts earlier and waits later without reordering collectives or increasing peak memory (#184235, #184240)
Linear Algebra Frontend
- Add backward support for
torch.linalg.polaron CPU, CUDA, and MPS (#189732) - Enable
torch.linalg.eigon ROCm 7.14 or newer through hipSOLVER's genericXgeevAPI, and update generated linear-algebra tests to recognize hipSOLVER implementations that do not require MAGMA (#188720) - Allow
torch.backends.cuda.preferred_blas_library("ck")to select the CK GEMM backend on ROCmgfx90adevices by separating GEMM support from CK attention support (#187267) - Expand ROCm backend coverage for
torch.linalg.eig,torch.linalg.ldl_solve,torch.linalg.solve, andtorch.linalg.solve_triangularthrough hipSOLVER and hipBLAS paths (#185557)
Profiler
- Record XPU profiler overhead as
OVERHEADactivities, making collection costs visible on a dedicated track in exported traces (#187835)
FX
- Allow
split_const_subgraphs()callers to supply anis_impure_nodecallback so destination-passing operations and other side-effecting nodes are preserved during dead-code elimination (#190716) - Make
get_source_partitions()return input nodes, output nodes, and parameters in deterministic graph order (#188965)
Dynamo
- Extend
torch.compiler.nested_compile_regionreuse to source-backed objects, symbolic shapes, dataclasses, and namedtuples (#192003, #191806, #191817) - Expand compilation support for
staticmethod, built-in leaf modules, cross-devicetensor.dataswaps, raw unbackedSymIntinputs, zero-length scans, and methods reached throughsuper()(#190673, #185722, #185980, #187273, #188348, #183850) - Trace accelerator probes, channels-last
out=tensors, sourcelessDistributedDataParallel,dist.reduce_scatter,SDPAParams, andtorch.linalg.polar(#185277, #185089, #187210, #190429, #190839, #188537) - Recognize out-of-tree Triton devices and accept module functions or constants as
torch._checkmessages (#190324, #188576) - Match more Python built-ins and operators, including
min/max, integer bases and formatting,range/slice coercion, object and container subclasses, mutable string splits, rich comparisons, item mutation, andcallable()(#191401, #191402, #191408, #187129, #186976, #189021, #187588, #185999, #188306, #191406, #190259, #186971) - Expand iterator support for
itertools, dict/set views, and range iterators (#188080, #189022, #186937, #187080, #186240, #188081, #188221, #189575) - Improve
deque, dict, set, dict-view,__dict__, and list initialization fidelity (#187128, #188220, #191403, #189052, #191405, #186759, #186760, #186669, #186761, #186763, #188908, #187586, #187587, #187583, #187584) - Improve object representation and copying, exception attributes, and subgenerator closure behavior (#187775, #188909, #189053, #189576, #188105, #189024, #188825, #188834)
- Trace module-level random calls, text-file encoding operations, and additional numeric operator slots (#188235, #188083, #189984, #186296, #189585, #185641)
- Improve graph-break, guard-mismatch, in-place-view, backend-name, and exception diagnostics (#185763, #185083, #185903, #189333, #182972, #185508)
- Support TVM's Relax frontend and pipeline-based tuning (#189010, #189638)
Inductor
- Make missing CUDA and ROCm warp-size metadata explicit so Inductor skips heuristics that require it instead of silently assuming a warp size of 32. Raise when a code path requires a concrete warp size but the metadata is unavailable (#183014)
- Make autotuning subprocesses honor
ZE_AFFINITY_MASKon XPU while preservingCUDA_VISIBLE_DEVICESbehavior on CUDA (#183436) - Add a dedicated
XPUCompileErrorfor SYCL compilation failures and clear loaded XPU libraries when the code cache is reset (#183530) - Make partitioned-scatter selection memory- and contention-aware, enable it by default on ROCm, and replace the removed
partitioned_scatter_memory_budgetsetting with memory-headroom controls; setpartitioned_scatter_enabled = Falseto opt out (#184365) - Support ROCm Composable Kernel GEMM templates when compiling with the JIT C++ wrapper (#185505)
- Fuse decomposed SiLU activations into CUTLASS GEMM epilogues and improve XPU GEMM template compatibility (#186197, #186198)
- Accept multiword compiler commands such as
CXX="zig c++"when building Inductor-generated C++ code on POSIX systems (#186336) - Add Intel Arc B580 and Arc Pro B70 specifications to Inductor's device-performance metadata (#187308)
- Lower
uniform_andaten.uniformthrough a native decomposition instead of always falling back to eager execution (#187887) - Enable Triton indirect-indexing assertions on ROCm with Triton 3.7 or newer, improving diagnostics for out-of-bounds accesses (#188075)
- Allow XPU's static launcher to accept host and shared USM pointers recognized by the driver instead of requiring device memory (#188240)
- Extend manual communication-overlap scheduling to bucket and defer waits for DDP and HSDP
all_reduceoperations (#188472) - Support grouped and FP8-scaled grouped GEMM Triton lowering on compatible ROCm hardware (#188600, #188742)
- Apply per-region Inductor configuration patches throughout nested-region compilation and allow separate forward and backward patches (#189320, #190068)
- Decompose semi-structured sparse CUTLASS matrix multiplication so Inductor can lower and autotune the underlying operation (#189366)
- Report stuck compile workers and their current phase in structured
tlparsetraces through the configurable compile-worker watchdog (#189485, #189486) - Prefer device datasheet bandwidth for Inductor's bandwidth-driven heuristics and add Intel Data Center GPU Max 1100 metadata (#189819)
- Lower
torch.float8_e8m0fnuconversions directly on CPU and CUDA instead of relying on fallback conversion code (#190593) - Expand NVGEMM epilogue fusion to pointwise operations, multiple outputs, and grouped reductions, including scaled and centered outputs (#190643, #190808, #190809, #190810, #190813, #190817, #190823)
- Suppress empty generated-code dumps from
TORCH_LOGS=output_codeduring autotuning (#191381)
Ahead-Of-Time Inductor (AOTI)
- Support
int[],SymInt[], and optional integer-list arguments in AOTI eager cache keys, enabling cached compilation for operators such asnew_zeros,mean.dim, andcount_nonzero.dim_IntList(#187360) - Support lazy autotuning when compiling with the AOTInductor dual-wrapper, so Triton autotuning is deferred to a first JIT pass rather than being done during ahead-of-time compilation (#184735)
- Support
torch.condandtorch.while_loopwhen compiling with the AOTInductor dual-wrapper (#184736) - Add an
AOTI_LOG_LOADINGenvironment variable. When it is set, AOTInductor prints timing and diagnostic messages for each stage of constant loading, prefixed with[AOTI_LOAD], without requiring a rebuild (#186309) - Check the error codes returned by the generated
scatter,index_put,clone, and tensor-handle shim calls, so a failure inside one of these fallbacks raises an error instead of being silently ignored (#190909, #190910)
Export
- Support serializing nested integer and floating-point list arguments, including empty nested lists, for custom operators in exported programs (#189424)
- Support
ObjectSpec,SeqSpec, andDictSpeccontainer types when using shape specifications with strict export (#186167)
Composability
- Add
torch.linalg.vector_normto the core ATen decomposition table used byExportedProgram.run_decompositions(), including correctdim=()handling (#185735) - Allow out-of-tree backends to define additional
out_dtypecombinations fortorch.mm,torch.bmm, andtorch.baddbmmunder fake/meta tracing; CUDA and XPU restrictions remain unchanged (#187096) - Provide a targeted dynamic-shape error when a data-dependent expression conflicts with a
dynamic_specconstraint (#187143)
Foreach
- Use the nvmath
_foreach_mmpath only when the loaded cuBLASLt version supports grouped GEMM (#189757)
ONNX
- Preserve constants introduced during export decompositions so
ExportedProgramremains valid when ONNX symbolic operations are inserted during retracing (#185090)
C++ Frontend
- Enable stable-ABI error-message retrieval dynamically when the required runtime shim is available (#183823)
- Treat
-Wdeprecated-declarationsdiagnostics as warnings rather than errors inc10, ATen, and LibTorch builds (#189948) - Reject negative CUDA storage-resize requests instead of wrapping them to huge
size_tallocation requests (#190652)
Release Engineering
- Enable ROCm 7.14 nightly manywheel builds through TheRock wheels (#190276) and add
libatomicto the manywheel builder image (#192254) - Update the bundled Triton to 3.8.0 (#188251, #190349)
- Add full CUDA 13.2 CI coverage for stable-version configurations (#190641), Inductor, H100, B200, and
DTensor(#190948), plus B200 smoke tests (#191705) - Upgrade the XPU support package to 2026.1 (#189593)
- Update OpenBLAS to v0.3.34 (#190314)
- Update the Arm Compute Library (ACL) version used by aarch64 builds (#191316)
- Relax the
nvidia-nvjitlink-cu12runtime dependency of CUDA 12 wheels so it no longer forces an exact version (#186958)
CUDA
- Add CUDA compute capability 10.7 (
sm_107) awareness for NVIDIA Rubin GPUs with CUDA 13.4 or newer in extension builds and Inductor code generation (#190654) - Update CUDA compatibility checks for Jetson devices using SBSA binaries with CUDA 13.2 or newer (#186285)
- Move green contexts to cuda-python bindings (#185527)
- Unify the
CUDAGraphdebug flag, movedebug_dumpto Python, and add capture hooks (#187749) - Trim the
cudaMallocAsyncpool and retry once before raising an out-of-memory error (#188110) - Improve CUDA errors by including excerpts from CUDA logs (#191334)
- Add
torch.float16andtorch.bfloat16support totorch.angleon CUDA (#191301)
cuDNN
- Upgrade the CUDA 12.8, 12.9, and 13.x wheels to cuDNN 9.24 and re-enable convolution engine 5 after its nondeterminism issue was fixed (#187091, #189483)
CPU (x86)
- Add
Halfsupport to the eagertorch.polarkernel (#192311) - Allow
xeon/run_cpu.pyto accept multiple values for--ncores-per-instance(#169916)
MPS
- Support
return_aux(max_scores=True)in MPSflex_attentionforward (#188362) - Support
SymIntcaptures in MPSflex_attentionscore and mask functions, including dynamically shaped compiled graphs (#188403) - Add MPS support for
torch.linalg.polar(#189701) - Support MPS
torch.nonzeroon tensors containing more than2**32elements (#188816) - Add complex MPS support for Cholesky factorization (#191836)
- Support key/value batch broadcasting and returning log-sum-exp values from MPS
flex_attention(#187722, #187768) - Add MPS backward support for antialiased bilinear and bicubic 2D upsampling (#188819)
- Add complex MPS support to
torch.nan_to_numand correctly resize emptyout=tensors (#189489) - Add MPS
torch.geqrfsupport and align the MPStorch.linalg.qrimplementation with other backends (#189192)
ROCm
- Add
torch.utils.hipifymappings for thecublasMath_ttype, its enum values, andCUBLAS_COMPUTE_16F, so HIP-ported extensions that callcublasGemmExwithCUBLAS_COMPUTE_16For set a cuBLAS math mode hipify cleanly without per-project aliases (#187752) - Migrate from
rocm_smitoamd_smi(#190014) - Preload TheRock ROCm dependencies so wheels are self-contained (#188454)
- Enable Inductor lowering for FMA on ROCm (#187165)
XPU
- Add device-wide synchronization support on XPU (#191900)
- Add IPC memory handle sharing support to
XPUCachingAllocatoron XPU (#188789) - Support head dimensions 32 and 256 for XPU FlashAttention (#180646)
- Enable TF32
fpmathmode for XPU deconvolution, matching the existing convolution behavior (#185606) - Fix XPU graph-capture hangs by deferring memory-pool block handling until capture ends (#187931)
- Refine
clock_rateandpower_drawdevice property queries throughpyzes0.1.2 (#188248, #188256) - Add experimental C++ XPU device properties for Xe topology, including
xe_stack_count,xe_regions_per_stack,xe_clusters_per_region, andxe_cores_per_cluster(#191477) - Support BMG-G31 architecture compilation for the SYCL-TLA CUTLASS backend on XPU (#187040)
- Enable the XPU scope profiler to gather hardware metrics through the Kineto plugin (#165766)
- Make Inductor use XPU's device-specific TF32 setting so compiled matrix multiplication matches eager behavior (#187948)
- Enable SYCL native fast-math approximations for
exp,log,log1p, andtanon XPU (#176262)
Sparse Frontend
- Add CUDA
float16andbfloat16support totorch.sparse.sampled_addmm, including supported sparse-CSR backward paths (#187681) - Add sparse COO dispatch for
torch.linalg.vector_norm, allowing it to replace deprecatedtorch.normcalls on sparse COO tensors (#185309)
torch.func
- Allow
torch.vmapto handle the scalar overload oftorch.searchsorted(#188974) - Expand
torch.vmapcoverage for copy-view operations by routing them through existing batching rules (#187256) - Add a batching rule for
torch.repeat_interleavewhenrepeatsis batched; callers must provide a commonoutput_sizebecause per-example output lengths are data-dependent (#187702) - Add a native batching rule for in-place
Tensor.masked_fill_(), avoiding the slow fallback and its performance warning undertorch.vmap(#175513) - Expand scalar fill and comparison support under
torch.vmap, including accelerator placement for scalar operands (#189176)
Bug Fixes
Python Frontend
- Fix
torch.arangecomputing the wrong length for fractional arguments with an integer output dtype because it truncates those arguments too early (#185812) - Raise a clear unsupported-operation error for dense tensor factories targeting
device="mkldnn"instead of triggering an internal assertion (#185711)
Dataloader Frontend
- Release CUDA IPC-backed dataset storage when
DataLoaderworkers exit, preventing producer-side IPC references and allocations from being retained indefinitely (#190485)
torch.nn
-
Enable eligible fused scaled dot-product attention backends for dense rank-3 inputs on CPU, CUDA/ROCm, and XPU instead of always falling back to the math implementation (#192271)
Rank-3 inputs are normalized to rank 4 with a singleton batch dimension before backend selection. This fixes fused execution for rank-3 and vmapped inputs, but automatic backend selection can change floating-point numerics, dropout RNG consumption, whether the result is a view, and higher-order-gradient support. Fused CUDA backends do not support the second derivatives provided by the math backend; code that depends on those semantics should explicitly select the math backend.
from torch.nn.attention import SDPBackend, sdpa_kernel with sdpa_kernel(backends=[SDPBackend.MATH]): output = torch.nn.functional.scaled_dot_product_attention( query, key, value ) -
Reject
norm_type=0in functional and module Lp pooling APIs with a descriptiveValueErrorinstead of a deferredZeroDivisionError(#187861) -
Fix failures in memory-efficient scaled dot-product attention backward after
torch.autograd.graph.save_on_cpu()changes an attention mask's aligned strides (#188246) -
Fix a CUDA illegal memory access in memory-efficient scaled dot-product attention backward when only the floating-point attention mask requires gradients (#188302)
-
Make the cuDNN CTC loss backend correctly zero infinite losses and their gradients when
zero_infinity=True(#176911) -
Validate each output dimension for
replication_pad2dandreplication_pad3dso excessive negative padding raises a clear error instead of attempting to create a negative-sized tensor (#184254) -
Fix silently incorrect CUDA gradients from channels-last
avg_pool2dwhen padding is nonzero (#188345) -
Make CPU eager and decomposed
torch.nn.functional.softshrinkcast scalarlambdvalues consistently for reduced-precision inputs (#186358) -
Prevent CUDA
avg_pool3dbackward from corrupting gradients when an overlapping-window input contains more than2**31elements (#188229) -
Reject non-positive
kernel_sizevalues in rawfractional_max_pool2dandfractional_max_pool3doperations instead of returning-infoutputs with invalid indices (#190480) -
Support 64-bit indexing for channels-last CUDA bilinear upsampling so outputs with at least
2**31elements no longer fail withCUDA error: invalid configuration argument(#185788) -
Fall back to the ATen CUDA implementation when the fused RMSNorm override's normalized dimension exceeds the device's shared-memory capacity, avoiding compiler hangs or crashes (#186941)
-
Reject invalid
dimtypes when constructingtorch.nn.Softmaxortorch.nn.LogSoftmaxinstead of failing later during the forward pass with a confusing overload error (#185055) -
Handle misaligned input and weight storage in the fused RMSNorm override instead of raising
Misaligned Tensor data on argument #0(#186235) -
Make CUDA
float16softmax withdtype=torch.float32use the same persistent-kernel range as thefloat16output path, fixing rounding inconsistencies for dimensions between 1025 and 2048 (#188247)
Optimizer
- Fix skipped updates and incorrect
float16/bfloat16casts in fused CPUtorch.optim.SGDandtorch.optim.Adagrad(#192545)
Autograd
- Reject unsupported third-order derivatives for training-mode batch normalization instead of silently returning an invalid result; second-order derivatives and evaluation mode are unchanged (#186779)
- Fix
torch.powbackward when the base is a Boolean scalar by promoting the scalar before computing its logarithm, avoiding an internal assertion failure (#182564) - Fix
torch.powbackward undertorch.compile(dynamic=True)when a Python integer exponent becomes symbolic, avoiding theNYI SymInt equalitycrash without specializing on the exponent (#185851) - Make
native_group_normandnative_group_norm_backwardsafely handle non-contiguous tensors, fixingvmapfailures and possible out-of-bounds memory accesses (#186414) - Fix the
torch.ldexpgradient for negative integer exponents so it returns2.0 ** exponentinstead of zero (#186566) - Fix
DeviceContextmode leaks during checkpoint recomputation and default-device restoration (#189286) - Fix end-of-backward leaf-stream synchronization across CUDA graph capture boundaries, avoiding opaque
cudaErrorStreamCaptureIsolationfailures and providing an actionable error when the crossing cannot be safely skipped (#189591) - Fix precision errors in the CUDA
native_group_norm_backwardkernel and its decomposition by applying the missing upcasts (#190245) - Stop
register_full_backward_pre_hook-only modules from emitting a warning intended forregister_full_backward_hookwhen their forward inputs do not require gradients (#190685) - Fix max-pooling double backward under
vmapfor channels-last inputs, which previously raisedNYI: querying is_contiguous inside of vmap(#191678) - Preserve dynamic type names and argument indices in custom
torch.autograd.Functionvalidation error messages (#191748) - Improve
log2andlog10backward accuracy by using named mathematical constants, including a correctly rounded double-precisionlog(10)constant (#192613)
Distributed
- Fix construction of Python
ProcessGroupsubclasses through the(store, rank, size)constructor and ensure their virtual overrides are dispatched correctly (#186853) - Select registered custom communication backends instead of incorrectly falling back to NCCL or Gloo when the backend is unspecified (#179901)
- Fix compiled DTensor backward paths producing data-dependent guards for valid symbolic local layouts (#187026)
- Preserve local Philox seed and offset outputs when expanding DTensor scaled dot-product attention strategies across multidimensional meshes (#187199)
- Respect nonzero
rootarguments intorch.cuda.nccl.broadcastinstead of always broadcasting from the first tensor (#187216) - Fix ring-attention backward using mismatched maximum sequence lengths when context-parallel load balancing is enabled (#185493)
- Fix DTensor backward strategies emitting placements for outputs disabled by
output_mask(#187383) - Preserve the configured FSDP2 gradient-reduction dtype when parameters are frozen during the first forward and later unfrozen (#187376)
- Make
torch.distributed.set_timeout()a no-op for fake process groups and warn rather than fail for backends that cannot configure timeouts (#187693) - Prevent
LocalDeviceMeshfrom returning stale coordinates after a temporary submesh is destroyed and its object ID is reused (#187052) - Fix asynchronous coalesced collectives failing CUDA graph capture under
torch.compile(mode="reduce-overhead")because tensors were retained by the wrong work object (#187433) - Implement
barrier()for the NCCL symmetric-memory backend instead of raising a not-implemented error (#188051) - Flush distributed-checkpoint streams before
fsync()so buffered writes are persisted correctly on remote filesystems such as GCS (#183877) - Fix repeated
hipMemMapcalls causing symmetric-memory failures on ROCm (#188673) - Fix custom backend registration with a string
devicesargument incorrectly registering each character as a device type (#187960) - Fix FSDP
summon_full_params(offload_to_cpu=True)accessing freed storage when the flattened parameter is already on CPU (#188990) - Include the local device in compiled DTensor cache keys so ranks cannot reuse kernels compiled for another device (#188401)
- Prevent stale symmetric-memory signal data when virtual addresses are reused by placing and clearing the signal pad at the front of each allocation (#189088)
- Fix collective validation, sequence tracking, complex tensors, barriers, and work cleanup in the experimental
nccl2backend (#190138) - Preserve container object identity when FSDP recursively moves values but their elements do not change (#171617)
- Make compile-on-one-rank graphs resolve process groups from their device mesh at runtime instead of serializing rank-specific process-group objects (#188215)
- Fix
torch.distributed.nn.functional.broadcastproducing a zero source gradient for subgroups whose local and global source ranks differ (#190583) - Create TorchComms subgroups on the calling rank's actual device, including under launchers that do not set TorchComms rank variables (#189072)
- Fix work-object and expandable-segment allocator lifetimes in the experimental
nccl2backend (#190370) - Return
GroupMember.NON_GROUP_MEMBERconsistently from locally synchronizednew_groupcalls on nonmember ranks (#190588) - Support the linear
avgreduction in functionalall_reducebackward instead of rejecting it after a successful forward pass (#190224) - Prevent subgroup creation hangs and duplicate-finalization crashes by making subgroup-name salts rank-consistent and finalizing each communicator once (#189073, #189074)
- Fix single-operation point-to-point completion ordering and synchronous barrier semantics in the experimental
nccl2backend (#190622, #190682) - Allow NCCL symmetric memory to use communicators created by the experimental
nccl2backend (#191109) - Normalize
new_groupranks through Python's integer protocol so tensor integer ranks work and non-integral values fail clearly (#191377) - Fix simulated
all_to_all_singlewith uneven split sizes inLocalTensorModeand raise a clear error for inconsistent splits (#190311) - Accept device-qualified Gloo backends in
monitored_barrierwhen TorchComms is enabled (#189070) - Prevent
CommDebugModehooks from leaking or double-running when a module executes more than once (#191452) - Warn when symmetric-memory collectives are launched concurrently on multiple streams, which can otherwise deadlock (#191482)
- Choose a process group's default backend only from backend types that were actually registered (#189193)
- Report the correct group-local rank and process-group identifier in NCCL work timeout and error logs (#191440)
- Preserve the caller's current CUDA device in the experimental
nccl2backend and validate full device identities (#191510) - Validate all-to-all split sizes consistently across Gloo, NCCL, and
nccl2(#191511) - Prevent destroying one TorchComms subgroup from inadvertently destroying every live group (#191637)
- Propagate
device_idthroughProcessGroupWrapperso debug wrappers do not hang with heterogeneous rank-to-GPU mappings (#182273) - Forward group identifiers through
nccl-lazyso NCCL symmetric-memory rendezvous can find the primary communicator (#191544) - Reject unsupported reconfigurable mode for
nccl-lazyinstead of advertising incomplete membership-change support (#191549) - Disable NCCL NVLS in
nccl2when deterministic algorithms are enabled, matching the legacy NCCL backend (#192104) - Prevent
nccl2watchdog errors, timeouts, explicit aborts, and normal teardown from unconditionally terminating the process (#192105) - Fix Gloo and NCCL
split_groupcrashes when the world process group was not the first backend instance created in the process (#192106, #192109) - Fix device-bound
nccl2process-group initialization failing before the CUDA caching allocator has been initialized (#192107) - Give split and merged process groups independent backend options so child creation cannot corrupt parent metadata or share mutable options (#192110)
- Fix
split_group(backend=...)filtering for parent groups created with a bare backend name (#192111) - Prevent private
TCPStorerendezvous undertorchrunfrom hanging by using the agent store only for the agent's own address (#192113) - Fix
bfloat16NCCLPREMUL_SUMfactors being interpreted as zero and silently producing zero gradients (#190747) - Fix a use-after-free race while concurrently dumping Flight Recorder entries (#192232)
- Run symmetric-memory allocation and rendezvous device work on the caller's current CUDA stream (#192308)
- Recognize libuv's lowercase
address already in usemessage when TorchElastic retriesTCPStorecreation (#191561) - Add missing collective-fingerprint checks for
allgather_into_tensor_coalescedunderProcessGroupWrapper(#185123) - Fix DTensor AOT compilation misclassifying overload names containing
outas output-variant operators (#187466) - Fix compiled functional point-to-point collectives that pass global peer ranks to subgroup operations requiring group-local ranks (#187924)
- Preserve pipeline-stage module buffers while dynamic metadata inference runs representative forward and backward passes (#188558)
- Fix DTensor backward support for
cumprod,cummax, andcummin(#185228) - Make pipeline schedules select static metadata locally when a fake process group cannot perform cross-rank metadata inference, and report incomplete stage metadata clearly (#191538)
- Restore the caller's cyclic garbage collector state after Flight Recorder
read_dir()calls, including when loading fails (#191607)
Distributed (c10d)
- Fix
destroy_process_group()hanging after collectives run on partially split process groups by keeping group names consistent across ranks (#190431)
DTensor
- Fix compiled functions failing when they return DTensor permutation views such as
transpose,permute, ormovedim(#191784) - Fix deferred
local_mapexport failing inside nested compile regions (#186647)
Linear Algebra Frontend
- Fix
torch.linalg.cond()reporting a misleading overflow error for a complex norm order; invalid orders now raiseValueErrorwith a clear message (#188591) - Fix
torch.lu_unpacksegfaulting whenLU_pivotshas a shape inconsistent withLU_data; invalid shapes now raise a clear error (#187660) - Fix
torch.linalg.lstsq(driver="gelsy")returning an incorrect rank on CPU when stale pivot values leaked between batched LAPACK calls (#187436) - Fix
torch.compile(dynamic=True)failing ontorch.linalg.condwithp="fro"orp="nuc"because symbolic tensor sizes were queried as concrete values (#187614) - Fix offline
TunableOptuning silently using the wrong GEMM shape when a padded leading dimension matches another matrix dimension (#189355) - Fix
CUBLAS_STATUS_NOT_SUPPORTEDfailures in matrix multiplication on CUDA compute capability 11.0 by increasing the default cuBLAS workspace to 32 MiB (#189312)
Indexing
- Reject nonempty
torch.unravel_index()inputs whoseshapecontains a zero-sized dimension with a clearValueErrorinstead of an uncaught division-by-zeroRuntimeError; empty indices remain supported (#191092) - Fix assigning Python integers greater than
INT64_MAXintotorch.uint64tensors, which previously raisedOverflow when unpacking long long(#191604) - Fix an illegal CUDA memory access in
torch.nn.functional.adaptive_avg_pool2dbackward for very large contiguous tensors whose element offsets exceed 32-bit indexing limits (#189082)
Profiler
- Exclude individual Python function events from
key_averages()by default so frames such asthreading.py: waitdo not obscure operator-level hotspots; passinclude_python_functions=Trueto retain the previous view (#188631) - Clamp incomplete Python function events to their parent event's end time so exported traces retain correct nesting instead of placing overrunning events on unrelated tracks (#190950)
- Avoid importing the experimental CUPTI monitor during ordinary
record_functionprofiling, preventing repeated warnings and tracebacks on systems with incompatiblecupti-pythonversions (#187874) - Fix reference leaks when reading the
layoutanddtypeproperties of profiler tensor metadata (#187068)
FX
- Respect deferred runtime-assert bounds when deriving optimization hints for unbacked symbolic sizes, preventing negative storage sizes and downstream CUDA indexing failures (#190589)
- Make selected Dynamo, Inductor, and FX tracing state thread-local to prevent race conditions when
torch.compileis invoked concurrently from multiple threads (#168999) - Fix FX
GraphModuleserialization when generated code contains string type annotations (#185051) - Fix scripting FX-generated modules with nested
Optional[Dict[...]]annotations on Python 3.14 (#190580) - Skip constant folding for
get_attrnodes whose targets cannot be resolved or refer to modules (#191939) - Preserve non-persistent buffer registration when an FX
GraphModulecopies attributes, keeping those buffers out ofstate_dict()(#191708) - Fix Z3 translation validation for graphs containing symbolic boolean negation through
torch.sym_not(#185147) - Fix FX-generated code raising
NameErrorfor complex constants whose imaginary component isnanorinf(#188596) - Preserve signed zero when FX code generation emits complex constants with a zero real or imaginary component (#185550)
- Apply
skip_folding_node_fnrecursively tocall_modulesubgraphs so FX constant folding does not evaluate skipped or symbolic nodes inside them (#189487) - Return valid
tuple[...]annotations fromget_signature_for_torch_opfor operators that return multiple tensors (#189142) - Avoid a
linecacheloader warning when executing generated FXGraphModulecode on Python 3.15 (#187221)
Dynamo
- Match CPython errors for invalid
next,set, andfrozensetcalls (#190624, #189051) - Fix
torch.compiler.nested_compile_regiongraph reuse, eager autograd, graph capture, and transposed captured buffers (#192006, #184700, #186137, #191785) - Fix nested graph breaks involving generators, hooks, context managers, custom operators, comprehensions, f-strings, and
DeviceMeshsubmeshes (#188622, #191388, #187088, #191264, #191523, #189601, #187005, #187701, #188861) - Fix
eager_then_compilefor higher-rank inputs (#184689) - Fix precompile caches, package globals, and guard serialization for tensor subclasses,
torch.func, and autocast (#191128, #191418, #190576, #191428, #184850, #187736, #184562) - Fix tensor-subclass metadata guards, fake-mode re-entry, metadata replay, and stale metadata after in-place mutation (#184684, #176977, #185732, #187057, #187890)
- Fix compiled class definitions, scalar-tensor indexing, non-module globals, and conditional hook handles (#185998, #184625, #184653, #184712)
- Graph-break on forward-AD dual tensors instead of silently dropping tangents;
fullgraph=Truenow errors (#189644) - Preserve
ctx.needs_input_grad, autocast state, overlapping-view storage,vmapgradients, and captured FlexAttention gradients (#191492, #186530, #187111, #186362, #188869) - Fix compiled-method attribute reads,
TorchDispatchModeskip state, symbolic lazy modules, and stale tracing weak references (#190185, #190287, #188595, #190951) - Preserve dynamic f-string formatting and Python-side mutation order across graph breaks (#189830, #182638)
- Match Python semantics for
vars, pybind enums, pytree equality, call errors, numeric conversion, descriptors, customisinstance, deque reinitialization, sequence/set operators, subclass types, slice errors, and attribute probing (#185128, #188605, #190649, #190797, #190257, #190776, #186491, #188171, #189554, #189274, #189145, #187777, #190970) - Fix Python 3.12 exception tables and free-threaded/Python 3.15 list-comprehension bytecode (#185731, #187086, #187103)
- Fix TorchScript backends, CUDA repro probing, and backend device/dtype classification while preserving third-party minifier configuration (#188875, #185843, #190425, #190426, #187855)
- Fix self-referential backward-compiler state when AOTAutograd compiles a second graph (#189325)
Inductor
- Fix handling of
torch.combinations, indexedrandperm, dynamic-output custom ops, tensor-subclass standalone compilation,torch.condconstants, duplicate kernel registrations, genericassociative_scan, dynamic combo reductions, empty scatters, autogradexpand, tuple graph outputs, aliased FX outputs, and fused positional arguments (#189305, #184066, #185601, #185638, #185838, #186262, #186633, #187275, #188466, #188758, #189887, #190255, #190976) - Match eager arithmetic, validation, dtype, NaN/infinity, signed-zero, and overflow semantics across
addmm, remainder, min/max, low-precision scalar math, unsignedabs, CELU, Bessel functions, multiply-by-zero folding,signbit, floor division,cummax/cummin,cumsum, adaptive pooling, index propagation, and CPU integer arithmetic (#183511, #185168, #185970, #186818, #186933, #187024, #187321, #187354, #187580, #187941, #188049, #188361, #188556, #188862, #190328, #190427, #190531, #190566, #191132) - Fix wrong or unstable results in CPU outer-loop and Halide fusion, nested/split/TMA reductions, MPS special functions, scheduler-recomputed gradients, CPU
expm1, small transposed GEMMs, and noncontiguousuniform_(#185855, #186121, #188771, #189291, #189896, #185873, #190533, #191127, #191709, #192344) - Fix CPU code generation for vectorized atomics and boolean
index_put_, including an out-of-bounds atomic that could produce wrong results; fix max-autotune failures with reused GEMM inputs or outputs and zero-hinted symbolic rows (#185325, #185767, #186523, #191502, #191861, #192553) - Fix
_scaled_mmscale-shape compilation; fall back safely for_scaled_mm_v2with swizzled MXFP8/NVFP4 scales; and fix complex signatures,float8storage, dtype bitcasts, and CUTLASS INT8 target filtering (#183964, #185501, #186384, #188209, #189561, #189584, #192414) - Fix convolution and attention pattern selection or fallback correctness for dynamic bias, transposed or dilated convolution, CUDA convolution backward,
ConvTranspose2d, and unsupported 3D SDPA key permutations (#184132, #186067, #187372, #189660, #191260) - Fix dynamic-shape and symbolic-expression failures in split ranges, adaptive pooling, AOTI autotuning, regional wrappers, TMA
addmm,torch.cond, fused epilogues, stride guards, tiling, and FX wrappers (#184566, #185369, #185778, #185890, #187371, #189529, #189890, #190965, #191605, #191811) - Prevent index-expression overflow, unsound loop-index inversion, and negative modular-term miscompilations (#186060, #189108, #190401, #190966)
- Fix FlexAttention errors and wrong results involving large or sliced buffers, invalid
score_mod, kernel options, sparse masks, and mixed or 64-bit captured indices (#185264, #185991, #186876, #187886, #187904, #188484, #188876) - Fix ordering and races in multi-stream event/control-dependency graphs, aligned input copies, bidirectional synchronization, replacement-created intermediates, captured events, and cross-warp reductions; honor
torch.use_deterministic_algorithms()for compiled scans (#183803, #183804, #186022, #186023, #186025, #187224, #188533, #189095, #189096, #190519, #191714) - Fix premature reuse, leaks, and races in memory planning, cached launchers, failed autotuning, dynamic reduction caching, mutation dependencies, fallback storage reuse, and saved compiler-cache loading (#187678, #188607, #188907, #189124, #189288, #189735, #192526)
- Reject incompatible custom-Triton epilogue fusion, fall back when descriptor alignment or template tiling is unsupported, and serialize custom-kernel
Enummetadata correctly (#184248, #186922, #186932, #187209, #189494) - Fix CUTLASS and NVGEMM compilation, worker initialization, XPU wrapper selection, reshaped epilogues, newer CuTeDSL compatibility, target filtering, cache reentrancy, and CUDA Graph outputs (#186385, #186791, #187404, #188865, #189775, #189780, #189781)
- Gate TF32 warnings, use an NVML clock-rate fallback, report CUDA Graph skip reasons, fix CUDA Graph capture for
torch.linalg.eigh, and suppress internalTypedStoragewarnings (#185541, #187427, #188384, #188641, #191383) - Fix imports, compiler probes, workers, template decoding, and generated builds across vendored
typing_extensions, localized MSVC output, initialized CUDA, Windows path limits, Python 3.11/3.12, UTF-8 templates, dead workers, and library paths containing spaces (#185708, #185972, #187408, #187641, #187700, #189196, #189290, #191010) - Fix AOTInductor floor division by captured tensor constants, CUDA architecture packaging, and constant-graph code generation with lazy autotuning (#186242, #187888, #190073)
- Fix duplicate MPS Metal kernel names and XPU compiled RNG or quantized tensor-subclass handling (#187894, #189310, #189509)
- Fix manual collective-bucketing graph order and register DTensor shard-all-to-all autograd while adding an opt-in functional decomposition (#187341, #188137)
- Restrict ROCm Origami GEMM selection to static shapes to avoid dynamic-shape
NoValidChoicesError(#190024)
Ahead-Of-Time Inductor (AOTI)
- Fix compilation and dispatch failures for C++ wrapper fallback operators with
Anyarguments, including distributed operators such asall_gather_into_tensor(#188124) - Route custom operators with
SymInt,SymBool, orSymFloatarguments through boxed C++ wrapper dispatch, avoiding runtimeAPI call failederrors (#188154) - Box
Nonepassed to non-optional tensor arguments as an undefined tensor in C++ wrappers, matching eager custom-operator behavior (#188485) - Prevent C++ wrappers from dereferencing a null tensor handle when a Python fallback operator returns a one-element
Tensor[](#190551) - Emit portable
std::array::data()pointers in generated CPU wrappers instead of relying on iterator-to-pointer conversion (#191240) - Package AOTInductor CUDA multi-architecture kernels for the requested deployment architecture instead of the physical compilation GPU (#185328)
- Fix AOTInductor C++ wrappers recovering integer symbols from composed dynamic sizes through floating-point division, which could truncate valid runtime dimensions (#185841)
- Fail fast with a clear error when loading a CUDA AOTInductor package in a process without CUDA or ROCm available (#186943)
- Fix C++ wrapper fallback output indexing for mutable custom operators and remove invalid 16-byte alignment assumptions for misaligned tensor views (#187331)
- Preserve C++ wrapper input slots when graphs contain Python-only custom-class inputs (#188030)
- Pass the device the model was actually loaded on to custom operator fallbacks, instead of the device recorded when the model was compiled. Previously a model compiled for one GPU and then loaded on another would hand the wrong device to its custom ops (#184741)
- Synchronize the default stream after copying model constants on AMD GPUs, fixing a race in which inference could read constants before the copy had completed (#186963)
- Fix a 32-bit integer overflow when computing the SYCL global launch range in the AOTInductor runtime, which produced incorrect launch dimensions for large grids on XPU (#187307)
- Release AOTInductor input tensor handles when runtime input validation fails, preventing a GPU memory leak (#189503)
- Release untransferred AOTInductor constants when runtime constant folding fails, preventing a memory leak on the error path (#189505)
- Prevent an AOTInductor constant-folding segmentation fault on XPU when no stream is provided (#189517)
- Make the C++ wrapper's debug synchronization device-aware, fixing a regression on ROCm (#190071)
- Fix a missing CUDA header in the generated constant graph when compiling with the dual-wrapper, which made the generated code fail to compile (#191050)
- Skip CUDA stream event code generation in the AOTInductor C++ wrapper on XPU, where those APIs do not apply (#190637)
Export
- Fix
torch.exportdynamic-shape specifications for functions with**kwargs, accepting both call-like keys and specs nested under the variadic parameter while reporting ambiguous name collisions asUserError(#185730) - Prevent
ExportedProgram.module()from raisingRecursionErrorwhile generating guard messages for deeply nested symbolic-shape expressions (#186993) - Fix
torch.export.unflattenfailing to restore parameters, buffers, and constants for non-contiguously numbered repeated module calls (#188185) - Fix strict export of parameters from modules stored in unregistered Python containers by treating the traced-only parameters as constants instead of attempting to restore them from the eager module's state (#185728)
- Fix non-strict export of tensor indexing under
vmapwhen the index is a batched scalar tensor (#186894)
AOTDispatcher
- Resolve nested
AsyncCollectiveTensorinputs before AOTAutograd tracing so compiled forward execution waits for in-flight data and backward metadata expects the correct local-tensor cotangents (#186442) - Prevent activation-memory-budget partitioning from crashing with
expected all tensors_saved_with_vc_check to be Tensors, got [Tensor, tuple]when a required multi-output node is markedMUST_SAVE(#188014) - Prevent AOTAutograd common-subexpression elimination from merging forward-only values with nodes required by backward, preserving correct partitioning and reduction fusion (#184044)
- Fix backward graphs missing symbolic-integer bindings by preserving both raw symbols and their ShapeEnv replacement targets, preventing unbound guard expressions and
FxGraphCachelookup failures (#185473, #189783) - Fix incorrect alias-output slicing when Inductor clones a misaligned input (#191002)
- Move
invoke_subgraphinference-mode input mutations to the AOT epilogue so they are applied correctly (#191672) - Fix
control_depshandling in the partitioner during forward/backward extraction (#187695) - Support mutable (
Tensor!) custom ops in input-mutatinginvoke_subgraphregions by routing them through Python functionalization (#189543) - Fix common subexpression elimination (CSE) to correctly deduplicate NaN constant tensors by normalizing float/complex hashing and comparison (#191173)
Composability
- Raise
NotImplementedErrorfor unsupported Boolean operations and distinguish unsupported FFT dtypes from invalid real/complex domains withNotImplementedErrorandTypeError(#192348, #192349) - Preserve eager identity semantics for no-op dropout decompositions, preventing
torch.compileandtorch.exportfrom replacing aParameterwith a cloned fake tensor when dropout is disabled (#185335) - Fix compiled
torch.nn.functional.multilabel_margin_lossvalues and gradients when targets use-1padding (#189552) - Fix
torch.nansummeta output shapes whendim=()should reduce all dimensions (#191530) - Make the
constant_pad_ndreference decomposition fully functional sotorch.onnx.export(dynamo=True)no longer fails functionalization for models usingtorch.nn.functional.pad(#185636) - Keep
torch.istftlength clamping and padding symbolic under dynamic shapes, avoiding recompilation and data-dependent guard failures when the requested length crosses the signal length (#186490) - Make compiled and fake/meta
torch.aminmax(..., out=...)enforce the same exact output-dtype requirements as eager execution (#186227) - Make compiled
torch.nn.functional.celurejectalpha=0with the same error as eager execution (#179375) - Avoid data-dependent guard failures in fake/meta tracing of native multi-head attention with unbacked symbolic sizes (#187144)
- Avoid data-dependent guards in
torch.nn.utils.rnn.pad_sequencedecompositions when sequence lengths are symbolic (#187145) - Make the CUDA
native_layer_normdecomposition reject mixed affine-parameter dtypes in the same cases as eager execution (#185693) - Fix incorrect compiled output and gradients for overlapping-input
torch.diagonal_scatteroperations (#182292) - Match compiled
max_unpool2doutput strides and channels-last memory format to eager CPU execution (#186602, #187195) - Route meta
viewoperations through the symbolic-shape-aware kernel, avoidingSymIntArrayRef expected to contain only concrete integersfailures (#189447) - Avoid data-dependent guard failures in the transformer encoder layer meta kernel when the input size is an unbacked symbol (#187860)
- Prevent fake/meta decompositions of in-place operations from silently resizing their destination when operands cannot broadcast to its shape; compiled execution now raises the same shape error as eager execution (#191373)
- Preserve symbolic tensor, scalar, and unbacked-binding metadata across
ProxyTensorandmake_fxtracing (#187231) - Preserve loop-local value ranges and use known ranges when simplifying symbolic
MinandMaxexpressions, avoidingvr must not be Noneand spurious data-dependent guard failures (#187350, #186248) - Fix symbolic proxy tracing and repeated lowering edge cases involving natural powers,
torch.condcontiguous-stride expressions, and equivalent rebound unbacked symbols (#188278, #189525, #190083) - Fix silently incorrect second-order gradients from post-dispatch
make_fxtracing by decomposingdetachby default; callers that provide an explicit decomposition table retain the previous behavior (#186845)
Quantization
- Fix a divide-by-zero crash (
SIGFPE) intorch.quantize_per_channelon the per-channelfloat_qparamspath for theqint32dtype; whole-byte quantized types now pack correctly instead of underflowing the packing factor to zero (#186767) - Add the missing overflow check to the FBGEMM build of the ARM
quantize_valpath, fixing incorrect quantized values that showed up as quantization test failures on some hardware (#187481) - Fix a GPU memory access fault that aborted quantized
embedding_bagbyte and 4-bit rowwise lookups on ROCm, caused by a bitwise-AND typo in the bit-field extraction primitive (#192571)
Foreach
- Prevent out-of-bounds metadata writes in CUDA foreach operations with complex scalar lists by respecting their reduced per-launch tensor capacity (#189915)
ONNX
- Fix signed right-shift export in the TorchScript exporter so negative values round toward negative infinity as they do in PyTorch (#191226)
- Fix quantized
gatherexport by unpacking quantized tensor inputs before lowering (#188272)
C++ Frontend
- Fix a memory leak when converting
StableIValuetostd::string(#190493) - Remove
noexceptfromTensorMaker::computeStorageSize()(#188062) - Fix uninitialized return in Chebyshev polynomial helpers for NaN inputs (#187767)
- Guard the
Scalar(long long)constructor on NetBSD and other LP64 BSDs (#188941) - Replace
FileBatonwithfilelockto prevent stale-lock deadlocks inCppExtension(#190543) - Fix floating-point-to-integer range checks at wide-integer boundaries in
c10/util/overflows.h(#190651)
Build Frontend
- Fix source-build linker failures on systems where CMake reordered static and shared libraries by linking
libcpuinfothrough thec10shared library instead of linking it separately into bothc10andtorch_cpu(#167328) - Fix Windows ARM64 builds failing to register a CPU quantized backend by recognizing the uppercase
ARM64CMake processor name and enabling oneDNN (#189346)
Release Engineering
- Fix invalid ZIP64 archives for ROCm wheels larger than 4 GB by repackaging them with
auditwheel(#189903) - Prevent an intermittent deadlock during
import torchwith ROCm wheels by shipping a bare.soalias (#189114) - Fix missing CUDA dependencies when extracting LibTorch from a wheel, which previously left the extracted tree with unresolved RPATHs (#184336)
CUDA
- Fix CUDA graph kernel-annotation remapping across sequentially captured graphs and with
keep_graph=True(#186638, #187741) - Fix a heap overflow in
CachingHostAllocatorwhen rounding is disabled (#192722) - Preserve signed zero in
reluandclamp(#185354) - Fix
int32overflow inembedding_bag(mode="max")backward (#188661) - Include CUDA graph memory pools in
memory_reserved()(#186809) - Use 64-bit sample offsets in
NLLLoss2dbackward (#190144) - Fix remap extents, causal key bounds, and 32-bit dropout offsets in memory-efficient attention (#192138)
cuDNN
- Fix cuDNN variable-length SDPA (#172108)
- Disable cuDNN convolution engines 58 and 63 on
sm120to prevent illegal memory accesses (#190112) - Declare the attention-mask dtype to cuDNN instead of inheriting the graph I/O dtype (#191612)
- Update the cuDNN errata filter for
sm120(#191701)
CPU (x86)
- Fix incorrect results from CPU flash SDPA when the innermost dimension of the inputs is not contiguous (#187506)
- Prevent the Laguerre and Legendre polynomial kernels from returning uninitialized memory (#188027)
CPU (AArch64)
- Fix an integer overflow in the
bfloat16/float16GEMM staging-buffer size calculation, which could corrupt results or crash on large matrix multiplications (#191096) - Fix CPU
embedding_bagusing the wrong index count forscale_grad_by_freq, producing incorrect gradients (#190264)
MPS
- Fix compiled MPS operations such as
torch.eye(256)failing withKeyErrorwhen Inductor generates unsigned 16-, 32-, or 64-bit index expressions (#192020) - Preserve the MPS dispatch key through
torch.functransforms so MPS autocast and autograd work under transforms such asvmapandgrad(#187282) - Reject complex MPS average-pooling inputs with
NotImplementedErrorinstead of an internal MPSGraph error (#187671) - Propagate NaNs correctly through MPS scaled dot-product attention kernels (#188147)
- Raise a clear error when MPS batch normalization receives an unsupported dtype (#188265)
- Fix corrupted MPS prefill-attention output on macOS 26 by selecting the correct Metal cooperative-tensor ABI (#191794)
- Fix Metal argument alignment that could make MPS kernels fail validation or crash under the Metal debug layer (#191640)
- Fix
torch.hypotproducing incorrect results for extreme values (#192541) - Handle empty indices in MPS
index_addand empty dimensions in threshold,baddbmm, andaddbmmoperations (#186990, #187719, #188808, #187879) - Fix
mmandaddmmwith strided output tensors on macOS 14 and 15 (#187255) - Respect
storage_offsetwhen an MPS binary operation consumes a zero-dimensional CPU tensor view (#187229) - Make MPS
baddbmmfollow its documented behavior by not propagating NaN or infinity from the input whenbeta=0(#187522) - Fix MPS linear backward for inputs with more than four dimensions and prevent complex high-rank linear operations from aborting on macOS 27 (#187379, #190352)
- Prevent
BatchNormbackward from crashing for channels-last MPS tensors (#188371) - Fix incorrect MPS Conv2d output when a kernel spatial dimension is at least 256 (#188359)
- Match CPU and CUDA nonfinite-value semantics for MPS
torch.div(..., rounding_mode="floor")(#189252) - Make MPS-backed pinned memory correctly appear as a CPU tensor while retaining its shared Metal buffer (#181720)
- Prevent dtype-converting MPS-to-CPU copies from overwriting their source and correctly copy non-dense views with matching strides (#189572, #189966)
- Compute integer absolute values exactly instead of rounding through
float32(#190053) - Handle zero
in_featuresin MPS linear forward and backward without aborting (#190051) - Fix
torch.nextafterreturning its input unchanged for MPSbfloat16tensors (#190481) - Preserve exact integer values in MPS
torch.linspacefor large ranges (#189630) - Fix
int64minimum and maximum reductions returning zero when a partial SIMD group contains only negative or positive values (#191104) - Fix adaptive max pooling for input sizes that are not divisible by the output size (#189659)
- Fix large matrix multiplications producing incorrect results on M1 and M2 GPUs (#183535)
- Keep MPS exponential samples strictly positive so
torch.multinomial(..., 1)cannot select a zero-probability entry (#192621) - Make CPU and MPS
torch.logitagree with other backends wheneps > 0.5(#181297) - Fix MPS FFT operations when a transformed dimension is not among the tensor's final four dimensions (#186967)
- Fix
torch.nn.functional.lineardropping its bias for vector-shaped inputs on macOS 26 (#188619) - Raise clear unsupported-dtype errors for complex MPS inputs to
cummax,cummin, andlogaddexp2(#188038, #188800) - Fix MPS ternary-kernel dispatch for large tensors and mixed-dtype
out=tensors, includingtorch.clamp(#189624) - Apply inter-layer dropout correctly in MPS LSTM backward and avoid NaNs when
dropout=1(#190059) - Improve MPS layer-normalization correctness for small-variance rows and add 64-bit indexing support (#190492)
- Fix biased MPS linear operations corrupting rows when a batch dimension exceeds 2^16 (#189496)
- Validate MPS
EmbeddingBagoffsets consistently with CPU and CUDA instead of silently returning incorrect results (#187572) - Support
float32affine parameters withfloat16orbfloat16MPS layer normalization in forward and backward (#190055) - Match CPU and CUDA RMSNorm precision by performing the fused affine multiplication in float32 (#189617)
- Fix Conv2d forward and backward with non-contiguous MPS weights (#192303)
- Raise clear unsupported-dtype errors for complex
igamma/igammacand booleantorch.linalg.crossinputs on MPS (#188134, #187274) - Prevent intermittent crashes when stopping a Metal capture by draining work from all active MPS streams first (#191362)
ROCm
- Fix
torch.nn.functional.interpolatewithmode="nearest"failing on large channels-last inputs withtorch.AcceleratorError: HIP error: invalid configuration argument. The channels-lastupsample_nearest2dforward kernel launched a grid whose total thread count exceeded HIP'sUINT32_MAXlimit once the output approached 2^32 elements; this was a regression from 2.9 that showed up in diffusion VAE decode at large batch sizes (#180310) - Fix incorrect
torch.nn.LayerNormresults for tensors with a very large number of rows when the normalized size is not a multiple of 4. The non-vectorized fallback exceeded HIP's launch limit; it now uses a grid-stride loop over rows (#186956) - Fix
torch.cuda.make_graphed_callablesfailing to capture, or hanging, on ROCm when the callable uses hipBLASLt. Warmup and capture now run on the same stream so the hipBLASLt handle is created and cached before capture instead of being lazily created mid-capture (#187745) - Fix graph-capture error handling on ROCm 7.14 and later by using HIP's native capture errors instead of the compatibility precheck required by older ROCm versions (#187110)
- Fix transposed convolution failing with
miopenStatusBadParmwhen the computed spatial output is zero-sized. MIOpen rejects zero-length tensor descriptors, so these cases now short-circuit to an empty output (and zero gradients in backward), matching cuDNN and CPU behavior (#187431) - Fix a meta-kernel shape mismatch for memory-efficient scaled dot product attention on ROCm. The meta registration padded the log-sum-exp dimension to a 32-element alignment as CUDA does, while the ROCm backends return a compact log-sum-exp, breaking nested tensor SDPA backward and
torch.compile(#190723) - Fix the memory-wait instructions used by the atomic-store commit path on
gfx10,gfx11, andgfx12GPUs. These architectures have separate load and store counters, andgfx12renames the wait instructions, so the wrong instruction was previously emitted (#188067) - Fix failures when building HIP C++ extensions on Windows with
Don't know how to compile <file>.hip..hipsources produced by hipify are now registered with the MSVC compiler so they are dispatched tohipcc(#187665) - Fix out-of-bounds accesses in CK SDPA for tile-unaligned shapes by padding sequence-length allocations (#187152)
XPU
- Fix compiled
torch.signbitforfloat64inputs on XPU by avoiding an incorrect Triton XPU signature (#188818) - Fix compiled
multi_margin_losswith weights on XPU by using one-dimensional indexing in its decomposition (#188770) - Handle empty tensor inputs correctly in XPU
addmv(#174193) - Fix oneDNN SDPA with GQA and a broadcasted mask on XPU (#190503)
- Fix
max_unpool2dchannels-last stride mismatch on XPU (#190189) - Fix
bmm_outer_productTriton override to support XPU tensors (#188783) - Raise
RuntimeErrorinstead of crashing when XPU cannot allocate a pinned host-memory buffer (#189681) - Route
GPU_USER_ANNOTATIONKineto profiler events toDeviceType::XPU(#191841)
Functorch
- Fix a crash in
torch.func.vmapwhenout_dims=-1and the mapped function returns an output that is independent of its vmapped input (#178495)
JIT
- Make TorchScript reject bare
listandtuplevalue annotations consistently withAttempted to use list without a contained typeor the equivalent tuple error; specify an element type such aslist[int]instead (#188779) - Fix runtime compilation of JIT fuser kernels on ROCm 7 when HIPRTC's
bfloat16conversion symbols collide with PyTorch's embedded definitions (#185656) - Fix
torch.jit.scriptfailing withCannot re-assign modules in a ScriptModule with non-scripted modulewhen a wrapper contains an already-scripted child with a__jit_ignored_attributes__submodule (#187863)
Sparse Frontend
- Create cuSPARSELt handles per device so sparse operations remain valid when a thread switches between CUDA devices (#189048)
- Make grouped-matrix, batch-normalization, and sparse-matrix operations on ROCm Windows raise clear unsupported-operation errors instead of crashing with access violation
0xC0000005when optional libraries are unavailable (#191680)
Performance
Python Frontend
- Reduce Python custom-op dispatch overhead and speed up CPU quantiles with partial selection (#187949, #186175, #188394)
torch.nn
…