-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add M1 image for MacOS for tests #779
Conversation
The lowest version arm64 Python is presently 3.10 so I switched to that, as the lower version used, as the 3.8 had before failed since it could not find a compatible Python from the available set which indeed there is not presently It did indeed fail on the unit tests indicated in #726. I added enforce_psd=False to both tests, as they should be PSD since its an ideal statevector computation the sampler uses.
|
Hmmm, this installed Python 3.12.1 for some reason rather than the new 3.12.2 and 3.12.1 causes a known issue with testtools (used by stestr that we use for testing) where this issue was a breaking change in the unit test result that was reverted in 3.12.2. I'll try just re-running the job and see. It passed the nightly CI so unless there is some more recent change - I do not think anything done by this PR should cause this. I just re-ran the job and I see in the log this time its installing 3.12.2 as expected. So I have no idea what happened above. I expect it to pass now as it will no longer break in the test infrastructure when skipping tests. |
Pull Request Test Coverage Report for Build 8332909604Details
💛 - Coveralls |
This all passes, but as expected the couple of unit tests that we saw fail on an M2 machine, failed here too with M1. I updated them to remove the enforce psd as described above. At this point its ready. If we want to have these jobs Required too, I do not see why we wouldn't, then the Branch Rules need to be updated for that. Since this is only CI, and to keep CI current there in stable, since otherwise I thinks it the same as main, I think adding the StableBackportPotential label would be good to have it backported as well. |
It is interesting, but I can't reproduce the issue on M1 and python 3.11. I think, putting |
Strange - we have not really determined why this happens. Its not only M1/M2, where this seems to have surfaced more, as #726 has the same issue with a different OS on x86 This is qiskit.primitives Sampler so the result should be ideal and not need enforce_psd. I can tell you if you replace that by the Aer sampler in ideal mode (shots=None), and give that explicitly to the fidelity so it does not use the default, then the test passes. So its not clear the exact cause of why, in certain environments, this comes up with a different answer. Yes one could reduce the accuracy of the test, but if enforce_psd is not required - it should not be required for an ideal outcome right - that seemed better to me. The fact that with enforce_psd it seems to change things under certain conditions, presumably a slightly different sampler result, and causes a different outcome, without further investigation of exactly what is happening and pinning the cause down I guess we will not know. |
@oscar-wallis What do you think how we should proceed here? I'm fine either way: merge as it is now, update the tests, or something else. |
Let me link #434 which is intended to improve these tests - if we have M1 job in place at that point it will be interesting to see if there is any difference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the current, however, do we need a release note for this?
Release notes are for changes to/around the public API that are of concern to end users. This can include bug fixes of course since these can be perceived when using the public API, and performance. Internal refactoring that does not reflect in public API would not need one, nor do changes to CI like this. |
Summary
#726 documents issues using M2. Github recently made M1 images available and this updates the main workflow to include jobs running under
3.83.10 and 3.12 (lower(3.10 is is the min available at present for arm64) and upper Python versions supported).Adding M1 had been talked about in Optimization and and issue exists there qiskit-community/qiskit-optimization#593 which has a link to the github announce for the M1 capability. Linking the issue to this PR can also inform Opt on how I did it here.
Details and comments
I marked on OnHold - lets see how this goes. I kinda expect it may fail the tests that #726 does. If failed as expected, I altered them as described below and removed the OnHold as it all passes.