Skip to content

add macos support #1

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

Open
wants to merge 7 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
5 changes: 5 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ jobs:
parameters:
name: Linux
vmImage: 'ubuntu-22.04'

- template: template.yml
parameters:
name: MacOS
vmImage: 'macOS-13'
46 changes: 34 additions & 12 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,49 @@ jobs:
vmImage: ${{ parameters.vmImage }}

steps:

- bash: |
sudo apt-get update && \
sudo apt-get -y install libopenblas-dev ninja-build
displayName: 'Install OpenBLAS library'
- ${{ if contains(parameters.vmImage, 'ubuntu') }}:
- bash: |
sudo apt-get update && \
sudo apt-get -y install libopenblas-dev ninja-build libopenmpi-dev
displayName: 'Install BLAS and MPI libraries'
# on macOs, openblas is alreadey installed
- ${{ if contains(parameters.vmImage, 'macOs') }}:
- bash: |
brew install ninja open-mpi openblas lapack
displayName: 'Install BLAS and MPI libraries'

- bash : |
git clone https://github.com/ggerganov/llama.cpp.git
displayName: 'Clone llama.cpp git repository'

- ${{ if contains(parameters.vmImage, 'ubuntu') }}:
- bash : |
cd llama.cpp && \
mkdir cmake-build && \
cd cmake-build && \
cmake -DCMAKE_BUILD_TYPE=Release -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -G Ninja .. && \
ninja
displayName: 'Build llama.cpp using ninja'

- ${{ if contains(parameters.vmImage, 'macOs') }}:
- bash : |
cd llama.cpp && \
mkdir cmake-build && \
cd cmake-build && \
cmake -DCMAKE_BUILD_TYPE=Release -DLLAMA_BLAS=OFF -G Ninja .. && \
ninja
displayName: 'Build llama.cpp using ninja'

- bash : |
cd llama.cpp && \
mkdir cmake-build && \
cd cmake-build && \
cmake -DCMAKE_BUILD_TYPE=Release -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -G Ninja .. && \
ninja
displayName: 'Build llama.cpp using ninja'
cd llama.cpp/cmake-build/bin && \
./test-sampling && \
./test-quantize-fns && \
./test-quantize-perf
displayName: 'Run basic tests'

- bash: |
cd llama.cpp && \
pip install -r requirements.txt
pip3 install -r requirements.txt
displayName: 'Install python requirements'

- bash : |
Expand Down