Upgrading torch 1 to 2
Breaking1.13.1 → 2.15.0Breaking215Security40Platform9Deprecated98New3009Changed2330Fixed3803Other984
Fetching 28 releases from GitHub…27 / 28
SecurityValidates tensor shapes and sequence bounds in torch.quasirandom.SobolEngine before native kernels index direction-number tables.#191198 ↗
BreakingUpgrade verdict
212 breaking changes and 9 platform requirement changes and 40 security fixes.
In plain terms
- 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.
Must act 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).
What you must change
Breaking212
torch.nn.LinearCrossEntropyOptions no longer accepts acc_policy="balanced"; use "compact" instead.
torch.nn.LinearCrossEntropyOptionstorch.nn.functional.linear_cross_entropyacc_policyRemoves the deprecated torch.cholesky() and Tensor.cholesky() APIs, which now raise RuntimeError.
torch.choleskyTensor.choleskytorch.linalg.choleskyRemoves the deprecated torch.qr() and Tensor.qr() APIs, which now raise RuntimeError.
torch.qrTensor.qrtorch.linalg.qrsomemodeRemoves the deprecated use_cuda argument from torch.profiler.profile and torch.autograd.profiler.profile.
torch.profiler.profiletorch.autograd.profiler.profileuse_cudaactivitiesuse_deviceMakes the Dynamo tvm backend use TVM's relax frontend exclusively and removes the relay path.
torch.compiletorch._dynamo.backends.tvmtvm_meta_scheduletvm_auto_schedulerschedulertrialspipelineRemoves the deprecated zero-argument C++ overloads c10::Scalar::isIntegral() and c10::isIntegralType(ScalarType).
c10::Scalar::isIntegralc10::isIntegralTypeincludeBoolRenames 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_enabledRemoves Bazel build support; users should migrate to the CMake or pip install build flow.
bazelReplaces 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_cowRemoves 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=Dimnametorchrun now defaults to an OS-assigned free port for single-node training instead of port 29500.
torchrun--master-port--standalonePET_MASTER_PORTInductor max-autotune now defers layout freezing by default, changing autotuning behavior.
torch._inductor.config.max_autotune_defer_layout_freezingTORCHINDUCTOR_MAX_AUTOTUNE_DEFER_LAYOUT_FREEZINGtorch.compileCompiling through FSDP2 hooks without graph breaks is no longer supported.
torch.compilefully_shardtorch._dynamo.config.patchcompiled_autogradfullgraphDeletes the size_vars and size_hint API.
size_varssize_hintRemoves Volta (SM 7.0) GPU support from CUDA 12.8 and 12.9 binary builds to enable CuDNN 9.15.1.
TORCH_CUDA_ARCH_LISTPyPI 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_repoRemoves the
is_causal flag from varlen_attn; use window_size instead.varlen_attnis_causalwindow_sizeDTensor.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.hRemoves 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.exportRemoves the fallback option from torch.onnx.export.
torch.onnx.exportfallbackRemoves overload matching from the ONNX dispatcher; custom_translation_table values must be single callables.
torch.onnx.exportcustom_translation_tableRemoves the PT2E quantization flow from torch.ao.quantization, migrating it to the torchao package.
torch.ao.quantization.pt2etorch.ao.quantization.quantizerComposableQuantizerEmbeddingQuantizerX86InductorQuantizerXPUInductorQuantizerXNNPACKQuantizerQuantizationSpecRemoves the unused data_source argument from Sampler.
Samplerdata_sourceRemoves deprecated imports for torch.utils.data.datapipes.iter.grouping.
torch.utils.data.datapipes.iter.groupingSHARDING_PRIORITIESShardingFilterIterDataPipetorch.utils.data.datapipes.iter.shardingRemoves Nested Jagged Tensor support from nn.attention.flex_attention.
nn.attention.flex_attentionMakes fallback=False the default in torch.onnx.export.
torch.onnx.exportfallbackRemoves the outdated header_code argument.
header_codeRemoves the HIPBLASLT_ALLOW_TF32 env var; TF32 is now always allowed.
HIPBLASLT_ALLOW_TF32Builds Metal kernels for macOS 14+ and removes all pre-macOS-14 logic, so MPS now requires macOS 14 or later.
MPStorch.onnx.export now defaults to dynamo=True, using the torch.export.export pipeline instead of the legacy TorchScript exporter.
torch.onnx.exporttorch.export.exportdynamoChanges the default ONNX export path to use torch.export.export with dynamo=True; dynamo=False preserves the legacy exporter.
torch.onnx.exportDrops 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_EXPORTRemoves torch.onnx.enable_fake_mode; dynamo=True mode uses FakeTensors by default.
torch.onnx.enable_fake_modeFakeTensorMakes some public ONNX utility APIs for the TorchScript exporter private and removes deprecated torch.onnx.verification members.
torch.onnx.verificationtorch.onnx.symbolic_opsetsRemoves torch.onnx.symbolic_caffe2; caffe2 support in the ONNX exporter has ended.
torch.onnx.symbolic_caffe2Removes 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_binaryRenames AOTI config variable aot_inductor.compile_wrapper_with_O0 to compile_wrapper_opt_level.
aot_inductor.compile_wrapper_with_O0compile_wrapper_opt_levelRemoves definitely_true and definitely_false in favor of guard_or_true and guard_or_false.
definitely_truedefinitely_falseguard_or_trueguard_or_falseRemoves torch.export.export_for_inference in favor of torch.export.export_for_training().run_decompositions().
torch.export.export_for_inferencetorch.export.export_for_trainingrun_decompositionsRemoves the JitTraceConvertStrategy for JIT traced and scripted modules in the ONNX exporter when dynamo=True.
JitTraceConvertStrategydynamotorch.exportExportedProgramRemoves the torch/types.h include from Dispatcher.h, which can break C++ builds relying on it.
torch/types.hDispatcher.hDrops support for Triton versions below 2.2.0 (versions without ASTSource).
ASTSourceChanges 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_shapesRemoves 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.soRemoves
stage_index_to_group_rank from the pipelining schedule.stage_index_to_group_rankRemoves
report as a return output for draft export and attaches it as ep._report.reportep._reportRemoves
LegacyDynamoStrategy.LegacyDynamoStrategyRemoves the
Alltoallv specialization for PyTorch generic all_to_all.Alltoallvall_to_allDeletes
rename_dynamic_shapes_with_model_inputs.rename_dynamic_shapes_with_model_inputsChanges the default value of the weights_only parameter of torch.load, a backward compatibility breaking change.
torch.loadweights_onlyFlips torch.load default to weights_only=True, using a constrained unpickler instead of the usual pickle module.
torch.loadStops 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_stringRemoves
parallel_and and parallel_or.parallel_andparallel_orRemoves type promotion rule for pow in ONNX export.
powRemoves 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_mapRemoves dynamic_dim() for specifying dynamic shapes in torch.export().
dynamic_dim()torch.export()DimsDeletes 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.exportRemoves 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.SymbolicContextRemoves 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_helperRemoves the CheckerError and InvalidExportOptionsError classes; catch RuntimeError for torch.onnx export errors.
CheckerErrorInvalidExportOptionsErrorRuntimeErrorRemoves "spawn" as an option for parallel compilation to avoid issues on certain platforms.
spawnChanges the default intra-op thread pool size from the number of logical cores to the number of physical cores.
torch.set_num_threadsChanges 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_traceableRemoves caffe2 db and distributed from the build system.
Removes SparseAdam's allowance of raw Tensor input.
SparseAdamRemoves caffe2 contrib and experiments from ONNX.
Removes the QNNPACK third-party module.
QNNPACKRenames mutated_args to mutates_args.
mutated_argsmutates_argsRemoves support for Dict[nn.Module, Dict[str, Any]] state_dict.
nn.Modulestate_dictRemoves the API that allows for extra deferred runtime asserts during lowering.
Deletes the inductor config.trace.compile_profile option.
config.trace.compile_profileChanges 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.
ProcessGroupNCCLRemoves no_dist and coordinator_rank from public Distributed Checkpointing APIs.
torch.distributed.checkpointdcp.savedcp.loadno_distcoordinator_rankRemoves the deprecated tp_mesh_dim argument from parallelize_module; the API now only accepts a DeviceMesh.
parallelize_moduletp_mesh_dimDeviceMeshRemoves constraints in favor of dynamic_shapes for torch.export.
dynamic_shapesRemoves equality_constraints from ExportedProgram; dimensions with equal constraints now share the same symbol.
ExportedProgramequality_constraintsRemoves torch._export.export in favor of torch.export.export.
torch._export.exporttorch.export.exportRemoves CallSpec from torch.export.
CallSpecRemoves 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.quantizedRemoves deprecated fbgemm operators, so TorchScript models exported with torch.jit.quantized no longer load.
torch.jit.quantizedtorch.ao.quantizationDeletes the C10_IS_TRIVIALLY_COPYABLE macro.
C10_IS_TRIVIALLY_COPYABLERemoves ArrayRefTensor::dtype.
ArrayRefTensor::dtypeRenames 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_attentionRemoves 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_multigpuRenames torch.onnx.ExportOutput to torch.onnx.ONNXProgram to align with torch.export terminology.
torch.onnx.ExportOutputtorch.onnx.ONNXProgramtorch.onnx.dynamo_exportRemoves NVFuser functionality from TorchScript; NNC replaced it as the default GPU fuser in 2.1.
NVFuserTorchScriptNNCSparseAdam constructor no longer accepts a raw Tensor for params and only accepts containers.
torch.optim.SparseAdamparamsRemoves split.Tensor from the core Aten operator set.
split.TensorRemoves redundant
dynamic_dim.dynamic_dimRemoves eliminate_dead_code.
eliminate_dead_codeRemoves the fake_mode arg from the torch._dynamo.export API.
torch._dynamo.exportfake_modeRemoves the setter for graph_module.
graph_moduleFixes and renames
move_model_to_eval to move_exported_model_to_eval.move_model_to_evalmove_exported_model_to_evalzero_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_noneOptimizers Adadelta, Adagrad, Adam, Adamax, AdamW, ASGD, NAdam, RAdam, RMSProp, RProp and SGD default to foreach on CUDA when differentiable=False.
AdadeltaAdagradAdamAdamaxAdamWASGDNAdamRAdamtorch.istft no longer accepts real tensors of shape (..., 2) as complex input; inputs must be complex valued.
torch.istfttorch.view_as_complexRemoves the FSDP
params_with_grad API, which now throws a runtime error.FullyShardedDataParallelparams_with_gradWildcard imports of torch.distributed.fsdp.fully_sharded_data_parallel no longer expose non-public symbols.
torch.distributed.fsdp.fully_sharded_data_parallelShardingStrategyFullyShardedDataParallelRenames alltoall keyword arguments to
output_tensors and input_tensors for consistency with other c10d APIs.alltoalloutput_tensorsinput_tensorsRemoves 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_nodeRenames AO private APIs with a leading underscore to comply with PyTorch public vs private API guidelines.
get_observer_dict_get_observer_dictRemoves 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_mappingRemoves 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_handlerQuantizeHandlerDefaultFuseHandlerFuseHandlerRemoves 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_configRemoves 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.exportDeletes torch::deploy from PyTorch Core; it has migrated to the MultiPy repository.
torch::deployRemoves the use of lazy::View in the lazy tensor core, deprecated in favor of functionalization.
lazy::ViewRenames c10::fromIntArrayRef to c10::fromIntArrayRefSlow and updates call sites.
c10::fromIntArrayRefc10::fromIntArrayRefSlowRemoves the tensor overload at::frobenius_norm(const Tensor&) after its 1.12 deprecation.
at::frobenius_normtorch.normCustom Python process groups implementing new_group() must now accept a backend keyword argument.
torch.distributed.new_groupnew_groupbackendChanges the ProcessGroup.new_group() signature to accept keyword-only timeout, backend, pg_options, group_name and group_desc arguments.
MyProcessGroupnew_grouptimeoutbackendpg_optionsgroup_namegroup_descStops automatically upgrading NCCL symmetric-memory pool segments allocated after register_mem_pool(..., symm=True) to symmetric windows.
register_mem_poolderegister_mem_poolsymmMakes setup.py a deprecation shim; build commands print the replacement instead of running setuptools, with removal scheduled for 2.18.
setup.pyinstalldevelopbuildbdist_wheelcleansdistComplex type promotion for bfloat16 now yields torch.bcomplex32 instead of torch.complex64, which may raise not-implemented errors.
torch.bcomplex32torch.complex64torch.bfloat16torch.result_typeRejects 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.
fullgraphTorchScript 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_schemaConverts 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::deleteNodeonednn::qconv2d_pointwise.binary and .binary_tensor now return fresh tensors instead of aliasing the qaccum input.
onednn::qconv2d_pointwise.binaryonednn::qconv2d_pointwise.binary_tensorqaccumRoutes 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_ranksNotImplementedErrorStrengthened SVE compile checks in FindARM.cmake may reject previously accepted but incorrect SVE configurations.
FindARM.cmaketorch.distributed.nn.functional ops now raise RuntimeError under torch.compile.
torch.distributed.nn.functionaltorch.distributed._functional_collectivesbroadcastall_reduceall_gatherreduce_scatterall_to_all_singleAll MPS tensors are now allocated in unified memory unconditionally.
Refactors
autotune_select_algorithm to always return a (node, choice) tuple.autotune_select_algorithmRemoves more undocumented functions.
Removes the internal header torch/csrc/utils/six.h.
torch/csrc/utils/six.hAdds window_size to varlen_attn and makes optional arguments keyword-only.
torch.nn.attention.varlen_attnwindow_sizeis_causalreturn_auxscaleC++
DebugInfoWriter now honors $XDG_CACHE_HOME for its cache directory, falling back to ~/.cache/torch.DebugInfoWriterXDG_CACHE_HOMEDeviceMesh 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.offsetChanges TORCH_CHECK_{COND} behavior to be non-fatal.
TORCH_CHECK_{COND}Replaces the context_parallel context manager with functional APIs.
context_parallelCustom 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.compiletorch.cat now raises ValueError, IndexError or TypeError where appropriate instead of the generic RuntimeError.
torch.catRemoves torch.onnx.dynamo_export and the experimental onnxrt torch.compile backend.
torch.onnx.dynamo_exporttorch.onnx.exporttorch.compileCleans 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.compileMoves 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_constraintAdds a stricter aliasing/mutation check for HigherOrderOperators such as cond, erroring on unsupported alias or mutation.
HigherOrderOperatortorch.condUpgrades DLPack to 1.0, renaming some DLDeviceType enum values.
DLPackDLDeviceTypeDLDeviceType.kDLCUDADLDeviceType.kDLCUDAHostMoves 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.soDeprecates
capture_pre_autograd_graph in favor of torch.export.export for PyTorch 2 export quantization.torch.export.exportcapture_pre_autograd_graphprepare_pt2eXNNPACKQuantizerget_symmetric_quantization_configChanges
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_hookGraphModuleMakes
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_submodulestorch.onnx.export with dynamo=True now creates ONNX models using IR version 10.
torch.onnx.exportMoves 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_allocationMoves torch._utils.is_compiling to torch.compiler.is_compiling.
torch._utils.is_compilingtorch.compiler.is_compilingUpdates fused kernels and calls _safe_softmax from SDPA so fully masked rows yield 0s instead of NaNs.
nn.functional.scaled_dot_product_attention_safe_softmaxF.scaled_dot_product_attention now returns zeros instead of NaN when the attention mask masks out all positions.
F.scaled_dot_product_attentionMakes all torch.onnx.export options except the first three arguments keyword-only.
torch.onnx.exportRemoves the internal API torch.onnx._export; use the public torch.onnx.export instead.
torch.onnx._exporttorch.onnx.exportThe 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.TensorRaises an error for non-compositional usages of as_strided followed by mutation under torch.compile.
torch.compiletorch.as_stridedas_stridedCustom op schemas are now validated at registration time and unknown types raise an error unless allow_typevars is true.
TORCH_LIBRARYtorch::schemaallow_typevarsDeviceMesh.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_meshRetires torch.distributed.pipeline, which now raises ModuleNotFoundError; use torch.distributed.pipelining.
torch.distributed.pipelinetorch.distributed.pipeliningBlanket bans kwarg-only Tensors.
Requires an nn.Module to be passed to torch.export.export instead of a function.
torch.export.exportnn.ModuleExportedProgramMakes ExportedProgram non-callable; callers must use .module() to get a callable module.
ExportedProgramexported_program.module()torch.nn.ModuleChanges the signature of map_impl in HigherOrderOp.
map_implRequires pytree serialized_type_name.
serialized_type_nameRequires a Module to be passed to export.
exportBuilding PyTorch from source now requires GCC 9.4 or newer, since the codebase migrated from C++14 to C++17.
GCCRewrites DTensor (Tensor Parallel) APIs to improve UX, replacing ParallelStyles and input/output layout helper functions.
PairwiseParallelmake_input_replicate_1dmake_output_replicate_1dparallelize_moduleDeviceMeshColwiseParallelRewrites DTensor tensor parallel APIs, keeping only ColwiseParallel and RowwiseParallel and replacing input/output functions with input_layouts and output_layouts kwargs.
ColwiseParallelRowwiseParallelPrepareModuleInputPrepareModuleOutputparallelize_moduleinput_layoutsoutput_layoutsUntypedStorage.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_likeReplaces node.meta source_fn with source_fn_stack.
node.metasource_fnsource_fn_stackBuilding 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_reentrantDistributedDataParallel only syncs buffers when broadcast_buffers is True, so broadcast_buffers=False now skips buffer synchronization.
DistributedDataParallelbroadcast_bufferstorch.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.boolCustom 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_backwardDisallows module forward input mutation in aot_export.
aot_exportChanges the calling convention for functional_rng in aot_autograd.
aot_autogradfunctional_rngtorch.tensor and nn.Parameter now serialize all their attributes, aligning with other tensor subclasses.
torch.tensortorch.nn.Parametertorch.Tensortorch.utils.weak.WeakTensorKeyDictionarytorch.stft now requires return_complex to be passed explicitly for real input tensors.
torch.stftreturn_complexRemoves 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_contiguousChanges 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_paramsBackendConfig 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.configsUpdates 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_scatterClamp 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.whereReturns 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_groupSwitches 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_utilsSecurity40
Validates tensor shapes and sequence bounds in torch.quasirandom.SobolEngine before native kernels index direction-number tables.
torch.quasirandom.SobolEngineMakes stream comparisons with non-stream objects safe: equality returns False, stream != None returns True, and ordering raises TypeError.
streamValidates grad_output shapes in 2D and 3D grid_sample backward before CPU, CUDA, or MPS kernels can read out of bounds.
grid_samplegrad_outputValidates channel counts in replication_pad1d and replication_pad2d backward to prevent out-of-bounds reads and segmentation faults.
replication_pad1dreplication_pad2dValidates mean, invstd, and counts shapes before CUDA batch-normalization statistics gathering to prevent out-of-bounds reads.
meaninvstdcountsAdds an opt-in weights_only=True mode to distributed object collectives for restricted deserialization; default unchanged.
weights_onlyValidates 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_invariantsPins 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.hubValueErrorPyTorch is a Python package that provides tensor computation. Prior to version 2.10.0, a vulnerability in PyTorch's
High · CVSS 8.8weights_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.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.5An 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.5pytorch v2.8.0 was discovered to contain an integer overflow in the component torch.nan_to_num-.long().
Medium · CVSS 5.3PyTorch Improper Resource Shutdown or Release vulnerability
Low · CVSS 3.3An 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.5A 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.5A 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.5A 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.5PyTorch 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.3In PyTorch before 2.7.0, bitwise_right_shift produces incorrect output for certain out-of-bounds values of the "other" argument.
Medium · CVSS 5.3In PyTorch through 2.6.0, when eager is used, nn.PairwiseDistance(p=2) produces incorrect results.
Medium · CVSS 5.3In PyTorch before 2.7.0, when torch.compile is used, FractionalMaxPool2d has inconsistent results.
Medium · CVSS 5.3In PyTorch before 2.7.0, when inductor is used, nn.Fold has an assertion error.
Medium · CVSS 5.3PyTorch 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.8Adds a new blocklist for weights_only load to prevent some modules from being allowlisted.
weights_onlyIn 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.8Adds a warning for weights_only in the Python frontend.
weights_onlyUpdates packages used in CI for vulnerability fixes.
Fixes an out of bounds read in the mobile interpreter INTERFACE_CALL opcode handler.
INTERFACE_CALLFixes 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.
mergebotPlatform9
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.compiletritontorch.compile is not supported on Python 3.12; use Python between 3.8 and 3.11 instead.
torch.compileDrops support for Python versions <= 3.7 and requires Python 3.8 or newer to install PyTorch.
Deprecations to plan for
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_fnDeprecates 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_RANKDeprecates 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._ExperimentalConfigDeprecates the with_modules profiler option, which now emits a FutureWarning; use with_stack=True for eager models.
with_moduleswith_stacktorch.profiler.profilenn.ModuleDeprecates 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.compileDeprecates 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.optimCustom operators returning an output that aliases an input are deprecated and now emit a UserWarning under torch.compile.
torch.library.custom_optorch.compileUserWarningCreating tensors with the quantized dtypes quint8, qint8, and qint32 is deprecated and emits a warning.
quint8qint8qint32torch.quantize_per_tensorRenames 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_singleTorchCommBackendDeprecates CUDA 12.8 builds in favor of CUDA 13.0; cu128 binaries are removed from the build matrix.
cu128cu130cu126Source builds against CMake older than 3.10 now emit a deprecation warning; a future release will require CMake 3.10 or newer.
CMakeProfiler's metadata_json field is deprecated; use event_metadata instead.
metadata_jsonevent_metadatatorch.compile(fullgraph=True) now warns when a call runs no compiled code and will error in 2.13.
torch.compilefullgraphtorch._dynamo.error_on_graph_breakTorchDispatchModeThe 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.ModuleDeprecates 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_libraryMAGMA preference is ignored for torch.linalg.svd on CUDA; cuSOLVER is always used.
torch.linalg.svdtorch.backends.cuda.preferred_linalg_libraryDeprecates 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_layoutMoves from/to to torch::stable::detail in Ahead-Of-Time Inductor (AOTI).
torch::stable::detailfromtoAdds deprecation warnings to user-facing torch.jit APIs, which are not guaranteed to work in Python 3.14.
torch.jittorch.compiletorch.exportDeprecates the dynamic_axes option in torch.onnx.export.
torch.onnx.exportdynamic_axesdynamic_shapesDeprecates 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_snapshotDeprecates the pin_memory_device param in torch.utils.data.DataLoader, moving pin_memory enabling back inside BaseDataLoaderIter.
torch.utils.data.DataLoaderpin_memory_devicepin_memoryBaseDataLoaderIterStatefulDataloaderDeprecates and deletes torch.export.export_for_training in favor of torch.export.export.
torch.export.export_for_trainingtorch.export.exportDeprecates
allow_tf32 in tl.dot, directing users to input_precision.tl.dotallow_tf32input_precisionDeprecates 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_configsDeprecates Inductor config variable autotune_fallback_to_aten; Inductor no longer silently falls back to ATen.
autotune_fallback_to_atenmax_autotune_gemm_backendsDeprecates Inductor config variables use_mixed_mm and mixed_mm_choice because Inductor now supports prologue fusion.
use_mixed_mmmixed_mm_choiceDeprecates Inductor config setting descriptive_names = False; use "torch", "original_aten", or "inductor_node" instead.
descriptive_namesDeprecates AOTI config variable emit_current_arch_binary.
emit_current_arch_binaryAnnounces that MPS support for MacOS Ventura will be removed in 2.9, requiring MacOS Sonoma or above.
MPSDeprecates 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_pt2eDeprecates the dynamo=False option of torch.onnx.export; dynamo=True becomes the default in PyTorch 2.9.
torch.onnx.exportdynamofallbacktorch.export.exportDeprecates torch.onnx.dynamo_export in favor of torch.onnx.export with dynamo=True.
torch.onnx.dynamo_exporttorch.onnx.exportdynamic_shapesDeprecates
XNNPACKQuantizer in PyTorch and moves it to ExecuTorch.XNNPACKQuantizerget_symmetric_quantization_configtorch.ao.quantization.quantizer.xnnpack_quantizerexecutorch.backends.xnnpack.quantizer.xnnpack_quantizerUpdates pin memory APIs to not pass the device argument; device and pin_memory_device are discouraged and will be deprecated.
devicepin_memory_deviceDeprecates
_shard_tensor in favor of src_data_rank=None._shard_tensorsrc_data_rankDeprecates
c10d::onCompletionHook; starting in 2.6 registering the hook emits a warning in favor of Flight Recorder.c10d::onCompletionHookProcessGroupNCCL_register_on_completion_hookDeprecates the TORCHINDUCTOR_STACK_ALLOCATION environment variable in favor of a torch.compile option.
TORCHINDUCTOR_STACK_ALLOCATIONtorch.compileaot_inductor.allow_stack_allocationDeprecates usage of the pytorch/builder repository.
Removes torch._dynamo.utils.CompileProfiler.
torch._dynamo.utils.CompileProfilerDeprecates using None at the dimension level in dynamic_shapes; use Dim.STATIC instead.
dynamic_shapesDim.STATICDeprecates search_autotune_cache.
search_autotune_cacheDeprecates 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.exportkwargsDeprecates 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_FALLBACKDeprecates the training option in torch.onnx.export; set the model training mode before exporting instead.
torch.onnx.exporttrainingtorch.onnx.TrainingMode.EVALRaises a user warning when torch.load is called without specifying weights_only, encouraging weights_only=True.
torch.loadweights_onlyDeprecates device-specific autocast APIs in favor of the unified torch.amp APIs.
torch.amptorch.{device}.ampExports torch.newaxis=None for Python Array API and NumPy consistency.
torch.newaxisDeprecates calling FakeTensor.data_ptr in eager mode because FakeTensors have no valid data pointer.
FakeTensor.data_ptrtorch.compileDeprecates LRScheduler.print_lr.
LRScheduler.print_lrDeprecates the submodules feature for distributed_state_dict in Distributed Checkpointing.
distributed_state_dictget_model_state_dictset_model_state_dictStateDictOptionsDeprecates 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_dictStateDictOptionsDeprecates 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_dictRemoves FlameGraph usage steps from the export_stacks docstring; the API itself is unchanged.
export_stacksRemoves the deprecated torch._aminmax operator in favor of torch.aminmax.
torch._aminmaxtorch.aminmaxStarts deprecation of capture_pre_autograd_graph.
capture_pre_autograd_graphRefactors 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::kCPURefactors 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.autocastDeprecates device-specific GradScaler autocast API in favor of torch.amp.GradScaler with a device argument.
torch.cuda.amp.GradScalertorch.amp.GradScalerGeneralizes custom_fwd and custom_bwd to be device-agnostic via a device_type argument.
torch.cuda.amp.custom_fwdtorch.amp.custom_fwdtorch.amp.custom_bwdDeprecates the torch.autograd.function.traceable decorator and getting/setting torch.autograd.Function's is_traceable.
torch.autograd.function.traceabletorch.autograd.Function.is_traceableDeprecates not passing use_reentrant explicitly to activation checkpoint and checkpoint_sequential; an exception will be raised in 2.4.
torch.utils.checkpointcheckpoint_sequentialuse_reentrantDeprecates torch.backends.cuda.sdp_kernel in favor of torch.nn.attention.sdpa_kernel.
torch.backends.cuda.sdp_kerneltorch.nn.attention.sdpa_kernelSDPBackendDeprecates Work.result() in c10d.
Work.result()Deprecates torch.distributed.pipeline in favor of the PiPPy library.
torch.distributed.pipelineAdds a deprecation message for NO_SHARD.
NO_SHARDAdds a deprecation warning for the composable API fully_shard.
fully_shardChanges DTensor distribute_module input/output_fn to accept module, deprecating the variant that does not.
distribute_moduleDeprecates 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()ReduceLROnPlateauDeprecates 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.checkpointDeprecates "fallthrough" as the autograd fallback default; custom operators without an Autograd kernel now warn and may require grad.
torch::CppFunction::makeFallthrough()AutogradCPUAutogradCUDADispatchKey::AutogradDispatchKey::CompositeImplicitAutogradDeprecates calling torch.cross without specifying the dim argument; behavior will change to match torch.linalg.cross in a future release.
torch.crosstorch.linalg.crossNot passing use_reentrant explicitly to torch.utils.checkpoint now raises a warning.
torch.utils.checkpointuse_reentrantDeprecates 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_nnzmaskedTorchScript default fuser switches back to NNC and NVFuser integration with TorchScript is deprecated.
NVFuserTorchScriptNNCFixes a doc-rendering error and deprecates CircleCI docs scripts.
Warns once for TypedStorage deprecation.
TypedStorageDeprecates functorch in favor of the new torch.func module.
functorchtorch.funcDeprecates 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.jvpConsolidates 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_buffersMigrates functorch.combine_state_for_ensemble to torch.func.stack_module_state.
functorch.combine_state_for_ensembletorch.func.stack_module_stateStops 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.HDeprecates 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_callDeprecates private API torch._six and removes the six and future compatibility libraries.
torch._sixtorch._six.string_classestorch._six.int_classestorch.inftorch.nanDeprecates Caffe2 ONNX exporter support; it will be removed from the PyTorch 2.x series.