Skip to content
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

feat: Adding Windows ARM64 packages #16

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-latest,macos-latest,ubuntu-latest] #, windows-latest, macos-latest, macos-14, ubuntu-latest,
python: [38,39,310,311,312]
os: [windows-latest] #,macos-latest,ubuntu-latest] #, windows-latest, macos-latest, macos-14, ubuntu-latest,
python: [39] # 38,310,311,312
steps:
- name: Dependencies
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -50,6 +50,12 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
echo "SHARED_LIB_PATH=../../build/Release" >> $GITHUB_ENV
- name: Setup MSBuild
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
with:
vs-version: 'latest' # Or specify a specific version like '17.0'
msbuild-architecture: 'arm64' # Crucial to target ARM64 tools
- name: Build wheels
run: |
make python-cidist
Expand All @@ -58,7 +64,7 @@ jobs:
CIBW_BUILD: "cp${{matrix.python}}-*"
CIBW_SKIP: "pp* *musllinux*"
CIBW_ARCHS_MACOS: "arm64 x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_WINDOWS: "ARM64"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_BEFORE_BUILD: "make lib"
CIBW_TEST_REQUIRES: "pytest>=6.0.0 huggingface_hub"
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,20 @@ ifeq ($(findstring x86_64,$(ARCH)),x86_64)
IS_X86 = true
endif

CMAKE_ARCH_FLAG = ""
# Add architecture flag based on the target platform
ifeq ($(findstring arm64,$(SETUPTOOLS_EXT_SUFFIX)),arm64)
CMAKE_ARCH_FLAG = "-A ARM64"
else
CMAKE_ARCH_FLAG = "-A x64"
endif

lib:
@echo "Building for $(CMAKE_ARCH_FLAG)"
rm -rf build && mkdir build
@if [ "$(IS_X86)" = "true" ]; then \
arch -x86_64 /bin/bash -c "cd build && cmake ${CMAKE_FLAGS} -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=OFF .. && cmake --build . --config Release"; \
arch -x86_64 /bin/bash -c "cd build && cmake ${CMAKE_FLAGS} ${CMAKE_ARCH_FLAG} -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=OFF .. && cmake --build . --config Release"; \
else \
cd build && cmake ${CMAKE_FLAGS} -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=OFF .. && cmake --build . --config Release; \
cd build && cmake ${CMAKE_FLAGS} ${CMAKE_ARCH_FLAG} -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DBUILD_SHARED_LIBS=OFF .. && cmake --build . --config Release; \
fi
#-j $(sysctl -n hw.logicalcpu)
Loading