Skip to content

Commit

Permalink
Merge pull request #250 from ashvardanian/main-dev
Browse files Browse the repository at this point in the history
Fix: SVE L2 and Arm CI
  • Loading branch information
ashvardanian authored Feb 5, 2025
2 parents 6951b00 + d8c6f40 commit b3af244
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,29 @@ jobs:
CIBW_PLATFORM: linux
CIBW_ARCHS: x86_64

# These are maintained by Arm, not GitHub, so we need to include
# extra steps, like installing Docker and starting the service
build_wheels_linux_arm:
name: Build Python Wheels (Linux ARM)
runs-on: ubuntu-24.04-arm # These are maintained by Arm, not GitHub
runs-on: ubuntu-24.04-arm
strategy:
matrix:
python-version: ["37", "38", "39", "310", "311", "312", "313"]
needs: [test_python]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Docker CE from Official Repository
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo systemctl start docker
docker version
- name: Install Python
uses: actions/setup-python@v5
with:
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ jobs:
path: wheelhouse/*.whl
overwrite: true

# These are maintained by Arm, not GitHub, so we need to include
# extra steps, like installing Docker and starting the service
build_wheels_linux_arm:
name: Build Python Wheels (Linux ARM)
runs-on: ubuntu-24.04-arm # If you have access to Arm runners
runs-on: ubuntu-24.04-arm
needs: versioning
strategy:
matrix:
Expand All @@ -112,6 +114,17 @@ jobs:
- uses: actions/checkout@v4
with:
ref: "main"
- name: Install Docker CE from Official Repository
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo systemctl start docker
docker version
- name: Install Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -233,7 +246,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-windows
name: cibw-wheels-windows-${{ matrix.architecture }}
path: wheelhouse/*.whl
overwrite: true

Expand Down
2 changes: 1 addition & 1 deletion include/simsimd/spatial.h
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ SIMSIMD_PUBLIC void simsimd_l2sq_bf16_sve(simsimd_bf16_t const *a_enum, simsimd_
svfloat32_t a_minus_b_low_vec = svsub_f32_x(pg_low_vec, a_low_vec, b_low_vec);
svfloat32_t a_minus_b_high_vec = svsub_f32_x(pg_high_vec, a_high_vec, b_high_vec);
d2_low_vec = svmla_f32_x(pg_vec, d2_low_vec, a_minus_b_low_vec, a_minus_b_low_vec);
d2_high_vec = svmla_f32_x(pg_vec, d2_high_vec, a_minus_b_low_vec, a_minus_b_low_vec);
d2_high_vec = svmla_f32_x(pg_vec, d2_high_vec, a_minus_b_high_vec, a_minus_b_high_vec);
i += svcnth();
} while (i < n);
simsimd_f32_t d2 = svaddv_f32(svptrue_b32(), d2_low_vec) + svaddv_f32(svptrue_b32(), d2_high_vec);
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ musllinux-aarch64-image = "musllinux_1_2"

# On CentOS we have to use `yum`.
# The healthy version would be: `apt-get update && apt-get install -y libc6-dev wget python3-dev`.
before-all = ["yum update -y && yum install -y glibc-devel wget python3-devel"]
# We can't even use direct YUM variant: `yum update -y && yum install -y glibc-devel wget python3-devel`
# as downloading from `extras` fails on Arm instances!
before-all = ["yum update -y --disablerepo=extras && yum install -y --disablerepo=extras glibc-devel wget python3-devel"]

# With `musl` builds, we obviously don't need the `glibc` and can't use `yum`.
# This may also be handy for using custom dependencies for different Python versions:
Expand Down

0 comments on commit b3af244

Please sign in to comment.