-
-
Notifications
You must be signed in to change notification settings - Fork 6
CI: Adding CI to test old CPU for SIMD compatibility via SDE Emulation #59
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
34e56a2
test the workflow
SwayamInSync 703c956
adding mpmath dependecy
SwayamInSync 4ba87d3
rename
SwayamInSync 9b9a264
trying strategy
SwayamInSync 2b5841c
Merge branch 'main' into old-cpu
SwayamInSync 239d11d
use fail-fast
SwayamInSync File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: Test on Older CPUs (x86-64-v2) | ||
|
|
||
| # This workflow tests numpy-quaddtype on older x86 CPUs using Intel SDE. | ||
| # It ensures compatibility with x86-64-v2 baseline CPUs (e.g., Sandy Bridge) | ||
| # that don't have AVX2/FMA support. | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test_sandy_bridge: | ||
| name: Test on Sandy Bridge (x86-64-v2) | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Intel SDE | ||
| run: | | ||
| curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/859732/sde-external-9.58.0-2025-06-16-lin.tar.xz | ||
| mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/ | ||
| sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y cmake gcc g++ make git pkg-config | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| pip install -U pip | ||
| pip install numpy meson meson-python ninja pytest | ||
|
|
||
| - name: Build numpy-quaddtype | ||
| env: | ||
| LDFLAGS: "-fopenmp" | ||
| run: | | ||
| pip install . --no-build-isolation -v | ||
|
|
||
| - name: Test import on Sandy Bridge (x86-64-v2) | ||
| run: | | ||
| echo "Testing basic import on Sandy Bridge..." | ||
| sde -snb -- python -c " | ||
| import numpy as np | ||
| print('NumPy version:', np.__version__) | ||
| from numpy_quaddtype import QuadPrecDType | ||
| print('QuadPrecDType imported successfully!') | ||
| arr = np.zeros(3, dtype=QuadPrecDType()) | ||
| print('Created quad array:', arr) | ||
| print('SUCCESS: No illegal instruction on Sandy Bridge!') | ||
| " | ||
|
|
||
| - name: Run tests on Sandy Bridge | ||
| run: | | ||
| pip install pytest mpmath | ||
| sde -snb -- python -m pytest tests/ -v --tb=short | ||
|
|
||
| test_haswell: | ||
| name: Test on Haswell (x86-64-v3) | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Intel SDE | ||
| run: | | ||
| curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/859732/sde-external-9.58.0-2025-06-16-lin.tar.xz | ||
| mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/ | ||
| sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y cmake gcc g++ make git pkg-config | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| pip install -U pip | ||
| pip install numpy meson meson-python ninja pytest | ||
|
|
||
| - name: Build numpy-quaddtype | ||
| env: | ||
| LDFLAGS: "-fopenmp" | ||
| run: | | ||
| pip install . --no-build-isolation -v | ||
|
|
||
| - name: Test import on Haswell (x86-64-v3) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo, it's |
||
| run: | | ||
| echo "Testing basic import on Haswell..." | ||
| sde -hsw -- python -c " | ||
| import numpy as np | ||
| print('NumPy version:', np.__version__) | ||
| from numpy_quaddtype import QuadPrecDType | ||
| print('QuadPrecDType imported successfully!') | ||
| arr = np.zeros(3, dtype=QuadPrecDType()) | ||
| print('Created quad array:', arr) | ||
| print('SUCCESS: Works on Haswell!') | ||
| " | ||
|
|
||
| - name: Run tests on Haswell | ||
| run: | | ||
| pip install pytest mpmath | ||
| sde -hsw -- python -m pytest tests/ -v --tb=short | ||
Oops, something went wrong.
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.
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.
Only if you care to mess with it: I bet you can make a build matrix like:
And then reduce the definition to use only one job definition and rely on the build matrix to generate the two almost-identical jobs.