-
Notifications
You must be signed in to change notification settings - Fork 656
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
[2.5.0] Center of charge test failures on macOS runners #4211
Comments
Do you even have an idea what could cause the issue? Is it specific to Intel Mac?? |
Yeah Intel Mac only. It's odd because the tests haven't changed, which makes me think that the base numpy version we use to cythonize might be to blame here. I want to check that once the new CI checks are in place. |
Actually I don't know if it's specific to x86_64 intel - can anyone with a macos-arm64 confirm that this happens if they pull from conda-forge? Note: this is only happening on conda-forge. I'm currently thinking it might be down to clang 15. |
I will add here that the osx-arm64 builds on the feedstock aren't facing the issue, so maybe it is just x86_64: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=753485&view=logs&j=9c5ef928-2cd6-52e5-dbe6-9d173a7d951b&t=c66c4975-bbef-551b-2ee6-85005a231b12 |
tagging @RMeli who has both an intel and arm macos machine |
Where I'm at on all this:
|
Short of someone giving me access to a macos x86_64 machine, I'm rapidly running out of options (and weekend patience..) on this one. |
I can confirm that I don't see this issue on mamba create -n mda-2.5.0-test MDAnalysis=2.5.0 MDAnalysisTests pytest pytest-xdist
mamba activate mda-2.5.0-test
pytest --disable-pytest-warnings --pyargs MDAnalysisTests --numprocesses 4
I'll try |
This smells of compiler flags to me, I'll try and see if any extra optimisations on CF. |
Here are the flags apparently set by CF:
|
Strange that they use |
:/ I think we're going to have to create a custom |
I'm AFK, but I can certainly try ASAP. |
If someone gives me instructions that even an idiot (I mean, PI) could follow then I'll be happy to do it. Sorry, a bit short on time to figure it out. |
Should be enough to uncomment
then recompile on your Intel Mac and see if that breaks the tests |
On x86_64 intel macOS 13.5 with Python 3.10 and the diff --git a/package/setup.cfg b/package/setup.cfg
index b4151d55f..18ca2f399 100644
--- a/package/setup.cfg
+++ b/package/setup.cfg
@@ -9,7 +9,7 @@
## Uncomment the below line to generate the annotated cython HTML output
# annotate_cython=True
## any additional compiler flags for core C routines, excluding ENCORE
-#extra_cflags =
+extra_cflags = -msse3
[build_sphinx]
all-files = 1
set up and testingmamba create -c conda-forge -n mda310y python==3.10 pytest pytest-xdist
mamba activate mda310y
pip install -v -e package/
pip install -v -e testsuite/ Inspecting the output shows that
run tests
results
|
Sorry @orbeckst my theory was that the flag causes the issue. Do you get the issue without the flag ? |
Ok, I'll try a build without first. |
(FYI: warning: MDAnalysis/lib/nsgrid.pyx:86:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310 from Cython...) |
I built without |
I removed We wanted to remove it anyway #3821 — can I submit a PR? diff --git a/package/setup.py b/package/setup.py
index 898ab5b3b..f6467bc4b 100755
--- a/package/setup.py
+++ b/package/setup.py
@@ -268,7 +268,7 @@ def extensions(config):
use_openmp = config.get('use_openmp', default=True)
annotate_cython = config.get('annotate_cython', default=False)
- extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops',
+ extra_compile_args = ['-std=c99', '-O3', '-funroll-loops',
'-fsigned-zeros'] # see #2722
define_macros = []
if config.get('debug_cflags', default=False): result
|
@hmacdope I also tested with diff --git a/package/setup.cfg b/package/setup.cfg
index b4151d55f..18ca2f399 100644
--- a/package/setup.cfg
+++ b/package/setup.cfg
@@ -9,7 +9,7 @@
## Uncomment the below line to generate the annotated cython HTML output
# annotate_cython=True
## any additional compiler flags for core C routines, excluding ENCORE
-#extra_cflags =
+extra_cflags = -msse3
[build_sphinx]
all-files = 1
diff --git a/package/setup.py b/package/setup.py
index 898ab5b3b..f6467bc4b 100755
--- a/package/setup.py
+++ b/package/setup.py
@@ -268,7 +268,7 @@ def extensions(config):
use_openmp = config.get('use_openmp', default=True)
annotate_cython = config.get('annotate_cython', default=False)
- extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops',
+ extra_compile_args = ['-std=c99', '-O3', '-funroll-loops',
'-fsigned-zeros'] # see #2722
define_macros = []
if config.get('debug_cflags', default=False): |
@hmacdope is the output of the tests on intel mac actually wrong or just showing up on the other side of the box, i.e., still correct under PBC? |
Playing with it on paper it seems that way. I will spare you my shoddily drawn diagrams. I swear we agreed to remove |
Probably something to add here, I think the reason that our PyPi cron checks weren't failing but the conda-forge ones are is that the former is defaulting to gcc whilst the latter is using clang. We probably need to rethink what our build matrix's default compilers are at some point (I started doing that at some point and it became super messy). |
I would advocate for |
🤦🏽 I think I know what I did wrong. This is a me forgetting what I did in the past issue. |
@hmacdope just to clarify your comment #4211 (comment) : I read it as that you're confirming that the failing tests here are still showing scientifically correct results but that they are producing alternative results (i.e., it's more of a reproducibility issue). Is that a correct interpretation? (I am asking because that seems to determine how we will handle PR #4220 .) |
Yep that is correct. It's basically a sign bit issue due to some denormal to 0 squashing. Results are scientifically correct. |
* Fix AtomGroup.center_of_charge(..., unwrap=True) giving inconsistent (but scientifically correct) results on Intel macOS (Issue #4211) * Removed `-ffast-math` compiler flag to avoid potentially incorrect floating point results in MDAnalysis *and* other codes when MDAnalysis shared libraries are loaded --- see https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html (Issues #3821, #4211)
Expected behavior
All tests on our latest production release should pass across expected machine types (especially ubuntu, and macos).
Actual behavior
As reported by @orbeckst here (and reproduced in #4210), tests for CoC unwrapping are failing.
This isn't seen on develop.
Code to reproduce the behavior
Run tests on the 2.5.0 on an intel macOS machine
The text was updated successfully, but these errors were encountered: