Skip to content

BUG, SIMD: use scalar cmul on bad Apple clang x86_64#24828

Merged
charris merged 2 commits intonumpy:mainfrom
jakelishman:scalar-cmul-bad-apple-clang
Sep 28, 2023
Merged

BUG, SIMD: use scalar cmul on bad Apple clang x86_64#24828
charris merged 2 commits intonumpy:mainfrom
jakelishman:scalar-cmul-bad-apple-clang

Conversation

@jakelishman
Copy link
Copy Markdown
Contributor

Apple clang 14.0.0 outputs code with non-deterministic behaviour for the AVX2-accelerated multiply ufunc on complex64 and complex128 for x86_64 on macOS with AVX2 enabled. This bug is fixed by Apple clang 14.0.3, but 14.0.0 is still commonly the available toolchain on CI images.

In order to not output unsound code, this simply skips the SIMD version of the ufunc when using an affected compiler.

Fix #24000.

Apple clang 14.0.0 outputs code with non-deterministic behaviour for the
AVX2-accelerated `multiply` ufunc on `complex64` and `complex128` for
x86_64 on macOS with AVX2 enabled.  This bug is fixed by Apple clang
14.0.3, but 14.0.0 is still commonly the available toolchain on CI
images.

In order to not output unsound code, this simply skips the SIMD version
of the ufunc when using an affected compiler.
@jakelishman jakelishman force-pushed the scalar-cmul-bad-apple-clang branch from 4f3ff78 to 012e048 Compare September 28, 2023 15:49
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Sep 28, 2023
@charris charris merged commit f2a9b50 into numpy:main Sep 28, 2023
charris added a commit to charris/numpy that referenced this pull request Sep 28, 2023
* BUG, SIMD: use scalar cmul on bad Apple clang x86_64

Apple clang 14.0.0 outputs code with non-deterministic behaviour for the
AVX2-accelerated `multiply` ufunc on `complex64` and `complex128` for
x86_64 on macOS with AVX2 enabled.  This bug is fixed by Apple clang
14.0.3, but 14.0.0 is still commonly the available toolchain on CI
images.

In order to not output unsound code, this simply skips the SIMD version
of the ufunc when using an affected compiler.

* MAINT: Formatting cleanup.

---------

Co-authored-by: Charles Harris <[email protected]>
@jakelishman jakelishman deleted the scalar-cmul-bad-apple-clang branch September 28, 2023 19:46
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Sep 28, 2023
charris added a commit that referenced this pull request Sep 28, 2023
BUG, SIMD: use scalar cmul on bad Apple clang x86_64 (#24828)
charris added a commit to charris/numpy that referenced this pull request Nov 11, 2023
* BUG, SIMD: use scalar cmul on bad Apple clang x86_64

Apple clang 14.0.0 outputs code with non-deterministic behaviour for the
AVX2-accelerated `multiply` ufunc on `complex64` and `complex128` for
x86_64 on macOS with AVX2 enabled.  This bug is fixed by Apple clang
14.0.3, but 14.0.0 is still commonly the available toolchain on CI
images.

In order to not output unsound code, this simply skips the SIMD version
of the ufunc when using an affected compiler.

* MAINT: Formatting cleanup.

---------

Co-authored-by: Charles Harris <[email protected]>
@TimotheusBachinger TimotheusBachinger mentioned this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Multiply complex128 ufunc inconsistent with AVX2

2 participants