Skip to content

Update ml-frameworks#131

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/py/ml-frameworks
Open

Update ml-frameworks#131
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/py/ml-frameworks

Conversation

@renovate

@renovate renovate Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
matplotlib ==3.10.9==3.11.0 age confidence
numpy (changelog) ==2.4.4==2.5.1 age confidence
torch ==2.11.0==2.13.0 age confidence

Release Notes

matplotlib/matplotlib (matplotlib)

v3.11.0

Compare Source

numpy/numpy (numpy)

v2.5.1

Compare Source

v2.5.0: (June 21, 2026)

Compare Source

NumPy 2.5.0 Release Notes

Numpy 2.5.0 is a transitional release. It drops support for Python 3.11,
marking the end of distutils, and expires a large number of deprecations made
in the 2.0.x release. It also improves free threading and brings sorting into
compliance with the array-api standard with the addition of descending sorts.
There is also a fair amount of preparation for Python 3.15, which will be
supported starting with the first rc.

This release supports Python versions 3.12-3.14.

Highlights

  • Distutils has been removed,
  • Many expired deprecations, see below,
  • Many new deprecations, see below,
  • Many static typing improvements.
  • Improved support for free threading,
  • Support for descending sorts,

See New Features below for other additions.

Deprecations

  • numpy.char.chararray is deprecated. Use an ndarray with a string or bytes dtype instead.

    (gh-30605)

  • numpy.take now correctly checks if the result can be cast to the provided
    out=out under the same-kind rule. A DeprecationWarning is given now
    when this check fails. Previously, take incorrectly checked if out
    could be cast to the result (the wrong direction). This deprecation also
    affects compress and possibly other functions. (Future versions of NumPy
    may tighten the casting check further.)

    (gh-30615)

  • The numpy.char.[as]array functions are deprecated. Use an
    numpy.[as]array with a string or bytes dtype instead.

    (gh-30802)

  • Setting the dtype attribute is deprecated because mutating an array is unsafe
    if an array is shared, especially by multiple threads. As an alternative,
    you can create a view with a new dtype via array.view(dtype=new_dtype).

    (gh-29244)

  • Setting the shape attribute is deprecated because mutating an array is
    unsafe if an array is shared, especially by multiple threads. As an
    alternative, you can create a new view via np.reshape or
    np.ndarray.reshape. For example: x = np.arange(15); x = np.reshape(x, (3, 5)).
    To ensure no copy is made from the data, one can use np.reshape(..., copy=False).

    While setting the shape on an array is discouraged, for cases where it is
    difficult to work around, e.g., in __array_finalize__, it is possible
    with the private method np.ndarray._set_shape.

    (gh-29536)

  • Using the generic unit in numpy.timedelta64 is deprecated since this
    can lead to unexpected behavior such as non-transitive comparison, see
    gh-28287 for details. As
    an alternative, specify an explicit unit such as 's' (seconds) or 'D'
    (days) when constructing numpy.timedelta64. Due to this change, operations
    that implicitly rely on the generic unit are also deprecated. For
    example:

    arr = np.array([1, 2, 3], dtype="m8[s]")
    

1 is implicitly converted to generic timedelta64

  arr + 1

