1818 MODEL_FILE : qwen2-0_5b-instruct-q8_0.gguf
1919
2020jobs :
21- # Combined job for Linux, Windows, and macOS using a matrix strategy
21+ # Combined job for Linux, Windows, and macOS (non-Metal)
2222 build-and-test :
2323 runs-on : ${{ matrix.os }}
2424 strategy :
2525 # Don't cancel other jobs in the matrix if one fails
2626 fail-fast : false
2727 matrix :
28- os : [ubuntu-latest, windows-latest, macos-13 ]
28+ os : [ubuntu-latest, windows-latest, macos-14 ]
2929 python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
3030
3131 steps :
3838 uses : actions/setup-python@v5
3939 with :
4040 python-version : ${{ matrix.python-version }}
41- # Use setup-python's built-in pip caching
4241 cache : ' pip'
4342
4443 - name : Cache HuggingFace model
45- # Give this step an id to reference its output below
4644 id : model-cache
4745 uses : actions/cache@v4
4846 with :
@@ -58,27 +56,21 @@ jobs:
5856 shell : bash
5957
6058 - name : Install dependencies
59+ env :
60+ CMAKE_ARGS : ${{ runner.os == 'macOS' && '-DLLAMA_METAL=off' || '' }}
6161 run : |
6262 python -m pip install --upgrade pip
6363 python -m pip install uv
6464 python -m uv pip install -e .[all] --verbose
65- # FIX: Simplified shell to bash for all OSes
66- shell : bash
67-
68- - name : Install dependencies (macOS non-Metal)
69- # Apply special compilation flags for the non-Metal macOS build
70- if : runner.os == 'macOS'
71- run : CMAKE_ARGS="-DLLAMA_METAL=off" python3 -m uv pip install .[all] --verbose
7265 shell : bash
7366
7467 - name : Test with pytest
7568 run : python -m pytest
76- # FIX: Simplified shell to bash for all OSes
7769 shell : bash
7870
7971 # Dedicated job for macOS with Metal support
8072 build-macos-metal :
81- runs-on : macos-13
73+ runs-on : macos-14
8274 steps :
8375 - name : Checkout repository
8476 uses : actions/checkout@v4
@@ -95,18 +87,18 @@ jobs:
9587 run : |
9688 uname -a
9789 sysctl -n machdep.cpu.brand_string
98- python3 -c "import platform; print(platform.machine(), platform.architecture())"
90+ python -c "import platform; print(platform.machine(), platform.architecture())"
9991 shell : bash
10092
10193 - name : Cache HuggingFace model
10294 id : model-cache
10395 uses : actions/cache@v4
10496 with :
10597 path : ~/.cache/huggingface/hub
106- # Use a distinct key to avoid cache conflicts
10798 key : ${{ runner.os }}-metal-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
10899
109100 - name : Download model if not cached
101+ # Only run this step if the cache was not found
110102 if : steps.model-cache.outputs.cache-hit != 'true'
111103 run : |
112104 pip install huggingface-hub
@@ -115,10 +107,11 @@ jobs:
115107
116108 - name : Install dependencies (macOS Metal)
117109 run : |
118- python3 -m pip install --upgrade pip
119- CMAKE_ARGS="-DLLAMA_METAL=on" python3 -m pip install .[all] --verbose
110+ python -m pip install --upgrade pip
111+ python -m pip install uv
112+ CMAKE_ARGS="-DLLAMA_METAL=on -DGGML_METAL_USE_BF16=on -DGGML_METAL_EMBED_LIBRARY=on" python -m uv pip install -e .[all] --verbose
120113 shell : bash
121114
122115 - name : Test with pytest
123- run : python3 -m pytest
116+ run : python -m pytest
124117 shell : bash
0 commit comments