Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax CI constraint on numpy<1.25 #11020

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

jakelishman
Copy link
Member

Summary

The major problem in NumPy 1.25 transpired to be that particular versions of Apple clang (including the one used in Numpy's wheel-build CD pipelines) produced non-deterministic code from new SIMD routines for complex multiplication. This in turn destabilised our Isometry decompositions, which caused major correctness problems. As of Numpy 1.26.1 (released 2023-10-14), that SIMD code now decays to the scalar form if the compiler was known to be buggy, which restores the previous behaviour.

Details and comments

See numpy/numpy#24000 for details.

Fix #10305
Close #10906 (obsolete now that there's a fixed Numpy released)

The major problem in NumPy 1.25 transpired to be that particular
versions of Apple clang (including the one used in Numpy's wheel-build
CD pipelines) produced non-deterministic code from new SIMD routines for
complex multiplication.  This in turn destabilised our `Isometry`
decompositions, which caused major correctness problems.  As of Numpy
1.26.1 (released 2023-10-14), that SIMD code now decays to the scalar
form if the compiler was known to be buggy, which restores the previous
behaviour.
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Oct 16, 2023
@jakelishman jakelishman requested a review from a team as a code owner October 16, 2023 10:18
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@jakelishman
Copy link
Member Author

The common errors between Linux/macOS/Windows and Numpy 1.26.1 are fixed by #11023. I'm not certain if the Linux+UnitarySynthesis error is related in the same way; I suspect not, and it might need a separate fix, but I'll dig into that in a second. It looks quite plausible that the test is too conservative in its assertions, and it's a spurious failure caused by some minor changes in Numpy causing us to generate a slightly better decomposition in the non-optimised case, but I'll look in more detail later.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6619917150

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.03%) to 86.905%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lex.rs 1 92.17%
Totals Coverage Status
Change from base Build 6615597584: 0.03%
Covered Lines: 73855
Relevant Lines: 84984

💛 - Coveralls

@mtreinish mtreinish added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 27, 2023
@mtreinish mtreinish added this pull request to the merge queue Nov 10, 2023
Merged via the queue into Qiskit:main with commit fb8a69d Nov 10, 2023
13 checks passed
mergify bot pushed a commit that referenced this pull request Nov 10, 2023
The major problem in NumPy 1.25 transpired to be that particular
versions of Apple clang (including the one used in Numpy's wheel-build
CD pipelines) produced non-deterministic code from new SIMD routines for
complex multiplication.  This in turn destabilised our `Isometry`
decompositions, which caused major correctness problems.  As of Numpy
1.26.1 (released 2023-10-14), that SIMD code now decays to the scalar
form if the compiler was known to be buggy, which restores the previous
behaviour.

(cherry picked from commit fb8a69d)
@jakelishman jakelishman deleted the relax-numpy-constraint branch November 10, 2023 18:28
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Nov 10, 2023
Removing the restriction on the numpy version has introduced some
non-determinism to some of the unitary synthesis tests that is causing a
flaky failure in CI. This commit reverts the version cap removal to
unblock CI. In parallel we should debug the source of the instability
causing the test to fail so we can run CI using the latest version of
numpy.

This reverts commit fb8a69d.
github-merge-queue bot pushed a commit that referenced this pull request Nov 11, 2023
Removing the restriction on the numpy version has introduced some
non-determinism to some of the unitary synthesis tests that is causing a
flaky failure in CI. This commit reverts the version cap removal to
unblock CI. In parallel we should debug the source of the instability
causing the test to fail so we can run CI using the latest version of
numpy.

This reverts commit fb8a69d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatibility with Numpy 1.25
4 participants