(gh-29619)

  • Resizing a Numpy array in place is deprecated since mutating an array is
    unsafe if an array is shared, especially by multiple threads. As an
    alternative, you can create a resized array via np.resize.

    (gh-30181)

  • numpy.fix is deprecated, use numpy.trunc instead. It is faster and
    follows the Array API standard. Both functions provide identical
    functionality: rounding array elements towards zero.

    (gh-30644)

  • numpy.ma.round_ is deprecated. numpy.ma.round can be used as a
    replacement.

    (gh-30738)

  • numpy.typename is deprecated because the names returned by it were
    outdated and inconsistent. numpy.dtype.name can be used as a
    replacement.

    (gh-30774)

  • Inputs other than integers are deprecated for numpy.triu_indices and
    numpy.tril_indices. Non-integer values for the M, k and N
    parameters of numpy.tri are deprecated. Non-integer values for the k
    parameter of both numpy.tril_indices_from and numpy.triu_indices_from
    are deprecated.

    (gh-30869)

  • Deprecations in custom dtype property and __array_finalize__.

    Previously arr.view(dtype=new_dtype) called arr.dtype = new_dtype
    also for subclasses, i.e., the attribute setting. That path is now
    deprecated and refined, meaning that even subclasses that do not see this
    DeprecationWarning may wish to update their code.

    A subclass that does any dtype specific logic (i.e. verifying the dtype
    in __array_finalize__ or has a dtype property) should now:

    • Set _set_dtype = None in which case arr.view(dtype=new_dtype)
      will call __array_finalize__ with the new dtype, ensuring that
      any validation __array_finalize__ will run is done.
    • Or, for a quick fix, define _set_dtype as a function (calling
      ndarray._set_dtype() to avoid DeprecationWarnings.
      (Future versions might migrate towards the _set_dtype = None path.)

    Ideally, follow NumPy's deprecation to prevent dtype mutation by users.
    The use of ndarray._set_dtype() may be necessary for some subclass
    finalization patterns, but should otherwise be avoided.

    (gh-31293)

Expired deprecations

  • numpy.distutils has been removed

    (gh-30340)

  • Passing None as dtype to np.finfo will now raise a TypeError
    (deprecated since 1.25)

    (gh-30460)

  • numpy.cross no longer supports 2-dimensional vectors.
    (Deprecated since 2.0)

    (gh-30461)

  • numpy._core.numerictypes.maximum_sctype has been removed.
    (deprecated since 2.0)

    (gh-30462)

  • numpy.row_stack has been removed in favor of numpy.vstack.
    (deprecated since 2.0)

    (gh-30463)

  • get_array_wrap has been removed.
    (deprecated since 2.0)

    (gh-30463)

  • recfromtxt and recfromcsv have been removed from numpy.lib._npyio
    in favor of numpy.genfromtxt.
    (deprecated since 2.0)

    (gh-30467)

  • The numpy.chararray re-export of numpy.char.chararray has been removed.
    (deprecated since 2.0)

    (gh-30604)

  • bincount now raises a TypeError for non-integer inputs.
    (deprecated since 2.1)

    (gh-30610)

  • The numpy.lib.math alias for the standard library math module has
    been removed.
    (deprecated since 1.25)

    (gh-30612)

  • Data type alias 'a' was removed in favor of 'S'.
    (deprecated since 2.0)

    (gh-30613)

  • _add_newdoc_ufunc(ufunc, newdoc) has been removed in favor of
    ufunc.__doc__ = newdoc.
    (deprecated since 2.2)

    (gh-30614)

Compatibility notes

linalg.eig and linalg.eigvals now always return complex arrays

Previously, the return values depended on whether the eigenvalues happen to lie
on the real line (which, for a general, non-symmetric matrix, is not
guaranteed).

This change makes consistent what was a value-dependent result. To retain the
previous behavior, do:

w = eigvals(a)
if np.any(w.imag == 0):  # this is what NumPy used to do
    w = w.real

If your matrix is symmetrix/hermitian, use eigh and eigvalsh instead of
eig and eigvals. These are guaranteed to return real values. A common
case is covariance matrices, which are symmetric and positive definite by
construction.

(gh-30411)

MSVC support

NumPy now requires minimum MSVC 19.35 toolchain version on Windows platforms.
This corresponds to Visual Studio 2022 version 17.5 Preview 2 or newer.

(gh-30489)

Cython support

NumPy's Cython headers (accessed via cimport numpy) now require Cython 3.0
or newer to build. If you try to compile a project that depends on NumPy's
Cython headers using Cython 0.29 or older, you will see a message like this:

Error compiling Cython file:
------------------------------------------------------------
...

versions.


#

See init.cython-30.pxd for the real Cython header


#

DEF err = int('Build aborted: the NumPy Cython headers require Cython 3.0.0 or newer.')
  ------------------------------------------------------------

  /path/to/site-packages/numpy/__init__.pxd:11:13: Error in compile-time expression:
  ValueError: invalid literal for int() with base 10: 
  'Build aborted: the NumPy Cython headers require Cython 3.0.0 or newer.'

Note that the invalid integer is not a bug in NumPy - we are intentionally
generating this error to avoid triggering a more obscure error later in the
build when an older Cython version tries to use a Cython feature that was not
available in the old Cython version.

(gh-30770)

numpy.where no longer truncates Python integers

Previously, if the x or y argument of numpy.where was a Python
integer that was out of range of the output type, it would be silently
truncated. Now, an OverflowError will be raised instead.

This change also applies to the underlying C API function PyArray_Where.

(gh-30803)

Default memory allocator change

NumPy now uses PyMem_RawMalloc and PyMem_RawFree as the default memory
allocator, instead of system's malloc and free directly.

(gh-30846)

from_dlpack raises BufferError instead of RuntimeError

np.from_dlpack now raises BufferError instead of RuntimeError when
the incoming DLPack tensor has an unsupported device, dtype, or exceeds the
maximum number of dimensions. This aligns with the DLPack and Array API
specifications, which recommend BufferError for data that cannot be
imported.

(gh-30937)

Corrections to the BTPE binomial sampler

Two independent errors in the Stirling series of the acceptance/rejection step
of the BTPE algorithm used by numpy.random.Generator.binomial have been
corrected:

  • The third and fourth error terms were added rather than subtracted. This sign
    error was inherited from section 5.3 of the original 1988 paper by
    Kachitvichyanukul & Schmeiser, which incorrectly adds all four terms.
  • The leading coefficient had a digit-swap typo (13680 instead of
    13860) that was introduced in the initial implementation.

As a result, Generator.binomial and Generator.multinomial, which uses
binomial internally, may now return different samples for the same seed.

The legacy numpy.random.RandomState.binomial and
numpy.random.RandomState.multinomial are not affected: they preserve the
original (incorrect) behavior, so existing streams remain reproducible.

(gh-31238)

datetime64/timedelta64 arithmetic raises on overflow

Addition, subtraction, and integer multiplication of datetime64 and
timedelta64 values now raise OverflowError when the result would
overflow int64 or land on the NaT sentinel value. Previously these
operations silently wrapped, often producing a value that was indistinguishable
from NaT. This matches the overflow checking already performed by
unit-conversion casts.

(gh-31378)

C API changes

  • It is now possible to register "real" and "imag" ArrayMethods via
    PyUFunc_AddLoopsFromSpecs. These will be used for imag and real
    and should normally set *view_offset in their resolve_descriptors
    function to allow the array attributes to return views.

    (gh-30984)

  • New PyDataType_TYPE, PyDataType_KIND, PyDataType_BYTEORDER and
    PyDataType_TYPEOBJ accessor macros to the C API. Together with the other
    accessor macros added for the NumPy 2.0 transition, these allow accessing the
    fields of PyArray_Descr structs without any direct field accesses.

    (gh-30994)

  • NumPy now supports the stable ABI for free-threaded Python as described in
    803{.interpreted-text role="pep"}.

    (gh-31091)

  • PyArray_DescrFromScalar now returns the full dtype descriptor for scalars
    of user-defined parametric data types, including any dtype parameters.
    Parameters were previously silently discarded, which could cause incorrect
    results in operations like astype on scalar objects. Internally, the
    function now delegates to discover_descr_from_pyobject, which handles
    parametric dtypes correctly.

    (gh-31067)

New Features

  • It is now possible to register user-dtypes for dlpack export and import
    via numpy.dtypes.register_dlpack_dtype. This functionality is meant to
    be used with care by user-dtype authors.

    (gh-31256)

Pixi package definitions

Pixi package definitions have been added for different kinds
of from-source builds of NumPy. These can be used in
downstream Pixi workspaces via the pixi-build feature.

Definitions for both default and AddressSanitizer-instrumented
(asan) builds are available in the source code under the
pixi-packages/ directory.

linux-64 and osx-arm64 platforms are supported.

(gh-30381)

numpy.ndarray now supports structural pattern matching

numpy.ndarray and its subclasses now have the Py_TPFLAGS_SEQUENCE flag
set, enabling structural pattern matching (PEP 634) with match/case
statements. This also enables Cython to optimize integer indexing operations.
See `arrays.ndarray.pattern-matching{.interpreted-text role="ref"}` for details.

(gh-30653)

Added N-D evaluation functions to the polynomial package

New functions polyvalnd, chebvalnd, legvalnd, hermvalnd,
hermevalnd, and lagvalnd have been added to evaluate polynomials
in arbitrary dimensions, analogous to the existing 2D and 3D evaluators.

(gh-30857)

New "descending" keyword argument for numpy.sort and numpy.argsort

Users can now pass the descending=True keyword argument to numpy.sort
and numpy.argsort to sort and argsort arrays in descending order. NaN
values, if present, are sorted to the end of the array in both ascending and
descending sorts. This feature is available for all built-in dtypes except
void, object, and generic. Note that SIMD optimizations for sorting
are currently not available for descending sorts, so performance may be slower.

(gh-31345)

Improvements

For f2py, the behaviour of intent(inplace) has improved. Previously,
if an input array did not have the right dtype or order, the input array was
modified in-place, changing its dtype and replacing its data by a corrected
copy. Now, instead, the corrected copy is kept a separate array, which, after
being passed and presumably modified by the fortran routine, is copied back to
the input routine. The above means one no longer has the risk that
pre-existing views or slices of the input array start pointing to unallocated
memory (at the price of increased overhead for the write-back copy at the end
of the call).

A potential problem would be that one might get very different results if one,
e.g., previously passed in an integer array where a double array was expected:
the writeback to integer would likely give wrong results. To avoid such
situations, intent(inplace) will now only allow arrays that have equivalent
type to that used in the fortran routine, i.e., dtype.kind is the same. For
instance, a routine expecting double would be able to receive float, but would
raise on integer input.

(gh-29929)

f2py modules now show allocatable arrays in dir()

Allocatable module variables wrapped by f2py now appear in dir()
output, matching their accessibility by name.

(gh-30965)

StringDType comparisons now correctly handle embedded NULL bytes.

(gh-31662)

Performance improvements and changes

Improved performance of numpy.searchsorted

The C++ binary search implementation used by numpy.searchsorted now has a
much better performance when searching for multiple keys. The new
implementation batches binary search steps across all keys to leverage cache
locality and out-of-order execution. Benchmarks show the new implementation can
be up to 20 times faster for hundreds of thousands keys while single-key
performance remains comparable to previous versions.

(gh-30517)

Improved scaling of ufuncs on free-threading

NumPy's ufuncs now scale significantly better on free-threading builds
of CPython due to the following optimizations:

  • Lock-free dispatch table: The ufuncs dispatch table is now implemented as
    a lock-free concurrent hash map, allowing multiple threads to call ufuncs
    without contention.
  • Immortal shared objects: Certain shared objects, such as global memory
    handlers, have been made immortal. This effectively reduces reference
    counting contention across threads.
  • Optimized memory allocation: NumPy now utilizes PyMem_RawMalloc and
    PyMem_RawFree for memory allocation. On Python 3.15 and newer, this
    leverages mimalloc and significantly reduces memory allocation overhead
    in multi-threaded workloads.

(gh-30846)

Faster reductions on small/medium contiguous arrays

numpy.sum, numpy.prod, numpy.any, numpy.all, and other
reductions with an identity value now use a fast path when the input is a
contiguous, aligned, non-object array and the reduction covers all axes
(axis=None) with no special arguments. Typical speedup is ~1.3x on small
arrays; numpy.any / numpy.all on contiguous boolean arrays can see
speedup up to 1.9x.

(gh-31274)

Typing improvements and changes

numpy.linalg typing improvements and preliminary shape-typing support

Input and output dtypes for numpy.linalg functions are now more precise.
Several of these functions also gain preliminary shape-typing support while
remaining backward compatible. For example, the return type of
numpy.linalg.matmul now depends on the shape-type of its inputs, or fall
back to the backward-compatible return type if the shape-types are unknown at
type-checking time. Because of limitations in Python's type system and current
type-checkers, shape-typing cannot cover every situation and is often only
implemented for the most common lower-rank cases.

(gh-30480)

numpy.ma typing annotations

The numpy.ma module is now fully covered by typing annotations. This
includes annotations for masked arrays, masks, and various functions and
methods. With this, NumPy has achieved 100% typing coverage across all its
submodules.

(gh-30566)

Shape-typing support for many functions and methods

Many functions and methods now have shape-aware return type annotations.
Type-checkers can now infer the number of dimensions of the returned array
through common operations. For example, np.linspace(0, 1) is now typed as a
1-d float64 array, and np.sum(x, keepdims=True) has the same number of
dimensions as x.

This covers numpy.linalg functions, array creation functions (like
asarray, from{buffer,string,file,iter,regex}), range functions
(linspace, logspace, geomspace), aggregation functions and methods
(sum, mean, std, var, min, max, all, any,
etc.), sorting (sort, argsort, argpartition), cumulative operations
(cumsum, cumprod, etc.), set operations (unique_values,
intersect1d, union1d, etc.), and various other functions including
nonzero, transpose, diagonal, atleast_{1,2,3}d, clip,
round, inner, bincount, and fft.fftfreq. Several of these also
gained more precise return dtype annotations as part of this work.

Shape-typing is still a work-in-progress, so coverage is not yet complete.
Because of limitations in Python's type system and current type-checkers,
shape-typing is often only implemented for the most common lower-rank cases.

(gh-31172)

numpy.fft typing improvements and preliminary shape-typing support

The numpy.fft functions now support non-float64/complex128 dtypes
and gain preliminary shape-typing support. For example, the return type of
numpy.fft.fft now depends on the shape-type of its inputs, falling back to
the backward-compatible return type when the shape-types are unknown at
type-checking time.

(gh-31226)

Changes

Structured array copies now use memcpy for contiguous dtypes

Copying structured arrays with identical dtypes now uses memcpy instead of
field-by-field transfer when the dtype has a contiguous layout (no gaps between
fields). A new NPY_NOT_TRIVIALLY_COPYABLE dtype flag is set on structured
dtypes that have gaps in their memory layout, such as those created with
explicit offsets or via multi-field indexing. Only these dtypes continue to
use the slower field-by-field copy.

This means that padding bytes in contiguous structured dtypes (e.g. those
created without explicit offsets) may now be copied as part of the
memcpy, whereas previously they were left untouched. Code that relies on
padding bytes being preserved during structured array copies may be affected.

(gh-29270)

numpy.ctypeslib.as_ctypes now does not support scalar types

The function numpy.ctypeslib.as_ctypes has been updated to only accept
numpy.ndarray. Passing a scalar type (e.g., numpy.int32(5)) will now
raise a TypeError. This change was made to avoid the issue
gh-30354 and to enforce the
readonly nature of scalar types in NumPy. The previous behavior relied on
undocumented implicit temporary arrays and was not well-defined. Users who
need to convert scalar types to ctypes should first convert them to an array
(e.g., numpy.asarray) before passing them to numpy.ctypeslib.as_ctypes.

(gh-30538)

__array_interface__ changes on scalars

Scalars now export the __array_interface__ directly rather than including
an array copy as a __ref entry. This means that scalars are now exported as
read-only while they previously exported as writeable. The path via __ref
was undocumented and not consistently used even within NumPy itself.

(gh-30538)

meshgrid now always returns a tuple

np.meshgrid previously used to return a list when sparse was true and
copy was false. Now, it always returns a tuple regardless of the
arguments.

(gh-30707)

numpy.triu_indices now accepts unsigned integers

numpy.triu_indices previously used to error in some cases when unsigned integers
were given as arguments. Now, it accepts them in all cases.

(gh-30869)

object dtype in .real and .imag and related functions

The array attributes .real and .imag now behave differently for object
arrays and return getattr(element, "real", element) or getattr(element, "imag", 0)
elementwise. Additionally, the return for both is now read-only to avoid possible
in-place changes having no effect.

This change also affects np.isreal() which uses arr.imag.

Previously, .imag always returned 0 while .real returned the
original array unmodified. The new behavior now returnes the correct values
for complex Python objects but may also lead to surprises for example if
element.real() is a method and not a property.

(gh-30984)

NumPy's internal memory allocations now use PyMem_RawMalloc

NumPy's internal memory allocations now use PyMem_RawMalloc instead of
malloc and can be tracked by tracemalloc.

(gh-31503)

v2.4.6

Compare Source

v2.4.5: (May 15, 2026)

Compare Source

NumPy 2.4.5 Release Notes

NumPy 2.4.5 is a patch release that fixes bugs discovered after the 2.4.4
release, has some typing improvements, and maintains infrastructure.

This release supports Python versions 3.11-3.14

Contributors

A total of 17 people contributed to this release. People with a "+" by their
names contributed a patch for the first time.

  • Aleksei Nikiforov
  • Anarion Zuo +
  • Ankit Ahlawat
  • Breno Favaretto +
  • Charles Harris
  • Igor Krivenko +
  • Ijtihed Kilani +
  • Joren Hammudoglu
  • Maarten Baert +
  • Matti Picus
  • Nathan Goldbaum
  • Praneeth Kodumagulla +
  • Ralf Gommers
  • RoomWithOutRoof +
  • Sebastian Berg
  • Warren Weckesser
  • div +
Pull requests merged

A total of 28 pull requests were merged for this release.

  • #​31093: MAINT: Prepare 2.4.x for further development
  • #​31182: TYP: fix np.shape assignability issue for python lists (#​31171)
  • #​31197: ENH: Return rank 0 for empty matrices in matrix_rank (#​30422)
  • #​31198: CI/BUG: add native jobs for s390x, fix bug in pack_inner...
  • #​31199: BUG: f2py map complex_long_double to NPY_CLONGDOUBLE
  • #​31205: MAINT: f2py: Stop setting re._MAXCACHE to 50.
  • #​31206: BUG: fix heap buffer overflow in timedelta to string casts
  • #​31207: MAINT: Rename ppc64le and s390x workflow (#​31121)
  • #​31208: BUG: Fix matvec/vecmat in-place aliasing (out=input produces...
  • #​31209: TYP: tile: accept numpy scalars and arrays as second argument...
  • #​31211: DEP: Undo deprecation for np.dtype() signature used by old pickles...
  • #​31212: REV: Manual revert of float16 svml use (#​31178)
  • #​31222: TYP: ix_ fix for boolean and non-1d input (#​31218)
  • #​31329: BUG: incorrect temp elision for new-style (NEP 43) user-defined...
  • #​31330: TYP: fix sliding_window_view axis parameter typing
  • #​31335: BUG: Prevent deadlock due to downstream importing NumPy in dlopen...
  • #​31336: BUG: Fix segfault in nditer.multi_index when __getitem__ raises...
  • #​31338: TYP: Fix ruff lint error
  • #​31357: BUG: fix memory leak in np.zeros when fill-zero loop raises (#​31320)
  • #​31358: BUG: np.einsum() fails with a 0-dimensional out argument and...
  • #​31379: BUG: Fix signed overflow issue in npy_gcd for INT_MIN on s390x...
  • #​31383: CI: remove Cirrus CI FreeBSD job (#​31380)
  • #​31390: BUILD: newer MKL uses so.3
  • #​31391: BLD/MAINT: improve support for Intel LLVM compilers
  • #​31401: BUG: Avoid UB in safe[add,sub,mul] helpers (#​31396)
  • #​31402: BUG: exclude __pycache__ directories from wheels (#​31397)
  • #​31404: TYP: _NestedSequence type parameter default to work around...
  • #​31426: TYP: Fix DTypeLike runtime type-checker support (#​31425)
pytorch/pytorch (torch)

v2.13.0: PyTorch 2.13.0 Release

Compare Source

PyTorch 2.13.0 Release Notes

Highlights

FlexAttention lands on Apple Silicon (MPS), with up to ~12x speedup over SDPA on sparse patterns, and gains a deterministic backward path on CUDA for reproducible gradient computation.
CuTeDSL "Native DSL" backend gives Inductor a second high-performance code path (alongside Triton) for key GPU operations, with faster compilation. [Prototype]
nn.LinearCrossEntropyLoss combines the final prediction and loss computation to cut peak GPU memory by up to 4x for large-vocabulary language model training.
torchcomms, a new communications backend for PyTorch Distributed, improves fault tolerance, scalability, and debuggability for large-cluster training.
FSDP2 now overlaps reduce-scatter and all-gather communications via a dedicated process group (opt-in), increasing distributed training throughput.
Python 3.15 wheel support for PyTorch on Linux via the pytorch repository index, including builds compatible with free-threaded 3.15t.
Broader platform support: ROCm gains AOTriton 0.12b with native HIP CMake, Arm adds Armv9-A torch.compile targeting, and Intel XPU exposes new device telemetry APIs.

For more details about these highlighted features, you can look at the release blogpost. Below are the full release notes for this release.

Tracked Regressions

ROCm wheels break torch.compile on CPU in environments without a GPU

Running a torch==2.13.0+rocm7.2 wheel in an environment where no GPU is available (torch.cuda.is_available() is False) breaks torch.compile on the CPU path: the first compile raises RuntimeError: Can't detect vectorized ISA for CPU (#​189194). This is a regression from torch==2.12.1+rocm7.2, which compiles CPU code fine (detecting e.g. VecAVX2) in the same setup. The 2.13 ROCm wheel appears to rely on something present in the ROCm builder image to detect the CPU vectorized ISA, so it works when run on a ROCm image but fails on a plain CPU-only image.

Workaround: run the +rocm wheel on a ROCm image, or install a standard CPU/CUDA build for GPU-less environments.

Backwards Incompatible Changes

  • Stop building CPython 3.13t (free-threaded) binaries (#​182951)

    Upstream pypa/manylinux removed CPython 3.13t (free-threaded) on 2026-05-07, because 3.13t
    was experimental and has been superseded by the now-non-experimental CPython 3.14t. As a result,
    PyTorch 2.13 no longer ships cp313t wheels (Linux, Triton, and related artifacts). Users on the
    free-threaded interpreter should move to Python 3.14t.

    PyTorch 2.12:

    # cp313t (free-threaded 3.13) wheels were available
    python3.13t -m pip install torch

    PyTorch 2.13:

    # Use free-threaded Python 3.14t instead
    python3.14t -m pip install torch
  • Bare PyObject is no longer allowed in operator schemas (#​184209)

    Bare PyObject was accidentally accepted in operator schema strings in
    PyTorch 2.12. This was undocumented and is now rejected, since torch.compile
    does not support arbitrary PyObject inputs to custom ops. If
    you parse or register a schema with a bare PyObject argument or return type,
    you will now get a schema parse error.

    PyTorch 2.12:

    >>> from torch._C import parse_schema
    >>> parse_schema("foo(PyObject x) -> ()")  # accepted

    PyTorch 2.13:

    >>> from torch._C import parse_schema
    >>> parse_schema("foo(PyObject x) -> ()")  # raises a schema parse error
  • Remove Bazel build support (#​180883)

    The Bazel build was never broadly adopted and still depended on the antiquated Bazel 6,
    while the wider ecosystem has since moved to Bazel 9. All Bazel build files and CI jobs have
    been removed. Users building PyTorch with Bazel should migrate to the supported CMake/pip install
    build flow.

    PyTorch 2.12:

    # Build PyTorch with Bazel
    bazel build //:torch

    PyTorch 2.13:

    # Bazel build files have been removed; build from source with pip instead
    pip install --no-build-isolation -e .
  • Enforce C++20 minimum in header guards (#​178150). In PyTorch 2.13, C++20 is now required to import PyTorch headers.

  • StorageImpl's built-in copy-on-write (COW) materialization is replaced by a pluggable materializer hook (#​179063)

    StorageImpl no longer knows about COW directly. Its internal COW entry points
    StorageImpl::is_cow(), StorageImpl::maybe_materialize_cow(), and the friend
    cow::materialize_cow_storage() have been removed in favor of a single pluggable
    MaterializeFn hook (void(*)(StorageImpl*)) that a backend registers to run once,
    on the first mutable data-pointer access. COW is now just one consumer of this hook
    (c10::impl::cow::materialize_cow), and all COW behavior (lazy clone, refcounted
    shared data, copy-on-write) is unchanged. This also gives accelerator backends and
    eager-mode graph compilers a zero-fast-path-cost place to commit deferred allocations
    or materialize symbolic buffers on first mutation.

    This is a C++-only change. It affects out-of-tree backends/extensions that called the
    removed StorageImpl COW symbols directly; they will fail to compile against 2.13
    with errors such as no member named 'is_cow' in 'c10::StorageImpl'. Migrate to the
    new hook API (set_materializer() / has_materializer() / clear_materializer()).

    PyTorch 2.12:

    // Detect a COW storage and force it to materialize.
    if (storage.is_cow()) {
      storage.maybe_materialize_cow();
    }

    PyTorch 2.13:

    // Register a one-shot materializer; it runs on the next mutable-data access
    // and then clears itself. COW registers c10::impl::cow::materialize_cow this way.
    storage.set_materializer(&my_backend_materialize);  // void(StorageImpl*)
    
    // `has_materializer()` replaces `is_cow()` for "is a deferred materialization pending?"
    if (storage.has_materializer()) { /* ... */ }
  • Convert shared_ptr<Node> to intrusive_ptr<Node> (#​181139). This changes the signature of Tensor::grad_fn. Accesses to Tensor.grad_fn() should change from std::shared_ptr<Node> to c10::intrusive_ptr<Node>. Similarly, construction of a C++ autograd function should change:

    PyTorch 2.12:

    std::shared_ptr<CustomCppNode> node(new CustomCppNode(), torch::autograd::deleteNode);

    PyTorch 2.13:

    auto node = c10::make_intrusive<CustomCppNode>();
  • The minimum supported NCCL version when building from source is now 2.23 (#​186292)

    PyTorch now requires NCCL >= 2.23 at compile time, and the preprocessor/runtime gates that guarded NCCL features introduced in 2.23 or earlier have been removed. Users who build PyTorch from source against a system NCCL older than 2.23 will hit compile errors against the dropped gates. Upgrade the NCCL installation to >= 2.23 to build. The prebuilt PyTorch wheels already bundle a compatible NCCL, so pip/conda users are unaffected.

  • Remove named tensors (#​173895)

    The named tensor feature (a long-deprecated prototype) has been fully removed to reduce overhead and code bloat. All associated Python and C++ APIs are gone, including Tensor.names, Tensor.rename(), Tensor.refine_names(), Tensor.align_to(), Tensor.align_as(), torch.align_tensors(), the names= keyword on factory functions (e.g. torch.zeros, torch.empty, torch.ones), and the C++ Dimname / DimnameList APIs. Code that previously relied on named dimensions must track dimension order positionally and avoid usage of any of these now-removed APIs or op overloads.

  • The onednn::qconv2d_pointwise.binary and .binary_tensor operators no longer alias their input but rather return fresh tensors. Previously these ops mutated the qaccum input buffer and returned it directly, violating the PyTorch invariant that custom operator outputs must not alias inputs. This silently bypassed aliasing checks via the old -> Tensor(a!) schema and would become a hard error in a future PyTorch version (as mentioned in #​182063), so the schema and implementation were corrected to return a fresh output. Most users are unaffected, only code that calls these ops directly and relies on the in-place mutation of qaccum must now read the returned tensor instead. (#​177171)

Deprecations

  • Custom operators that return an output aliasing one of their inputs are deprecated (#​182063)

    When a custom operator returns an output that is the same tensor as (or otherwise aliases) one of its inputs under torch.compile, PyTorch now emits a UserWarning stating that this is deprecated and will become an error in a future version of PyTorch. Previously the warning stated the change would land in PyTorch 2.12; that timeline has been pushed back. To update your code, return a clone of the offending output instead of the input, or refactor the operator so it does not return the aliased tensor.

    Deprecated:

    @&#8203;torch.library.custom_op("mylib::foo", mutates_args=())
    def foo(x: torch.Tensor) -> torch.Tensor:
        return x  # output aliases the input -- deprecated

    Updated:

    @&#8203;torch.library.custom_op("mylib::foo", mutates_args=())
    def foo(x: torch.Tensor) -> torch.Tensor:
        return x.clone()  # return a clone instead
  • Creating tensors with the quantized dtypes quint8, qint8, and qint32 is now deprecated and emits a warning. This covers both Python and C++ call sites; see #​184982 for migration guidance (#​184984)

    PyTorch 2.12:

    >>> x = torch.quantize_per_tensor(torch.randn(3), 0.1, 0, torch.quint8)

    PyTorch 2.13:

    >>> x = torch.quantize_per_tensor(torch.randn(3), 0.1, 0, torch.quint8)
    UserWarning: Creating tensors with quantized dtypes (quint8, qint8, qint32) is deprecated
  • Rename distributed collective ops to the _single naming scheme and deprecate the old names (#​186123, #​186124, #​186125, #​186134, #​186135, #​186144)

    To align the public torch.distributed collective APIs with the naming used by torchcomms' TorchCommBackend, all_gather_into_tensor is renamed to all_gather_single and reduce_scatter_tensor to reduce_scatter_single. The previous names continue to work as thin wrappers that delegate to the new functions, but now emit a FutureWarning.

    PyTorch 2.12:

    dist.all_gather_into_tensor(output, input)
    dist.reduce_scatter_tensor(output, input)

    PyTorch 2.13:

    dist.all_gather_single(output, input)
    dist.reduce_scatter_single(output, input)

New Features

Python Frontend

  • Add two new operator tags, torch.Tag.inplace and torch.Tag.out, that let an operator declare how it writes its result: inplace means it mutates a tensor in place, and out means it writes into a caller-provided output tensor. Native PyTorch operators are tagged automatically, and custom operators defined with torch.library can opt in by adding the tag. To be tagged inplace, an operator must take the tensor it mutates as its first positional argument (declared as Tensor(a!), and the only mutable argument) and return that same tensor. Tagging a custom operator this way improves its behavior under torch.compile: inplace ops now go through auto_functionalize, so the reinplacing pass can analyze clones and skip unnecessary copies, and both inplace and out ops get their fake/meta kernels generated for free. See the Python custom operators tutorial for how to author and tag custom operators. (#​181100, #​181099, #​184199, #​184200, #​184201, #​184202, #​184203, #​180851, #​180852)
  • Add const_data_ptr() Python binding to torch.Tensor for read-only data pointer access (#​180382)
  • Add an abbr property to torch.dtype that returns a dtype's short string abbreviation (e.g. torch.float32.abbr returns "f32") (#​177296)
  • Allow positional arguments to be passed as keyword arguments to autograd custom Functions (#​182206)
  • Expose rearrange in the torch.func namespace for einops-style tensor reshaping (#​173183)

torch.nn

Autograd

  • Add torch.autograd.graph.region_activation_memory_budget (#​185979)
  • Support passing gradient inputs as a dict to torch.autograd.grad and torch.autograd.backward (#​178140)

Distributed

  • Add a registration API for symmetric memory arguments (lib.register_symm_mem_args()), letting operators (including out-of-tree ops) declare which arguments require symmetric-memory allocation (#​173513)

  • Remove NCCLSymmetricMemory's explicit dependency on ProcessGroupNCCL, enabling symmetric memory to work with out-of-tree backends such as torchcomms (#​184260)

  • Support accessing the ReduceOp.PREMUL_SUM factor from Python when implementing process group backends in Python (#​185863)

  • Expose the NCCL 2.30 maxP2pPeers config binding (#​181686)

  • Add rocSHMEM Triton integration for symmetric memory on ROCm (#​178658)

  • Support passing extra keyword arguments to the loss function in pipeline schedules via a new loss_kwargs parameter to step(), enabling loss functions that require arguments beyond (output, target) (such as chunked cross-entropy needing token counts for scaling) (#​181057)

Distributed FSDP2

  • Add FSDPModule.set_separate_reduce_scatter_group to give reduce-scatter its own NCCL communicator, enabling opt-in overlap of all-gather and reduce-scatter (#​186335)
  • Add set_reduce_scatter_max_input_buffers to keep multiple reduce-scatter input buffers in flight, so backward compute no longer stalls waiting to recycle a single reduce-scatter buffer (#​186000)

Profiler

  • Profiler/Kineto now emits channel metadata on CUDA backends (#​185968)

Dynamo

  • Add torch.compiler.set_default_backend to override the default torch.compile backend globally, so out-of-tree backend authors don't need to pass backend= at every call site (following the pattern of torch.set_default_dtype/torch.set_default_device). Explicit backend= arguments still take precedence (#​178944)
  • Add torch.compile(f, isolate_recompiles=True) to give each torch.compile call its own isolated cache bucket, preventing cross-compile interference in cache lookups and recompile-limit checks when multiple torch.compile calls target the same function (#​178351)
  • Add register_multi_grad_hook support to @leaf_function, allowing a backward hook to fire once per backward pass when all requires_grad inputs have their gradients computed (#​179609)

Inductor

  • Add flash-decoding support to the CPU FlexAttention template (chosen when query length is 1) with a new configurable PARTITION_SIZE kernel option (#​159835)
  • Add Triton convolution backward kernels (input and weight gradients) as an autotuning backend in place of the ATen-only fallback (#​178945)
  • Add an Inductor FX pass (decomp_comms) that eliminates all_gather for Gram-matrix optimizer patterns (Muon/Shampoo) under FSDP, gated by config.aten_distributed_optimizations.allow_comms_decompositions, yielding 1.25-1.95x training speedups (#​184370)

Ahead-Of-Time Inductor (AOTI)

  • Generated C shims for the AOTI stable ABI are now versioned and gated by TORCH_TARGET_VERSION, so shims introduced in newer releases are only exposed when the target version supports them (#​181916)
  • Triton CPU AOTI models now work end-to-end through the public torch._inductor.aoti_compile_and_package / aoti_load_package API, including packaging and loading of the multiple .so files emitted per kernel (#​182251)
  • Added stable C shim functions (torch_exception_get_what, torch_exception_get_what_without_backtrace, and STABLE_TORCH_ERROR_CODE_CHECK) so extensions built against the stable ABI can retrieve the original error message across the C API boundary (target version 2.13+) (#​180135)
  • Added a stable AOTI stream shim aoti_torch_stream_native_handle and torch::stable::accelerator::Stream::nativeHandle(), gated behind TORCH_FEATURE_VERSION >= 2.13, for retrieving a native stream handle from the stable ABI (#​183930)

Release Engineering

CUDA

  • Add CUDAGraph.get_graph_data() for graph topology introspection (#​183165)
  • Lightweight API to get private pool reserved memory bytes (#​178240)

MPS

  • Add FlexAttention support for MPS (#​182552, #​186215)
  • Add support for torch.distributions.Dirichlet on MPS by adding _sample_dirichlet and _dirichlet_grad Metal implementations (#​185458, #​185854)
  • Add grid_sampler_2d backward support on MPS (#​179756)
  • Add grid_sampler_3d backward support on MPS (#​179388)
  • Add lcm support on MPS via a new Metal kernel (#​186279)
  • Add complex support to c10/metal/reduction_utils.h (#​180708) and a complex->bool specialization (#​185938)

ROCm

  • Enable external events in CUDA graphs (#​178264)
  • Enable GPU Address Sanitizer build (#​183792, #​176461)
  • Improve Inductor GEMM search space performance using the Origami project (#​172512)
  • Use CMake native HIP language support, enable_language(HIP) (#​180485)
  • New Inductor benchmarker based on Torch Profiler (#​175097)

XPU

  • Add XPU device telemetry APIs for temperature, frequency, power draw, engine utilization, memory bandwidth usage, and used devi

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "before 9am on Monday"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/py/ml-frameworks branch from e000a30 to 06b362b Compare May 19, 2026 01:01
@renovate renovate Bot force-pushed the renovate/py/ml-frameworks branch 2 times, most recently from 4a0352f to 5712155 Compare June 18, 2026 00:07
@renovate renovate Bot force-pushed the renovate/py/ml-frameworks branch from 5712155 to c9a58fc Compare June 22, 2026 02:00
@renovate renovate Bot force-pushed the renovate/py/ml-frameworks branch from c9a58fc to b0ccde2 Compare July 4, 2026 17:36
@renovate renovate Bot force-pushed the renovate/py/ml-frameworks branch from b0ccde2 to a95e2b2 Compare July 8, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants