From 34e56a2ad358c010c694d07a371096243548533e Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 21 Jan 2026 04:53:22 +0530 Subject: [PATCH 1/5] test the workflow --- .github/workflows/test_old_cpu.yml | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/test_old_cpu.yml diff --git a/.github/workflows/test_old_cpu.yml b/.github/workflows/test_old_cpu.yml new file mode 100644 index 0000000..28a3f3d --- /dev/null +++ b/.github/workflows/test_old_cpu.yml @@ -0,0 +1,117 @@ +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, no AVX2) + 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: | + sde -snb -- python -m pytest tests/ -v --tb=short + + test_haswell: + name: Test on Haswell (x86-64-v3, with AVX2) + 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) + 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: | + sde -hsw -- python -m pytest tests/ -v --tb=short From 703c9568ebcf46069ecaf90c90cba60e731bd883 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 21 Jan 2026 05:09:01 +0530 Subject: [PATCH 2/5] adding mpmath dependecy --- .github/workflows/test_old_cpu.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_old_cpu.yml b/.github/workflows/test_old_cpu.yml index 28a3f3d..abbc4f2 100644 --- a/.github/workflows/test_old_cpu.yml +++ b/.github/workflows/test_old_cpu.yml @@ -62,6 +62,7 @@ jobs: - name: Run tests on Sandy Bridge run: | + pip install pytest mpmath sde -snb -- python -m pytest tests/ -v --tb=short test_haswell: @@ -114,4 +115,5 @@ jobs: - name: Run tests on Haswell run: | + pip install pytest mpmath sde -hsw -- python -m pytest tests/ -v --tb=short From 4ba87d33fb55508ece36df1ee3db0e2948b0c7cf Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 21 Jan 2026 13:00:28 +0530 Subject: [PATCH 3/5] rename --- .github/workflows/test_old_cpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_old_cpu.yml b/.github/workflows/test_old_cpu.yml index abbc4f2..d61a098 100644 --- a/.github/workflows/test_old_cpu.yml +++ b/.github/workflows/test_old_cpu.yml @@ -13,7 +13,7 @@ on: jobs: test_sandy_bridge: - name: Test on Sandy Bridge (x86-64-v2, no AVX2) + name: Test on Sandy Bridge (x86-64-v2) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 @@ -66,7 +66,7 @@ jobs: sde -snb -- python -m pytest tests/ -v --tb=short test_haswell: - name: Test on Haswell (x86-64-v3, with AVX2) + name: Test on Haswell (x86-64-v3) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 From 9b9a26480347daee71f651b96a0940180215f946 Mon Sep 17 00:00:00 2001 From: SwayamInSync Date: Wed, 21 Jan 2026 15:34:44 +0000 Subject: [PATCH 4/5] trying strategy --- .github/workflows/test_old_cpu.yml | 78 ++++++------------------------ 1 file changed, 15 insertions(+), 63 deletions(-) diff --git a/.github/workflows/test_old_cpu.yml b/.github/workflows/test_old_cpu.yml index d61a098..fc8f381 100644 --- a/.github/workflows/test_old_cpu.yml +++ b/.github/workflows/test_old_cpu.yml @@ -1,7 +1,7 @@ -name: Test on Older CPUs (x86-64-v2) +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) +# It ensures compatibility with x86_64-v2 baseline CPUs (e.g., Sandy Bridge) # that don't have AVX2/FMA support. on: @@ -12,9 +12,14 @@ on: workflow_dispatch: jobs: - test_sandy_bridge: - name: Test on Sandy Bridge (x86-64-v2) + test_old_cpu: + name: Test on ${{ matrix.cpu[1] }} runs-on: ubuntu-24.04 + strategy: + matrix: + cpu: + - ['snb', 'Sandy Bridge (x86_64-v2)'] + - ['hsw', 'Haswell (x86_64-v3)'] steps: - uses: actions/checkout@v6 with: @@ -47,73 +52,20 @@ jobs: run: | pip install . --no-build-isolation -v - - name: Test import on Sandy Bridge (x86-64-v2) + - name: Test import on ${{ matrix.cpu[1] }} run: | - echo "Testing basic import on Sandy Bridge..." - sde -snb -- python -c " + echo "Testing basic import on ${{ matrix.cpu[1] }}..." + sde -${{ matrix.cpu[0] }} -- 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!') + print('SUCCESS: Works on ${{ matrix.cpu[1] }}!') " - - name: Run tests on Sandy Bridge + - name: Run tests on ${{ matrix.cpu[1] }} 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) - 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 + sde -${{ matrix.cpu[0] }} -- python -m pytest tests/ -v --tb=short From 239d11d1593110f9c430eb82a42260c0b78e290b Mon Sep 17 00:00:00 2001 From: SwayamInSync Date: Wed, 21 Jan 2026 15:39:06 +0000 Subject: [PATCH 5/5] use fail-fast --- .github/workflows/test_old_cpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_old_cpu.yml b/.github/workflows/test_old_cpu.yml index fc8f381..0282d8f 100644 --- a/.github/workflows/test_old_cpu.yml +++ b/.github/workflows/test_old_cpu.yml @@ -16,6 +16,7 @@ jobs: name: Test on ${{ matrix.cpu[1] }} runs-on: ubuntu-24.04 strategy: + fail-fast: false matrix: cpu: - ['snb', 'Sandy Bridge (x86_64-v2)']