-
Notifications
You must be signed in to change notification settings - Fork 77
Include MACOS arm64 compatibility in manage.sh #929
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
ba5ab6c
a681ed3
5749e4a
5236913
c8006e6
5e739d5
ea02708
ed1a852
e945552
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # This workflow will install IC on arm based system. | ||
|
|
||
| name: Arm compatibility test | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.8] | ||
| #platform: [ubuntu-18.04, macos-latest] | ||
| platform: [macos-latest] | ||
| runs-on: ${{ matrix.platform }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Get LFS files | ||
| run: git lfs pull | ||
| # - name: Fix Conda permissions on macOS | ||
| # run: sudo chown -R $UID $CONDA | ||
| # if: runner.os == 'macOS' | ||
|
|
||
| - name: Install IC | ||
| run: | | ||
| source manage.sh work_in_python_version_no_tests ${{ matrix.python-version }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,11 +56,29 @@ function install_conda { | |
| ;; | ||
| esac | ||
|
|
||
|
|
||
| case "$(uname -m)" in | ||
|
|
||
| x86_64) | ||
| export ARCH=x86_64 | ||
| ;; | ||
|
|
||
| arm64) | ||
| export ARCH=arm64 | ||
| ;; | ||
|
|
||
| *) | ||
| echo "Installation only supported on x86_64 and arm architecture" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
||
|
|
||
|
|
||
| if conda --version ; then | ||
| echo Conda already installed. Skipping conda installation. | ||
| else | ||
| echo Installing conda for $CONDA_OS | ||
| CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py${PYTHON_VERSION//.}_4.9.2-${CONDA_OS}-x86_64.sh" | ||
| CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py${PYTHON_VERSION//.}_4.12.0-${CONDA_OS}-${ARCH}.sh" | ||
| if which wget; then | ||
| wget ${CONDA_URL} -O miniconda.sh | ||
| else | ||
|
|
||
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.
Did you try to extend the existing workflow (test_suite.yml) to include
macos-latest? Perhaps the tests fail, in that case we should probably do something about it.Uh oh!
There was an error while loading. Please reload this page.
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.
The tests do fail, but only because it doesn't recognise the conda environment, tries reinstalling it, and fails when it realises it already exists. You can see me trying it here. I could be wrong about the exact reasoning, but this was what I understood.
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 believe the problem is that conda is not set up when
work_in_python_versionis run for the second time1 as you can see from line 6:so it tries to install it again and then if finds that the miniconda folder already exists.
Footnotes
first time is during installation, second time when executing the test suite ↩
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.
Indeed, but trying to set up conda came with a new error as seen here. This is (as far as I understand) due to the userspace directories being configured slightly differently between linux and MACOSX. I'll try reconfiguring this to work now.
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.
Actually, I've never noticed that. I don't see where this variable is set. I certainly don't have it set neither before nor after setting up conda... I guess those instructions are outdated, or designed exclusively for GHA.
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.
If it does, then it's just a matter of setting
CONDAin a os-dependent manner.They are not trivial errors. I've seem this in macs, but I've haven't had the time or the energy to deal with it. I believe the root of the problem is that the interpolation is different between mac and linux (or perhaps between arm and x86). Then, the rest of the errors are consequences of that. Can you add
aarch64to see if we see the same failures?Uh oh!
There was an error while loading. Please reload this page.
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.
Testing this currently in this branch, GHA for linux on arm found here
EDIT: Same errors by the looks of it:
It must be a difference in some package wrt architecture, I can look into it at some point, should I open an issue? In the meantime, until I can figure out the issue, should we put the PR on hold? The functionality doesn't matter too much if IC can't then be used for certain tasks.
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.
To continue on from this, I'm pretty confident after looking at this error (specifically the array output):
It seems to be due to something similar to what's discussed here, numpy operations differ between architectures enough that they can compound and produce not-insignificant differences.
Not sure whether to refactor the code to try and avoid these issues with the interpolation functions, make the tests more lenient, or something else. Do you have a preference?
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.
If it is a matter of not using enough precision, I would go for ensuring we use float64 in those functions.
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.
In this test, the
interpolate_signalseems to already usenp.float64for its output fromscipy.interpolate.griddata. I can't see where else the imprecision could come from in this specific case.I'll hopefully have an arm setup to test more explicitly soon in my spare time (as creating arm VMs on x86 isn't working for me, annoyingly.)