Skip to content

Upgrading torch 1 to 2

Breaking1.13.1 → 2.15.0Breaking215Security40Platform9Deprecated98New3009Changed2330Fixed3803Other984

Fetching 28 releases from GitHub…27 / 28
BreakingUpgrade verdict

212 breaking changes and 9 platform requirement changes and 40 security fixes.

  • A memory-saving option for the linear cross entropy loss was removed. Use the "compact" setting instead, which gives the same precision with less memory.
  • The old Cholesky function is gone; use torch.linalg.cholesky() instead and take .mH for the upper-triangular result.
  • The old QR function is gone; use torch.linalg.qr() and replace the some argument with mode.
  • Passing use_cuda to either profiler now raises TypeError; select CUDA through activities or use_device instead.
Top 5 of 357 that need code or config changes

torch publishes an official migration guide for version 2. It covers more than the release notes do.

Guide ↗

Python requirement changed in 2.15.0: >=3.7.0 → >=3.11.

Adds cuda-bindings <14,>=13.0.3, cuda-toolkit ==13.2.2, filelock, fsspec >=0.8.5, jinja2, networkx >=2.5.1, nvidia-cudnn-cu13 ==9.26.0.51, nvidia-cusparselt-cu13 ==0.8.1, nvidia-nccl-cu13 ==2.30.7, nvidia-nvshmem-cu13 ==3.7.2, setuptools >=77.0.3, sympy >=1.13.3, triton ~=3.9.0.

Drops nvidia-cublas-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-runtime-cu11, nvidia-cudnn-cu11.

Installs 28 packages in all (was 8).

