Repository navigation
Conversation
Member
|
This sounds like a clang bug that should also be reported upstream. |
Member
|
The test failure looks real. |
Contributor
|
There is a similar issue for float32 / float64 power computation: gh-18555. |
rgommers
force-pushed
the
complexfloordiv
branch
from
March 13, 2021 09:16
757e3a4 to
8951e12
Compare
Member
That does sound reasonable. Seems like this didn't pass CI though, rebased to get a fresh signal. |
Contributor
|
#18571 is an alternative to this as the tests don't pass with this PR |
Member
|
This does still fail: The alternative in gh-18571 is easier to verify, and currently passing. So maybe we should prefer that. Anyone have an opinion? |
Member
Member
|
The alternative in #18571 was merged. Closing, please reopen or resubmit if there is more to do here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building
numpyon the new Apple Silicon osx-arm64 platform using clang11 (see https://conda-forge.org/blog/posts/2020-10-29-macos-arm64/ for details), numpy fails tests because of extra divide-by-zero warnings when performing floor division with complex number arrays, even though the computations themselves work just fine.I tracked this to the code in
@TYPE@_floor_dividefor complex types, where it appears that the optimizer on arm64 ends up dispatching both branches at the same time. Even though the second branch is discarded because it is not the code path, the divide-by-zero leaves behind a "ghost" floating point exception, and the tests fail.Replacing the code with the same routine that is used for scalar complex floor division in
scalarmath.c(usingnpy_divmod) does not suffer from this problem. It is also reasonable, I believe, for scalar and array methods to use the same algorithm.