[Numpy-discussion] Re: Bumping CPU baseline to x86-64-v2

2025-05-17 Thread Charles R Harris via NumPy-Discussion
On Fri, May 16, 2025 at 4:23 AM Sayed Adel  wrote:

> Hi All,
>
> I wanted to bring your attention to an important change to NumPy that will
> affect CPU compatibility requirements on x86.
>
> PR #28896 (https://github.com/numpy/numpy/pull/28896) is reorganizing how
> NumPy handles x86 CPU features by moving from individual instruction set
> extensions to standardized microarchitecture levels. As part of this
> change,
>
> *the minimum CPU requirement for x86 systems will be raised to x86-64-v2*If
> your x86 CPU was manufactured in 2009 or later, you likely won't be
> affected, unless you're using Intel Atom CPUs released before 2013.
> We're making this change in 2025, when CPUs that don't support x86-64-v2
> are now over 15 years old. Supporting these antiquated processors increases
> maintenance burden and binary size.
> Bumping the default baseline can also increase the performance since not
> all code paths are dispatched.
> --
> Cheers,
> Sayed
>
>
Sounds good to me.

Chuck
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Bumping CPU baseline to x86-64-v2

2025-05-17 Thread mhvk
Hi Sayed,

I'm a bit confused: does your suggested change mean that prre-2009 processors 
won't work at all, or that no use will be made of the (little) acceleration 
that they provided?  The latter seems fine, but not working at all seems rather 
bad. Though I'd think that for any old processors one can just fall back to the 
standard `libm` implementations.

All the best,

Marten
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Bumping CPU baseline to x86-64-v2

2025-05-17 Thread Sayed Adel
Hi Marten,

By default, they won't work at all - Python runtime error will be raised or
segfault/illegal instruction error may occur. However, if Linux distros or
downstream packagers want to change this default setting, they can do it
through the build options, but without manual SIMD support for the baseline
- just the scalar fallbacks. They can still count on the dispatched kernels
for newer processors.

I have also updated the docs providing an example for this case, see:
https://github.com/numpy/numpy/blob/c41541abe9656987c34eb3f5822879ade84ec612/doc/source/reference/simd/build-options.rst#targeting-older-cpus
On Sat, May 17, 2025 at 4:01 PM  wrote:

> Hi Sayed,
>
> I'm a bit confused: does your suggested change mean that prre-2009
> processors won't work at all, or that no use will be made of the (little)
> acceleration that they provided?  The latter seems fine, but not working at
> all seems rather bad. Though I'd think that for any old processors one can
> just fall back to the standard `libm` implementations.
>
> All the best,
>
> Marten
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: se...@imavr.com
>


--
Cheers,
Sayed

Sayed Adel
GitHub: seiko2plus
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: Bumping CPU baseline to x86-64-v2

2025-05-17 Thread Ralf Gommers via NumPy-Discussion
On Sat, May 17, 2025 at 3:00 PM  wrote:

> Hi Sayed,
>
> I'm a bit confused: does your suggested change mean that prre-2009
> processors won't work at all, or that no use will be made of the (little)
> acceleration that they provided?  The latter seems fine, but not working at
> all seems rather bad.


I don't think it's that bad. It's always a tradeoff between performance,
binary size, effort, and compatibility. We've had this discussion before,
e.g. when moving to SSE3 as the baseline, and decided that we should not
drop support for a feature if less than 99.5% of CPUs in the wild has
support, but if it's above we can do it. Previous bumps have not given any
significant pushback from our user base.

>From https://github.com/numpy/numpy/issues/27851, half a year ago:

*The most widely used data source for determining what hardware is out
there is, I believe,
https://store.steampowered.com/hwsurvey/?platform=combined
. That
currently says that SSE3 is at 100%, SSE4.1 at 99.78% and SSE4.2 at 99.70%.
Meaning that if we bump the baseline up to SSE4.2, we'd only be dropping
support for ~0.3% of systems with really old CPUs.*

SSE 4.2 support as of today increased to 99.78%, so the number of CPUs we'd
drop support for moved from 0.3% to 0.22% in 6 months. That means we're
still being very conservative after this bump, IIRC more so than when we
dropped support for CPUs without SSE3.

Cheers,
Ralf



> Though I'd think that for any old processors one can just fall back to the
> standard `libm` implementations.
>
> All the best,
>
> Marten
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ralf.gomm...@gmail.com
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] NumPy 2.2.6 released

2025-05-17 Thread Charles R Harris via NumPy-Discussion
Hi All,

NumPy 2.2.6 is a patch release that fixes bugs found after the 2.2.5
release. It is a mix of typing fixes/improvements as well as the normal
bug fixes and some CI maintenance.

This release supports Python 3.10-3.13. Wheels can be downloaded from PyPI
; source archives, release notes, and
wheel hashes are available on Github
.


*Contributors*

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

   - Charles Harris
   - Ilhan Polat
   - Joren Hammudoglu
   - Marco Gorelli +
   - Matti Picus
   - Nathan Goldbaum
   - Peter Hawkins
   - Sayed Adel


*Pull requests merged*

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

   - #28778: MAINT: Prepare 2.2.x for further development
   - #28851: BLD: Update vendor-meson to fix module_feature conflicts
   arguments\...
   - #28852: BUG: fix heap buffer overflow in np.strings.find
   - #28853: TYP: fix `NDArray[floating] + float` return type
   - #28864: BUG: fix stringdtype singleton thread safety
   - #28865: MAINT: use OpenBLAS 0.3.29
   - #28889: MAINT: from_dlpack thread safety fixes
   - #28913: TYP: Fix non-existent `CanIndex` annotation in
   `ndarray.setfield`
   - #28915: MAINT: Avoid dereferencing/strict aliasing warnings
   - #28916: BUG: Fix missing check for PyErr_Occurred() in
   \_pyarray_correlate.
   - #28966: TYP: reject complex scalar types in ndarray.\_\_ifloordiv\_\_


Cheers,

Charles Harris
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com