Breaking212
torch.nn.LinearCrossEntropyOptions no longer accepts acc_policy="balanced"; use "compact" instead.
torch.nn.LinearCrossEntropyOptionstorch.nn.functional.linear_cross_entropyacc_policy
Removes the deprecated torch.cholesky() and Tensor.cholesky() APIs, which now raise RuntimeError.
torch.choleskyTensor.choleskytorch.linalg.cholesky
Removes the deprecated torch.qr() and Tensor.qr() APIs, which now raise RuntimeError.
torch.qrTensor.qrtorch.linalg.qrsomemode
Removes the deprecated use_cuda argument from torch.profiler.profile and torch.autograd.profiler.profile.
torch.profiler.profiletorch.autograd.profiler.profileuse_cudaactivitiesuse_device
Makes the Dynamo tvm backend use TVM's relax frontend exclusively and removes the relay path.
torch.compiletorch._dynamo.backends.tvmtvm_meta_scheduletvm_auto_schedulerschedulertrialspipeline
Removes the deprecated zero-argument C++ overloads c10::Scalar::isIntegral() and c10::isIntegralType(ScalarType).
c10::Scalar::isIntegralc10::isIntegralTypeincludeBool
Renames the C++ MPS macOS-version helper to at::mps::is_macos_at_least() and drops VER and PLUS from MacOSVersion member names.
at::mps::is_macos_13_or_newer()at::mps::is_macos_at_least()MacOSVersionMACOS_VER_15_0_PLUSMACOS_15_0<ATen/mps/MPSDevice.h>
Replaces the removed partitioned_scatter_memory_budget setting with memory-headroom controls and enables partitioned-scatter by default on ROCm.
partitioned_scatter_memory_budgetpartitioned_scatter_enabled
Removes Bazel build support; users should migrate to the CMake or pip install build flow.
bazel
Replaces StorageImpl's built-in copy-on-write materialization with a pluggable MaterializeFn hook, removing the old COW entry points.
StorageImplStorageImpl::is_cow()StorageImpl::maybe_materialize_cow()cow::materialize_cow_storage()MaterializeFnc10::impl::cow::materialize_cowset_materializer()has_materializer()
Storage COW API changes: is_cow() and maybe_materialize_cow() are replaced by set_materializer() and has_materializer().
storage.is_cow()storage.maybe_materialize_cow()storage.set_materializer()storage.has_materializer()c10::impl::cow::materialize_cow
Removes the named tensor feature and all associated Python and C++ APIs.
Tensor.namesTensor.rename()Tensor.refine_names()Tensor.align_to()Tensor.align_as()torch.align_tensors()names=Dimname
torchrun now defaults to an OS-assigned free port for single-node training instead of port 29500.
torchrun--master-port--standalonePET_MASTER_PORT
Inductor max-autotune now defers layout freezing by default, changing autotuning behavior.
torch._inductor.config.max_autotune_defer_layout_freezingTORCHINDUCTOR_MAX_AUTOTUNE_DEFER_LAYOUT_FREEZINGtorch.compile
Compiling through FSDP2 hooks without graph breaks is no longer supported.
torch.compilefully_shardtorch._dynamo.config.patchcompiled_autogradfullgraph
Deletes the size_vars and size_hint API.
size_varssize_hint
Removes Volta (SM 7.0) GPU support from CUDA 12.8 and 12.9 binary builds to enable CuDNN 9.15.1.
TORCH_CUDA_ARCH_LIST
PyPI wheels now ship CUDA 13.0 by default for Linux x86_64 and aarch64, dropping Maxwell and Pascal GPU support.
CUDA 13.0 only supports Turing (SM 7.5) and newer GPUs on Linux x86_64; Maxwell and Pascal are no longer supported.
torch.hub.list(), load(), and help() now default trust_repo to "check" and the trust_repo=None option is removed.
torch.hub.list()torch.hub.load()torch.hub.help()trust_repo
Removes the is_causal flag from varlen_attn; use window_size instead.
varlen_attnis_causalwindow_size
DTensor.to_local() backward now converts Partial placements to Replicate by default when grad_placements is not provided.
DTensor.to_local()grad_placementsPartialReplicatefrom_local()
caffe2 support is fully removed from ROCm PyTorch's hipify preprocessing, known as hipify v2 behavior.
hipifyHIPAllocatorMasqueradingAsCUDA.hHIPCachingAllocatorMasqueradingAsCUDA.hHIPGuardImplMasqueradingAsCUDA.hHIPStreamMasqueradingAsCUDA.h
Removes caffe2 support from ROCm hipify preprocessing, introducing hipify v2 behavior.
Removes caffe2 work-arounds for HIP device versus CUDA device in hipify v2.
Removes torch.export.export_for_training; use torch.export.export instead.
torch.export.export_for_trainingtorch.export.export
Removes the fallback option from torch.onnx.export.
torch.onnx.exportfallback
Removes overload matching from the ONNX dispatcher; custom_translation_table values must be single callables.
torch.onnx.exportcustom_translation_table
Removes the PT2E quantization flow from torch.ao.quantization, migrating it to the torchao package.
torch.ao.quantization.pt2etorch.ao.quantization.quantizerComposableQuantizerEmbeddingQuantizerX86InductorQuantizerXPUInductorQuantizerXNNPACKQuantizerQuantizationSpec
Removes the unused data_source argument from Sampler.
Samplerdata_source
Removes deprecated imports for torch.utils.data.datapipes.iter.grouping.
torch.utils.data.datapipes.iter.groupingSHARDING_PRIORITIESShardingFilterIterDataPipetorch.utils.data.datapipes.iter.sharding
Removes Nested Jagged Tensor support from nn.attention.flex_attention.
nn.attention.flex_attention
Makes fallback=False the default in torch.onnx.export.
torch.onnx.exportfallback
Removes the outdated header_code argument.
header_code
Removes the HIPBLASLT_ALLOW_TF32 env var; TF32 is now always allowed.
HIPBLASLT_ALLOW_TF32
Builds Metal kernels for macOS 14+ and removes all pre-macOS-14 logic, so MPS now requires macOS 14 or later.
MPS
torch.onnx.export now defaults to dynamo=True, using the torch.export.export pipeline instead of the legacy TorchScript exporter.
torch.onnx.exporttorch.export.exportdynamo
Changes the default ONNX export path to use torch.export.export with dynamo=True; dynamo=False preserves the legacy exporter.
torch.onnx.export
Drops implicit draft_export tracing from the default exporter path; opt in with TORCH_ONNX_ENABLE_DRAFT_EXPORT=True.
torch.export.draft_exporttorch.export.exporttorch.onnx.exportTORCH_ONNX_ENABLE_DRAFT_EXPORT
Removes torch.onnx.enable_fake_mode; dynamo=True mode uses FakeTensors by default.
torch.onnx.enable_fake_modeFakeTensor
Makes some public ONNX utility APIs for the TorchScript exporter private and removes deprecated torch.onnx.verification members.
torch.onnx.verificationtorch.onnx.symbolic_opsets
Removes torch.onnx.symbolic_caffe2; caffe2 support in the ONNX exporter has ended.
torch.onnx.symbolic_caffe2
Removes support for Maxwell and Pascal (sm50 to sm60) architectures in CUDA 12.8 and 12.9 builds.
Renames AOTI config variable aot_inductor.embed_cubin to aot_inductor.embed_kernel_binary.
aot_inductor.embed_cubinaot_inductor.embed_kernel_binary
Renames AOTI config variable aot_inductor.compile_wrapper_with_O0 to compile_wrapper_opt_level.
aot_inductor.compile_wrapper_with_O0compile_wrapper_opt_level
Removes definitely_true and definitely_false in favor of guard_or_true and guard_or_false.
definitely_truedefinitely_falseguard_or_trueguard_or_false
Removes torch.export.export_for_inference in favor of torch.export.export_for_training().run_decompositions().
torch.export.export_for_inferencetorch.export.export_for_trainingrun_decompositions
Removes the JitTraceConvertStrategy for JIT traced and scripted modules in the ONNX exporter when dynamo=True.
JitTraceConvertStrategydynamotorch.exportExportedProgram
Removes the torch/types.h include from Dispatcher.h, which can break C++ builds relying on it.
torch/types.hDispatcher.h
Drops support for Triton versions below 2.2.0 (versions without ASTSource).
ASTSource
Changes torch.Tensor.new_tensor() to create the new Tensor on the given Tensor's device by default.
torch.Tensor.new_tensor()
torch.onnx.dynamo_export now uses the ExportedProgram logic path; some ExportOptions are removed or ignored.
torch.onnx.dynamo_exporttorch.onnx.exportExportOptionsdiagnostic_optionsfake_contextonnx_registrydynamic_shapes
Removes LRScheduler.print_lr() and the verbose kwarg to the LRScheduler constructor.
LRScheduler.print_lr()LRSchedulerverboseLRScheduler.get_last_lr()
libtorch_python.so symbols are now invisible by default on all platforms except Apple.
libtorch_python.so
Removes stage_index_to_group_rank from the pipelining schedule.
stage_index_to_group_rank
Removes report as a return output for draft export and attaches it as ep._report.
reportep._report
Removes LegacyDynamoStrategy.
LegacyDynamoStrategy
Removes the Alltoallv specialization for PyTorch generic all_to_all.
Alltoallvall_to_all
Deletes rename_dynamic_shapes_with_model_inputs.
rename_dynamic_shapes_with_model_inputs
Changes the default value of the weights_only parameter of torch.load, a backward compatibility breaking change.
torch.loadweights_only
Flips torch.load default to weights_only=True, using a constrained unpickler instead of the usual pickle module.
torch.load
Stops publishing Anaconda packages that depend on Anaconda default packages; users should use wheels or conda-forge.
Removes several obsolete ONNX APIs including some logging APIs, torch.onnx.ExportTypes, and torch.onnx.export_to_pretty_string.
torch.onnx.ExportTypestorch.onnx.export_to_pretty_string
Removes parallel_and and parallel_or.
parallel_andparallel_or
Removes type promotion rule for pow in ONNX export.
pow
Removes the non-ABI-compatible mode in Inductor.
Removes the Options argument for ProcessGroup and exposes backend Options to reflect the correct code structure.
ProcessGroupProcessGroup.OptionsProcessGroupNCCLProcessGroupNCCL.Options_set_default_backendBackend.backend_type_map
Removes dynamic_dim() for specifying dynamic shapes in torch.export().
dynamic_dim()torch.export()Dims
Deletes MacOS-12.3 specific checks in MPS.
Removes the op_level_debug option from torch.onnx.ExportOptions; use report=True and verify=True instead.
torch.onnx.ExportOptionsop_level_debugtorch.onnx.export
Removes the ONNXProgramSerializer class; ONNXProgram models are now serialized by ONNX IR.
ONNXProgramSerializertorch.onnx.ONNXProgramONNXProgram.save()
Removes the deprecated torch.onnx.SymbolicContext class; custom symbolic functions can no longer take ctx as first argument.
torch.onnx.SymbolicContext
Removes Caffe2 support from ONNX export, including onnx_unpack_quantized_weights handling and is_caffe2_aten_fallback.
onnx_unpack_quantized_weightsis_caffe2_aten_fallbacktorch.onnx.symbolic_helper
Removes the CheckerError and InvalidExportOptionsError classes; catch RuntimeError for torch.onnx export errors.
CheckerErrorInvalidExportOptionsErrorRuntimeError
Removes "spawn" as an option for parallel compilation to avoid issues on certain platforms.
spawn
Changes the default intra-op thread pool size from the number of logical cores to the number of physical cores.
torch.set_num_threads
Changes torch.quasirandom.SobolEngine.draw default dtype from torch.float32 to torch.get_default_dtype().
torch.quasirandom.SobolEngine.drawtorch.get_default_dtype()
Deletes the torch.autograd.function.traceable API, which was deprecated in 2.3 and did nothing.
torch.autograd.function.traceabletorch.autograd.Functionis_traceable
Removes caffe2 db and distributed from the build system.
Removes SparseAdam's allowance of raw Tensor input.
SparseAdam
Removes caffe2 contrib and experiments from ONNX.
Removes the QNNPACK third-party module.
QNNPACK
Renames mutated_args to mutates_args.
mutated_argsmutates_args
Removes support for Dict[nn.Module, Dict[str, Any]] state_dict.
nn.Modulestate_dict
Removes the API that allows for extra deferred runtime asserts during lowering.
Deletes the inductor config.trace.compile_profile option.
config.trace.compile_profile
Changes default torch_function behavior to be disabled when torch_dispatch is defined.
__torch_dispatch____torch_function__
ProcessGroupNCCL removes multi-device-per-thread support from the C++ level.
ProcessGroupNCCL
Removes no_dist and coordinator_rank from public Distributed Checkpointing APIs.
torch.distributed.checkpointdcp.savedcp.loadno_distcoordinator_rank
Removes the deprecated tp_mesh_dim argument from parallelize_module; the API now only accepts a DeviceMesh.
parallelize_moduletp_mesh_dimDeviceMesh
Removes constraints in favor of dynamic_shapes for torch.export.
dynamic_shapes
Removes equality_constraints from ExportedProgram; dimensions with equal constraints now share the same symbol.
ExportedProgramequality_constraints
Removes torch._export.export in favor of torch.export.export.
torch._export.exporttorch.export.export
Removes CallSpec from torch.export.
CallSpec
Removes deprecated torch.jit.quantized APIs, which now raise errors when called or instantiated.
torch.jit.quantized.quantize_rnn_cell_modulestorch.jit.quantized.quantize_rnn_modulestorch.jit.quantized.quantize_linear_modulestorch.jit.quantized.QuantizedLineartorch.jit.quantized.QuantizedLinearFP16torch.jit.quantized.QuantizedGRUtorch.jit.quantized.QuantizedLSTMtorch.ao.nn.quantized
Removes deprecated fbgemm operators, so TorchScript models exported with torch.jit.quantized no longer load.
torch.jit.quantizedtorch.ao.quantization
Deletes the C10_IS_TRIVIALLY_COPYABLE macro.
C10_IS_TRIVIALLY_COPYABLE
Removes ArrayRefTensor::dtype.
ArrayRefTensor::dtype
Renames singleton int to nested int.
Updates the scaled_dot_product_attention flash attention kernel to Flash Attention v2, removing the Windows flash implementation.
scaled_dot_product_attentionsdp_kerneltorch.backends.cuda.sdp_kerneltorch.nn.functional.scaled_dot_product_attention
Removes deprecated c10d multi-gpu-per-thread APIs such as all_reduce_multigpu.
dist.broadcast_multigpudist.all_reduce_multigpudist.reduce_multigpudist.all_gather_multigpudist.reduce_scatter_multigpu
Renames torch.onnx.ExportOutput to torch.onnx.ONNXProgram to align with torch.export terminology.
torch.onnx.ExportOutputtorch.onnx.ONNXProgramtorch.onnx.dynamo_export
Removes NVFuser functionality from TorchScript; NNC replaced it as the default GPU fuser in 2.1.
NVFuserTorchScriptNNC
SparseAdam constructor no longer accepts a raw Tensor for params and only accepts containers.
torch.optim.SparseAdamparams
Removes split.Tensor from the core Aten operator set.
split.Tensor
Removes redundant dynamic_dim.
dynamic_dim
Removes eliminate_dead_code.
eliminate_dead_code
Removes the fake_mode arg from the torch._dynamo.export API.
torch._dynamo.exportfake_mode
Removes the setter for graph_module.
graph_module
Fixes and renames move_model_to_eval to move_exported_model_to_eval.
move_model_to_evalmove_exported_model_to_eval
zero_grad() now sets gradients to None instead of zero tensors by default, since set_to_none defaults to True.
torch.optim.*.zero_grad()torch.nn.Module.zero_grad()set_to_none
Optimizers Adadelta, Adagrad, Adam, Adamax, AdamW, ASGD, NAdam, RAdam, RMSProp, RProp and SGD default to foreach on CUDA when differentiable=False.
AdadeltaAdagradAdamAdamaxAdamWASGDNAdamRAdam
torch.istft no longer accepts real tensors of shape (..., 2) as complex input; inputs must be complex valued.
torch.istfttorch.view_as_complex
Removes the FSDP params_with_grad API, which now throws a runtime error.
FullyShardedDataParallelparams_with_grad
Wildcard imports of torch.distributed.fsdp.fully_sharded_data_parallel no longer expose non-public symbols.
torch.distributed.fsdp.fully_sharded_data_parallelShardingStrategyFullyShardedDataParallel
Renames alltoall keyword arguments to output_tensors and input_tensors for consistency with other c10d APIs.
alltoalloutput_tensorsinput_tensors
Removes unused functions from torch.ao.quantization.fx.utils in both the torch.quantization and torch.ao.quantization namespaces.
graph_pretty_strget_per_tensor_qparamsquantize_nodeget_qconv_opcreate_qparam_nodesnode_return_type_is_intis_get_tensor_info_node
Renames AO private APIs with a leading underscore to comply with PyTorch public vs private API guidelines.
get_observer_dict_get_observer_dict
Removes overwrite_output_observer and overwrite_output_fake_quantize from BackendConfig, using DTypeWithConstraints instead and warning instead of erroring on wrong observers.
overwrite_output_observeroverwrite_output_fake_quantizeBackendConfigDTypeWithConstraintsQConfigget_default_qconfig_mapping
Removes torch.ao.quantization.quantization_patterns and fusion_patterns, migrating their classes to quantize_handler and fuse_handler namespaces.
torch.ao.quantization.fx.quantization_patternstorch.ao.quantization.fx.quantize_handlertorch.ao.quantization.fx.fusion_patternstorch.ao.quantization.fx.fuse_handlerQuantizeHandlerDefaultFuseHandlerFuseHandler
Removes mistakenly public APIs under torch.ao.quantization.fx.backend_config_utils.
get_quantize_handler_clsget_fusion_pattern_to_fuse_handler_clsget_native_quant_patternsget_pattern_to_quantize_handlers_get_quantize_handler_cls_get_pattern_to_quantize_handlers_get_fusion_pattern_to_fuse_handler_clsget_native_backend_config
Removes deprecated ONNX monkey patches to torch.Graph, torch.Block and torch.Node.
torch.Graphtorch.Blocktorch.Nodetorch.Graph.op()torch.Graph.at()torch.Block.op()torch.Graph.constant()torch.Node.__getitem__
Removes the boolean full_check parameter in check_onnx_proto and always performs full checking, warning on failures and type errors.
check_onnx_protofull_checktorch.onnx.export
Deletes torch::deploy from PyTorch Core; it has migrated to the MultiPy repository.
torch::deploy
Removes the use of lazy::View in the lazy tensor core, deprecated in favor of functionalization.
lazy::View
Renames c10::fromIntArrayRef to c10::fromIntArrayRefSlow and updates call sites.
c10::fromIntArrayRefc10::fromIntArrayRefSlow
Removes the tensor overload at::frobenius_norm(const Tensor&) after its 1.12 deprecation.
at::frobenius_normtorch.norm
Custom Python process groups implementing new_group() must now accept a backend keyword argument.
torch.distributed.new_groupnew_groupbackend
Changes the ProcessGroup.new_group() signature to accept keyword-only timeout, backend, pg_options, group_name and group_desc arguments.
MyProcessGroupnew_grouptimeoutbackendpg_optionsgroup_namegroup_desc
Stops automatically upgrading NCCL symmetric-memory pool segments allocated after register_mem_pool(..., symm=True) to symmetric windows.
register_mem_poolderegister_mem_poolsymm
Makes setup.py a deprecation shim; build commands print the replacement instead of running setuptools, with removal scheduled for 2.18.
setup.pyinstalldevelopbuildbdist_wheelcleansdist
Complex type promotion for bfloat16 now yields torch.bcomplex32 instead of torch.complex64, which may raise not-implemented errors.
torch.bcomplex32torch.complex64torch.bfloat16torch.result_type
Rejects unsupported third-order derivatives for training-mode batch normalization instead of silently returning an invalid result.
Graph-breaks on forward-AD dual tensors instead of silently dropping tangents; fullgraph=True now errors.
fullgraph
TorchScript now rejects bare list and tuple value annotations, requiring an element type such as list[int].
listtuplelist[int]
Enforces C++20 headers and adds safer integer conversions and borrowed-range support.
Rejects bare PyObject in operator schemas, which was accidentally accepted in 2.12 and is unsupported by torch.compile.
PyObjecttorch._C.parse_schema
Converts shared_ptr<Node> to intrusive_ptr<Node>, changing the signature of Tensor::grad_fn.
Tensor::grad_fnshared_ptr<Node>intrusive_ptr<Node>c10::make_intrusivetorch::autograd::deleteNode
onednn::qconv2d_pointwise.binary and .binary_tensor now return fresh tensors instead of aliasing the qaccum input.
onednn::qconv2d_pointwise.binaryonednn::qconv2d_pointwise.binary_tensorqaccum
Routes new_group through split_group when TorchComms is enabled, raising NotImplementedError for arguments split_group cannot honor instead of silently falling back.
new_groupsplit_groupuse_local_synchronizationsort_ranksNotImplementedError
Strengthened SVE compile checks in FindARM.cmake may reject previously accepted but incorrect SVE configurations.
FindARM.cmake
torch.distributed.nn.functional ops now raise RuntimeError under torch.compile.
torch.distributed.nn.functionaltorch.distributed._functional_collectivesbroadcastall_reduceall_gatherreduce_scatterall_to_all_single
All MPS tensors are now allocated in unified memory unconditionally.
Refactors autotune_select_algorithm to always return a (node, choice) tuple.
autotune_select_algorithm
Removes more undocumented functions.
Removes the internal header torch/csrc/utils/six.h.
torch/csrc/utils/six.h
Adds window_size to varlen_attn and makes optional arguments keyword-only.
torch.nn.attention.varlen_attnwindow_sizeis_causalreturn_auxscale
C++ DebugInfoWriter now honors $XDG_CACHE_HOME for its cache directory, falling back to ~/.cache/torch.
DebugInfoWriterXDG_CACHE_HOME
DeviceMesh now stores a process group registry directly, so process groups must exist before mesh creation for torch.compile.
DeviceMesh_pg_registryget_group()init_process_group
_PhiloxState.seed and _PhiloxState.offset now return torch.Tensor instead of int, and setters expect tensors.
_PhiloxState_PhiloxState.seed_PhiloxState.offset
Changes TORCH_CHECK_{COND} behavior to be non-fatal.
TORCH_CHECK_{COND}
Replaces the context_parallel context manager with functional APIs.
context_parallel
Custom operators must not return Tensors sharing storage with inputs; after #163227 such operators may return silently incorrect results under torch.compile.
torch.libraryTORCH_LIBRARYtorch.library.opchecktorch.compile
torch.cat now raises ValueError, IndexError or TypeError where appropriate instead of the generic RuntimeError.
torch.cat
Removes torch.onnx.dynamo_export and the experimental onnxrt torch.compile backend.
torch.onnx.dynamo_exporttorch.onnx.exporttorch.compile
Cleans up old APIs in the AOTI C shim.
Calling an op with an unsupported input dtype now raises NotImplementedError instead of RuntimeError.
torch.nn.Hardshrink()
Adds a missing in-place on view check to custom autograd.Function, raising an error instead of silently leaking memory.
torch.autograd.Functionctx.mark_dirty()
The out variant of tensordot now raises an error when given a requires_grad=True tensor.
torch.tensordot()
Specialization of a tensor shape with mark_dynamic applied now correctly errors; use maybe_mark_dynamic as a workaround.
torch._dynamo.mark_dynamictorch._dynamo.maybe_mark_dynamictorch.compile
Moves custom_op_default_layout_constraint from inductor config to functorch config.
torch._functorch.config.custom_op_default_layout_constrainttorch._inductor.config.custom_op_default_layout_constraint
Adds a stricter aliasing/mutation check for HigherOrderOperators such as cond, erroring on unsupported alias or mutation.
HigherOrderOperatortorch.cond
Upgrades DLPack to 1.0, renaming some DLDeviceType enum values.
DLPackDLDeviceTypeDLDeviceType.kDLCUDADLDeviceType.kDLCUDAHost
Moves NVTX3 code from cmake/public/cuda.cmake to cmake/Dependencies.cmake, breaking the build system interface for downstream projects.
cmake/public/cuda.cmakecmake/Dependencies.cmakeUSE_SYSTEM_NVTXtorch::nvtx3find_package(TORCH REQUIRED)
C++ extensions with py_limited_api=True are now built with -DPy_LIMITED_API, enforcing the limited API.
py_limited_api-DPy_LIMITED_APIlibtorch_python.so
Deprecates capture_pre_autograd_graph in favor of torch.export.export for PyTorch 2 export quantization.
torch.export.exportcapture_pre_autograd_graphprepare_pt2eXNNPACKQuantizerget_symmetric_quantization_config
Changes GraphTransformObserver interface to hook-based methods for node level provenance tracking.
torch.fx.passes.graph_transform_observer.GraphTransformObserveron_node_creationon_node_eraseget_node_creation_hookget_node_erase_hookget_node_replace_hookget_deepcopy_hookGraphModule
Makes get_control_flow_submodules private in torch.ao.quantization.pt2e.graph_utils.
torch.ao.quantization.pt2e.graph_utils.get_control_flow_submodules_get_control_flow_submodules
torch.onnx.export with dynamo=True now creates ONNX models using IR version 10.
torch.onnx.export
Moves stack allocation configs in AOTI under an aot_inductor prefix, renaming use_minimal_arrayref_interface and allow_stack_allocation options.
torch.compileuse_minimal_arrayref_interfaceaot_inductor.use_minimal_arrayref_interfaceallow_stack_allocationaot_inductor.allow_stack_allocation
Moves torch._utils.is_compiling to torch.compiler.is_compiling.
torch._utils.is_compilingtorch.compiler.is_compiling
Updates fused kernels and calls _safe_softmax from SDPA so fully masked rows yield 0s instead of NaNs.
nn.functional.scaled_dot_product_attention_safe_softmax
F.scaled_dot_product_attention now returns zeros instead of NaN when the attention mask masks out all positions.
F.scaled_dot_product_attention
Makes all torch.onnx.export options except the first three arguments keyword-only.
torch.onnx.export
Removes the internal API torch.onnx._export; use the public torch.onnx.export instead.
torch.onnx._exporttorch.onnx.export
The pytorch/pytorch docker image now installs PyTorch via pip and switches conda installation from miniconda to miniforge.
Forbids subclassing torch._C._TensorBase directly; users should subclass torch.Tensor instead.
torch._C._TensorBasetorch.Tensor
Raises an error for non-compositional usages of as_strided followed by mutation under torch.compile.
torch.compiletorch.as_stridedas_strided
Custom op schemas are now validated at registration time and unknown types raise an error unless allow_typevars is true.
TORCH_LIBRARYtorch::schemaallow_typevars
DeviceMesh.get_group without a dim now raises RuntimeError; use get_all_groups to get all sub-process groups.
DeviceMesh.get_groupDeviceMesh.get_all_groupsinit_device_mesh
Retires torch.distributed.pipeline, which now raises ModuleNotFoundError; use torch.distributed.pipelining.
torch.distributed.pipelinetorch.distributed.pipelining
Blanket bans kwarg-only Tensors.
Requires an nn.Module to be passed to torch.export.export instead of a function.
torch.export.exportnn.ModuleExportedProgram
Makes ExportedProgram non-callable; callers must use .module() to get a callable module.
ExportedProgramexported_program.module()torch.nn.Module
Changes the signature of map_impl in HigherOrderOp.
map_impl
Requires pytree serialized_type_name.
serialized_type_name
Requires a Module to be passed to export.
export
Building PyTorch from source now requires GCC 9.4 or newer, since the codebase migrated from C++14 to C++17.
GCC
Rewrites DTensor (Tensor Parallel) APIs to improve UX, replacing ParallelStyles and input/output layout helper functions.
PairwiseParallelmake_input_replicate_1dmake_output_replicate_1dparallelize_moduleDeviceMeshColwiseParallel
Rewrites DTensor tensor parallel APIs, keeping only ColwiseParallel and RowwiseParallel and replacing input/output functions with input_layouts and output_layouts kwargs.
ColwiseParallelRowwiseParallelPrepareModuleInputPrepareModuleOutputparallelize_moduleinput_layoutsoutput_layouts
UntypedStorage.resize_ now keeps data on its original device index instead of moving it to the current CUDA device.
UntypedStorage.resize_torch.cuda.current_device()
Wrapping a function with set_grad_enabled as a decorator now consumes its global mutation, so grad mode is changed after decoration.
set_grad_enabledtorch.is_grad_enabled()
De-registers full_like and empty_like as core operators in the Core ATen Opset.
full_likeempty_like
Replaces node.meta source_fn with source_fn_stack.
node.metasource_fnsource_fn_stack
Building PyTorch from source now requires a C++17 compatible compiler.
Disables torch.autograd.backward and torch.autograd.grad for complex scalar outputs, raising an error instead of ignoring the imaginary part.
torch.autograd.backwardtorch.autograd.grad.real.grad().backward()
Updates non-reentrant checkpoint to allow nesting and support autograd.grad, clearing recomputed tensors on backward even with retain_graph=True.
torch.utils.checkpointretain_graphctx.saved_tensor_saved_tensorsuse_reentrant
DistributedDataParallel only syncs buffers when broadcast_buffers is True, so broadcast_buffers=False now skips buffer synchronization.
DistributedDataParallelbroadcast_buffers
torch.masked_select, torch.masked_scatter and torch.masked_fill now require bool masks and raise RuntimeError for other dtypes.
torch.masked_selecttorch.masked_scattertorch.masked_filltorch.bool
Custom operators without an Autograd kernel now produce outputs that require grad and error on backpropagation.
torch.autograd.Function raises an error when an input returned as-is is saved in setup_context.
torch.autograd.Functionsetup_contextctx.save_for_backward
Disallows module forward input mutation in aot_export.
aot_export
Changes the calling convention for functional_rng in aot_autograd.
aot_autogradfunctional_rng
torch.tensor and nn.Parameter now serialize all their attributes, aligning with other tensor subclasses.
torch.tensortorch.nn.Parametertorch.Tensortorch.utils.weak.WeakTensorKeyDictionary
torch.stft now requires return_complex to be passed explicitly for real input tensors.
torch.stftreturn_complex
Removes deprecated private functionality from torch.testing: rand, randn, get_all_device_types, multiple dtype getters, and make_non_contiguous.
torch.testing.randtorch.testing.randntorch.testing.get_all_device_typestorch.testing.make_non_contiguous
Changes the FSDP auto_wrap_policy APIs to use the nonwrapped_numel keyword instead of unwrapped_params.
lambda_auto_wrap_policytransformer_auto_wrap_policysize_based_auto_wrap_policynonwrapped_numelunwrapped_params
BackendConfig now accepts fusion patterns in natural order, and backend_config.configs returns a List instead of a Dict.
BackendConfigBackendPatternConfigset_fuser_methodset_fused_module_set_pattern_complex_formatbackend_config.configs
Updates slice_scatter, select_scatter, diagonal_scatter and as_strided_scatter to preserve input stride and storage_offset instead of returning contiguous tensors.
torch.slice_scattertorch.select_scattertorch.diagonal_scattertorch.as_strided_scatter
Clamp and min/max boundary subgradients now follow the dispatcher schema's input space, changing gradients at ties and bounds.
torch.clamptorch.clamp_mintorch.clamp_maxtorch.fmintorch.fmaxtorch.where
Returns GroupMember.NON_GROUP_MEMBER instead of None from experimental torch.distributed.split_group() for nonmember ranks.
torch.distributed.split_grouptorch.distributed.GroupMember.NON_GROUP_MEMBERnew_group
Switches to internal benchmarking and updates the benchmarking path from triton utils to torch._inductor.runtime.benchmarking.
torch._inductor.runtime.benchmarkingbenchmarkerbenchmarker.benchmark_gpudo_bench_gputorch._inductor.runtime.runtime_utils
Security40
Validates tensor shapes and sequence bounds in torch.quasirandom.SobolEngine before native kernels index direction-number tables.
torch.quasirandom.SobolEngine
Makes stream comparisons with non-stream objects safe: equality returns False, stream != None returns True, and ordering raises TypeError.
stream
Validates grad_output shapes in 2D and 3D grid_sample backward before CPU, CUDA, or MPS kernels can read out of bounds.
grid_samplegrad_output
Validates channel counts in replication_pad1d and replication_pad2d backward to prevent out-of-bounds reads and segmentation faults.
replication_pad1dreplication_pad2d
Validates mean, invstd, and counts shapes before CUDA batch-normalization statistics gathering to prevent out-of-bounds reads.
meaninvstdcounts
Adds an opt-in weights_only=True mode to distributed object collectives for restricted deserialization; default unchanged.
weights_only
Validates symmetric-memory signal channels and peer ranks to prevent out-of-bounds device-memory access and allocation corruption.
Parses Flight Recorder rank expressions with ast.literal_eval() instead of executing them with eval().
ast.literal_eval()eval()
Rejects malformed mobile FlatBuffer modules whose function class-type index is out of range, preventing an out-of-bounds access and crash.
Always validates sparse-tensor invariants when loading with torch.load(..., weights_only=True) so malformed checkpoints cannot cause out-of-bounds reads.
torch.loadtorch.sparse.check_sparse_tensor_invariants
Pins third-party GitHub Actions to SHA and extracts unsafe expressions.
Fixes a ZipSlip directory traversal vulnerability in torch.hub that allowed malicious zips to extract files outside the target directory.
torch.hubValueError
PyTorch is a Python package that provides tensor computation. Prior to version 2.10.0, a vulnerability in PyTorch's weights_only unpickler allows an attacker to craft a malicious checkpoint file (.pth) that, when loaded with torch.load(..., weights_only=True), can corrupt memory and potentially lead to arbitrary code execution. Version 2.10.0 fixes the issue.
High · CVSS 8.8
Stops storing flamegraph to the tmp folder.
pytorch v2.8.0 was discovered to display unexpected behavior when the components torch.rot90 and torch.randn_like are used together.
High · CVSS 7.5
An issue in the component torch.linalg.lu of pytorch v2.8.0 allows attackers to cause a Denial of Service (DoS) when performing a slice operation.
High · CVSS 7.5
pytorch v2.8.0 was discovered to contain an integer overflow in the component torch.nan_to_num-.long().
Medium · CVSS 5.3
PyTorch Improper Resource Shutdown or Release vulnerability
Low · CVSS 3.3
An issue in pytorch v2.7.0 can lead to a Denial of Service (DoS) when a PyTorch model consists of torch.Tensor.to_sparse() and torch.Tensor.to_dense() and is compiled by Inductor.
High · CVSS 7.5
A buffer overflow occurs in pytorch v2.7.0 when a PyTorch model consists of torch.nn.Conv2d, torch.nn.functional.hardshrink, and torch.Tensor.view-torch.mv() and is compiled by Inductor, leading to a Denial of Service (DoS).
High · CVSS 7.5
A Name Error occurs in pytorch v2.7.0 when a PyTorch model consists of torch.cummin and is compiled by Inductor, leading to a Denial of Service (DoS).
High · CVSS 7.5
A syntax error in the component proxy_tensor.py of pytorch v2.7.0 allows attackers to cause a Denial of Service (DoS).
High · CVSS 7.5
PyTorch before 3.7.0 has a bernoulli_p decompose function in decompositions.py even though it lacks full consistency with the eager CPU implementation, negatively affecting nn.Dropout1d, nn.Dropout2d, and nn.Dropout3d for fallback_random=True.
Medium · CVSS 5.3
In PyTorch before 2.7.0, bitwise_right_shift produces incorrect output for certain out-of-bounds values of the "other" argument.
Medium · CVSS 5.3
In PyTorch through 2.6.0, when eager is used, nn.PairwiseDistance(p=2) produces incorrect results.
Medium · CVSS 5.3
In PyTorch before 2.7.0, when torch.compile is used, FractionalMaxPool2d has inconsistent results.
Medium · CVSS 5.3
In PyTorch before 2.7.0, when inductor is used, nn.Fold has an assertion error.
Medium · CVSS 5.3
PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built on a tape-based autograd system. In version 2.5.1 and prior, a Remote Command Execution (RCE) vulnerability exists in PyTorch when loading a model using torch.load with weights_only=True. This issue has been patched in version 2.6.0.
Critical · CVSS 9.8
Adds a new blocklist for weights_only load to prevent some modules from being allowlisted.
weights_only
In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. NOTE: this is disputed by multiple parties because this is intended behavior in PyTorch distributed computing.
Critical · CVSS 9.8
Adds a warning for weights_only in the Python frontend.
weights_only
Updates packages used in CI for vulnerability fixes.
Fixes an out of bounds read in the mobile interpreter INTERFACE_CALL opcode handler.
INTERFACE_CALL
Fixes an out of bounds registers_ access in the mobile TorchScript interpreter.
registers_
Uses the secure setup-ssh action from test-infra.
Automates passing the Conda PyTorchBot Test Token for release.
PyTorch before v2.2.0 was discovered to contain a heap buffer overflow vulnerability in the component /runtime/vararg_functions.cpp. This vulnerability allows attackers to cause a Denial of Service (DoS) via a crafted input.
Pytorch before v2.2.0 has an Out-of-bounds Read vulnerability via the component torch/csrc/jit/mobile/flatbuffer_loader.cpp.
Pytorch before version v2.2.0 was discovered to contain a use-after-free vulnerability in torch/csrc/jit/mobile/interpreter.cpp.
Moves mergebot and other CI/CD workflows to their own secure environment.
mergebot
Platform9
Expands Python 3.15 and free-threaded Python 3.15t binary coverage to Windows and macOS across the release matrix.
Raises the minimum supported Python version for PyTorch 2.9.0 to 3.10, with 3.14 and 3.14t available as preview.
Adds support for Python 3.14 in CI/CD builds.
Adds Python 3.13 and 3.13t support in CI/CD.
Adds Python 3.13 support in CI/CD and prototype support for Python 3.13t in CD, limited to Linux and Linux aarch64 torch binaries.
Removes CPython 3.8 support and drops it from binaries; PyTorch 2.4 is the last version supporting it.
Enables support for torch.compile and triton with Python 3.12 in CI/CD.
torch.compiletriton
torch.compile is not supported on Python 3.12; use Python between 3.8 and 3.11 instead.
torch.compile
Drops support for Python versions <= 3.7 and requires Python 3.8 or newer to install PyTorch.
Deprecated96
Deprecates selective activation checkpointing bypassing saved_tensors_hooks; adds respect_saved_tensors_hooks to choose the behavior explicitly.
respect_saved_tensors_hookstorch.utils.checkpoint.checkpointtorch.autograd.graph.saved_tensors_hooksuse_reentrantcontext_fn
Deprecates torch.distributed.config.compile_on_one_rank in favor of torch.compiler.config.compile_on_one_rank, emitting a FutureWarning.
torch.compiler.config.compile_on_one_ranktorch.distributed.config.compile_on_one_rankTORCH_COMPILE_ON_ONE_RANKTORCH_DISTRIBUTED_COMPILE_ON_ONE_RANK
Deprecates the experimental profiler_metrics and profiler_measure_per_kernel options, which no longer enable CUPTI range profiling and emit a FutureWarning.
profiler_metricsprofiler_measure_per_kerneltorch.profiler._ExperimentalConfig
Deprecates the with_modules profiler option, which now emits a FutureWarning; use with_stack=True for eager models.
with_moduleswith_stacktorch.profiler.profilenn.Module
Deprecates torch._dynamo.config.enable_faithful_generator_behavior, which is now a no-op that always behaves as True.
torch._dynamo.config.enable_faithful_generator_behaviortorch._dynamo.config.patchtorch.compile
Deprecates CUDAGraph.register_generator_state(); CUDA graphs now register generator state lazily on first RNG use during capture.
CUDAGraph.register_generator_state()
Deprecates GreenContext.set_context() and GreenContext.pop_context(); use custom streams to activate a green context instead.
GreenContext.set_context()GreenContext.pop_context()GreenContext.Stream()torch.cuda.stream()
TorchScript APIs now emit visible FutureWarnings instead of normally hidden DeprecationWarnings.
torch.jit.scripttorch.jit.tracetorch.jit.savetorch.jit.loadtorch.utils.mkldnntorch.fx.experimental.optimizationtorch.distributed.optim
Custom operators returning an output that aliases an input are deprecated and now emit a UserWarning under torch.compile.
torch.library.custom_optorch.compileUserWarning
Creating tensors with the quantized dtypes quint8, qint8, and qint32 is deprecated and emits a warning.
quint8qint8qint32torch.quantize_per_tensor
Renames all_gather_into_tensor to all_gather_single and reduce_scatter_tensor to reduce_scatter_single, deprecating the old names.
dist.all_gather_into_tensordist.all_gather_singledist.reduce_scatter_tensordist.reduce_scatter_singleTorchCommBackend
Deprecates CUDA 12.8 builds in favor of CUDA 13.0; cu128 binaries are removed from the build matrix.
cu128cu130cu126
Source builds against CMake older than 3.10 now emit a deprecation warning; a future release will require CMake 3.10 or newer.
CMake
Profiler's metadata_json field is deprecated; use event_metadata instead.
metadata_jsonevent_metadata
torch.compile(fullgraph=True) now warns when a call runs no compiled code and will error in 2.13.
torch.compilefullgraphtorch._dynamo.error_on_graph_breakTorchDispatchMode
The inline_inbuilt_nn_modules Dynamo config is deprecated since inlining of in-built nn.Module instances is now the default.
torch._dynamo.config.inline_inbuilt_nn_modulesnn.Module
Deprecates hipify v2 masquerading classes, reworking them into thin shells around existing classes for backward compatibility.
Deprecates the MAGMA backend for linear algebra, warning when it is selected or retrieved; cuSOLVER remains default.
torch.backends.cuda.preferred_linalg_library
MAGMA preference is ignored for torch.linalg.svd on CUDA; cuSOLVER is always used.
torch.linalg.svdtorch.backends.cuda.preferred_linalg_library
Deprecates torch.distributed.symmetric_memory.enable_symm_mem_for_group; the store is retrieved directly via ProcessGroup.getStore() in C++.
torch.distributed.symmetric_memory.enable_symm_mem_for_groupProcessGroup.getStore()
Deprecates implicit slicing of a flattened dim from the root DeviceMesh, adding a warning and types for _get_slice_mesh_layout.
DeviceMesh_get_slice_mesh_layout
Moves from/to to torch::stable::detail in Ahead-Of-Time Inductor (AOTI).
torch::stable::detailfromto
Adds deprecation warnings to user-facing torch.jit APIs, which are not guaranteed to work in Python 3.14.
torch.jittorch.compiletorch.export
Deprecates the dynamic_axes option in torch.onnx.export.
torch.onnx.exportdynamic_axesdynamic_shapes
Deprecates the export_memory_timeline method in torch.profiler in favor of the newer memory snapshot API.
torch.profiler.export_memory_timelinetorch.cuda.memory._record_memory_historytorch.cuda.memory._export_memory_snapshot
Deprecates the pin_memory_device param in torch.utils.data.DataLoader, moving pin_memory enabling back inside BaseDataLoaderIter.
torch.utils.data.DataLoaderpin_memory_devicepin_memoryBaseDataLoaderIterStatefulDataloader
Deprecates and deletes torch.export.export_for_training in favor of torch.export.export.
torch.export.export_for_trainingtorch.export.export
Deprecates allow_tf32 in tl.dot, directing users to input_precision.
tl.dotallow_tf32input_precision
Deprecates Inductor config variable rocm.n_max_profiling_configs in favor of ck-tile based configs.
rocm.n_max_profiling_configsrocm.ck_max_profiling_configsrocm.ck_tile_max_profiling_configs
Deprecates Inductor config variable autotune_fallback_to_aten; Inductor no longer silently falls back to ATen.
autotune_fallback_to_atenmax_autotune_gemm_backends
Deprecates Inductor config variables use_mixed_mm and mixed_mm_choice because Inductor now supports prologue fusion.
use_mixed_mmmixed_mm_choice
Deprecates Inductor config setting descriptive_names = False; use "torch", "original_aten", or "inductor_node" instead.
descriptive_names
Deprecates AOTI config variable emit_current_arch_binary.
emit_current_arch_binary
Announces that MPS support for MacOS Ventura will be removed in 2.9, requiring MacOS Sonoma or above.
MPS
Deprecates torch.ao.quantization, to be removed in 2.10, directing users to torchao quantization APIs.
torch.ao.quantizationtorch.ao.quantization.quantizetorch.ao.quantization.quantize_dynamictorch.ao.quantization.quantize_fx.prepare_fxtorch.ao.quantization.quantize_fx.convert_fxtorchao.quantization.quantize_pt2e.prepare_pt2etorchao.quantization.quantize_pt2e.convert_pt2e
Deprecates the dynamo=False option of torch.onnx.export; dynamo=True becomes the default in PyTorch 2.9.
torch.onnx.exportdynamofallbacktorch.export.export
Deprecates torch.onnx.dynamo_export in favor of torch.onnx.export with dynamo=True.
torch.onnx.dynamo_exporttorch.onnx.exportdynamic_shapes
Deprecates XNNPACKQuantizer in PyTorch and moves it to ExecuTorch.
XNNPACKQuantizerget_symmetric_quantization_configtorch.ao.quantization.quantizer.xnnpack_quantizerexecutorch.backends.xnnpack.quantizer.xnnpack_quantizer
Updates pin memory APIs to not pass the device argument; device and pin_memory_device are discouraged and will be deprecated.
devicepin_memory_device
Deprecates _shard_tensor in favor of src_data_rank=None.
_shard_tensorsrc_data_rank
Deprecates c10d::onCompletionHook; starting in 2.6 registering the hook emits a warning in favor of Flight Recorder.
c10d::onCompletionHookProcessGroupNCCL_register_on_completion_hook
Deprecates the TORCHINDUCTOR_STACK_ALLOCATION environment variable in favor of a torch.compile option.
TORCHINDUCTOR_STACK_ALLOCATIONtorch.compileaot_inductor.allow_stack_allocation
Deprecates usage of the pytorch/builder repository.
Removes torch._dynamo.utils.CompileProfiler.
torch._dynamo.utils.CompileProfiler
Deprecates using None at the dimension level in dynamic_shapes; use Dim.STATIC instead.
dynamic_shapesDim.STATIC
Deprecates search_autotune_cache.
search_autotune_cache
Deprecates Python 3.8 support from CI/CD.
Deprecates supplying model keyword arguments as a final dictionary to torch.onnx.export; use the kwargs parameter.
torch.onnx.exportkwargs
Deprecates torch.onnx.OperatorExportTypes and the operator_export_type argument; ONNX_FALLTHROUGH, ONNX_ATEN and ONNX_ATEN_FALLBACK are no longer supported.
torch.onnx.OperatorExportTypesoperator_export_typeONNX_FALLTHROUGHONNX_ATENONNX_ATEN_FALLBACK
Deprecates the training option in torch.onnx.export; set the model training mode before exporting instead.
torch.onnx.exporttrainingtorch.onnx.TrainingMode.EVAL
Raises a user warning when torch.load is called without specifying weights_only, encouraging weights_only=True.
torch.loadweights_only
Deprecates device-specific autocast APIs in favor of the unified torch.amp APIs.
torch.amptorch.{device}.amp
Exports torch.newaxis=None for Python Array API and NumPy consistency.
torch.newaxis
Deprecates calling FakeTensor.data_ptr in eager mode because FakeTensors have no valid data pointer.
FakeTensor.data_ptrtorch.compile
Deprecates LRScheduler.print_lr.
LRScheduler.print_lr
Deprecates the submodules feature for distributed_state_dict in Distributed Checkpointing.
distributed_state_dictget_model_state_dictset_model_state_dictStateDictOptions
Deprecates calling get_model_state_dict or set_model_state_dict with submodule paths or state dicts; filter and preprocess state dicts manually instead.
get_model_state_dictset_model_state_dictget_state_dictset_state_dictStateDictOptions
Deprecates FSDP.state_dict_type and redirects users to get_model_state_dict and set_model_state_dict.
FSDP.state_dict_typeStateDictType.FULL_STATE_DICTget_model_state_dictset_model_state_dict
Removes FlameGraph usage steps from the export_stacks docstring; the API itself is unchanged.
export_stacks
Removes the deprecated torch._aminmax operator in favor of torch.aminmax.
torch._aminmaxtorch.aminmax
Starts deprecation of capture_pre_autograd_graph.
capture_pre_autograd_graph
Refactors autocast C++ APIs to be device-agnostic, replacing get_autocast_gpu_dtype and get_autocast_cpu_dtype with get_autocast_dtype.
at::autocast::get_autocast_gpu_dtype()at::autocast::get_autocast_cpu_dtype()at::autocast::get_autocast_dtype()at::kCUDAat::kCPU
Refactors autocast Python APIs to be device-agnostic, replacing get/set_autocast_gpu_dtype and related functions with device-argument versions.
torch.get_autocast_gpu_dtype()torch.set_autocast_gpu_dtype()torch.is_autocast_enabled()torch.set_autocast_enabled()torch.get_autocast_cpu_dtype()torch.get_autocast_dtype()torch.set_autocast_dtype()
Makes torch.amp.autocast more generic, replacing torch.cuda.amp.autocast and torch.cpu.amp.autocast with torch.amp.autocast(device, ...).
torch.cuda.amp.autocasttorch.cpu.amp.autocasttorch.amp.autocast
Deprecates device-specific GradScaler autocast API in favor of torch.amp.GradScaler with a device argument.
torch.cuda.amp.GradScalertorch.amp.GradScaler
Generalizes custom_fwd and custom_bwd to be device-agnostic via a device_type argument.
torch.cuda.amp.custom_fwdtorch.amp.custom_fwdtorch.amp.custom_bwd
Deprecates the torch.autograd.function.traceable decorator and getting/setting torch.autograd.Function's is_traceable.
torch.autograd.function.traceabletorch.autograd.Function.is_traceable
Deprecates not passing use_reentrant explicitly to activation checkpoint and checkpoint_sequential; an exception will be raised in 2.4.
torch.utils.checkpointcheckpoint_sequentialuse_reentrant
Deprecates torch.backends.cuda.sdp_kernel in favor of torch.nn.attention.sdpa_kernel.
torch.backends.cuda.sdp_kerneltorch.nn.attention.sdpa_kernelSDPBackend
Deprecates Work.result() in c10d.
Work.result()
Deprecates torch.distributed.pipeline in favor of the PiPPy library.
torch.distributed.pipeline
Adds a deprecation message for NO_SHARD.
NO_SHARD
Adds a deprecation warning for the composable API fully_shard.
fully_shard
Changes DTensor distribute_module input/output_fn to accept module, deprecating the variant that does not.
distribute_module
Deprecates macOS x86 support; PyTorch 2.2.x is the last version that supports macOS x64.
Deprecates the verbose parameter in LRScheduler constructors in favor of get_last_lr().
LRSchedulerverboseget_last_lr()ReduceLROnPlateau
Deprecates not passing use_reentrant explicitly to torch.utils.checkpoint.checkpoint_sequential; an exception will be raised in 2.4.
torch.utils.checkpoint.checkpoint_sequentialuse_reentranttorch.utils.checkpoint.checkpoint
Deprecates "fallthrough" as the autograd fallback default; custom operators without an Autograd kernel now warn and may require grad.
torch::CppFunction::makeFallthrough()AutogradCPUAutogradCUDADispatchKey::AutogradDispatchKey::CompositeImplicitAutograd
Deprecates calling torch.cross without specifying the dim argument; behavior will change to match torch.linalg.cross in a future release.
torch.crosstorch.linalg.cross
Not passing use_reentrant explicitly to torch.utils.checkpoint now raises a warning.
torch.utils.checkpointuse_reentrant
Deprecates torch.has_* attributes in favor of flags in torch.backends.* modules.
torch.has_*torch.backends.*is_built()is_available()
Deprecates the check_sparse_nnz argument of torch.autograd.gradcheck in favor of masked.
torch.autograd.gradcheckcheck_sparse_nnzmasked
TorchScript default fuser switches back to NNC and NVFuser integration with TorchScript is deprecated.
NVFuserTorchScriptNNC
Fixes a doc-rendering error and deprecates CircleCI docs scripts.
Warns once for TypedStorage deprecation.
TypedStorage
Deprecates functorch in favor of the new torch.func module.
functorchtorch.func
Deprecates functorch._ function transforms such as vmap, grad and jvp in favor of identical torch.func counterparts.
functorch.vmapfunctorch.gradfunctorch.jvptorch.func.vmaptorch.func.gradtorch.func.jvp
Consolidates on torch.func.functional_call as the NN module functional API, replacing functorch make_functional and make_functional_with_buffers.
torch.func.functional_callfunctorch.make_functionalfunctorch.make_functional_with_buffers
Migrates functorch.combine_state_for_ensemble to torch.func.stack_module_state.
functorch.combine_state_for_ensembletorch.func.stack_module_state
Stops supporting functorch.compile (AOTAutograd) as a compilation frontend; use torch.compile() instead.
functorch.compileAOTAutogradtorch.compile()
Deprecates TypedStorage, its derived classes and all their public methods.
torch.TypedStoragetorch.UntypedStoragetensor.storage()tensor.untyped_storage()
Deprecates tensor.mT, tensor.T, tensor.mH and tensor.H on 0D-tensors.
tensor.mTtensor.Ttensor.mHtensor.H
Deprecates decorating classes with torch.no_grad; decorate functions or methods instead.
torch.no_grad__init__
Deprecates torch.nn.utils.stateless.functional_call in favor of torch.func.functional_call.
torch.nn.utils.stateless.functional_calltorch.func.functional_call
Deprecates private API torch._six and removes the six and future compatibility libraries.
torch._sixtorch._six.string_classestorch._six.int_classestorch.inftorch.nan
Deprecates Caffe2 ONNX exporter support; it will be removed from the PyTorch 2.x series.