18
18
MODEL_FILE : qwen2-0_5b-instruct-q8_0.gguf
19
19
20
20
jobs :
21
- # Combined job for Linux, Windows, and macOS using a matrix strategy
21
+ # Combined job for Linux, Windows, and macOS (non-Metal)
22
22
build-and-test :
23
23
runs-on : ${{ matrix.os }}
24
24
strategy :
25
25
# Don't cancel other jobs in the matrix if one fails
26
26
fail-fast : false
27
27
matrix :
28
- os : [ubuntu-latest, windows-latest, macos-13 ]
28
+ os : [ubuntu-latest, windows-latest, macos-14 ]
29
29
python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
30
30
31
31
steps :
38
38
uses : actions/setup-python@v5
39
39
with :
40
40
python-version : ${{ matrix.python-version }}
41
- # Use setup-python's built-in pip caching
42
41
cache : ' pip'
43
42
44
43
- name : Cache HuggingFace model
45
- # Give this step an id to reference its output below
46
44
id : model-cache
47
45
uses : actions/cache@v4
48
46
with :
@@ -58,27 +56,21 @@ jobs:
58
56
shell : bash
59
57
60
58
- name : Install dependencies
59
+ env :
60
+ CMAKE_ARGS : ${{ runner.os == 'macOS' && '-DLLAMA_METAL=off' || '' }}
61
61
run : |
62
62
python -m pip install --upgrade pip
63
63
python -m pip install uv
64
64
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
72
65
shell : bash
73
66
74
67
- name : Test with pytest
75
68
run : python -m pytest
76
- # FIX: Simplified shell to bash for all OSes
77
69
shell : bash
78
70
79
71
# Dedicated job for macOS with Metal support
80
72
build-macos-metal :
81
- runs-on : macos-13
73
+ runs-on : macos-14
82
74
steps :
83
75
- name : Checkout repository
84
76
uses : actions/checkout@v4
@@ -95,18 +87,18 @@ jobs:
95
87
run : |
96
88
uname -a
97
89
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())"
99
91
shell : bash
100
92
101
93
- name : Cache HuggingFace model
102
94
id : model-cache
103
95
uses : actions/cache@v4
104
96
with :
105
97
path : ~/.cache/huggingface/hub
106
- # Use a distinct key to avoid cache conflicts
107
98
key : ${{ runner.os }}-metal-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
108
99
109
100
- name : Download model if not cached
101
+ # Only run this step if the cache was not found
110
102
if : steps.model-cache.outputs.cache-hit != 'true'
111
103
run : |
112
104
pip install huggingface-hub
@@ -115,10 +107,11 @@ jobs:
115
107
116
108
- name : Install dependencies (macOS Metal)
117
109
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
120
113
shell : bash
121
114
122
115
- name : Test with pytest
123
- run : python3 -m pytest
116
+ run : python -m pytest
124
117
shell : bash
0 commit comments