@@ -81,30 +81,32 @@ jobs:
81
81
export DEBIAN_FRONTEND=noninteractive
82
82
export NEEDRESTART_MODE=a
83
83
sudo apt-get update
84
- sudo apt-get upgrade -y
85
- pip install --upgrade cmake
86
84
sudo apt-get install -y libblas-dev liblapack-dev liblapacke-dev
87
85
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev
86
+ curl -LsSf https://astral.sh/uv/install.sh | sh
88
87
- run :
89
88
name : Install Python package
90
89
command : |
91
- pip install -e ".[dev]"
90
+ uv venv
91
+ uv pip install cmake
92
+ uv pip install -e ".[dev]" -v
92
93
- run :
93
94
name : Generate package stubs
94
95
command : |
95
- echo "stubs"
96
- pip install typing_extensions
97
- python setup.py generate_stubs
96
+ uv pip install typing_extensions
97
+ uv run --no-project setup.py generate_stubs
98
98
- run :
99
99
name : Run Python tests
100
100
command : |
101
+ source .venv/bin/activate
101
102
python -m unittest discover python/tests -v
102
103
mpirun --bind-to none -host localhost:8 -np 8 python python/tests/mpi_test_distributed.py
103
104
mlx.launch --verbose -n 8 python/tests/ring_test_distributed.py -v 2> >(tee -a stderr.log >&2)
104
105
if $(grep "\[WARN\]" stderr.log); then echo "Distributed ring test failed"; exit 1; fi
105
106
- run :
106
107
name : Build CPP only
107
108
command : |
109
+ source .venv/bin/activate
108
110
mkdir -p build && cd build
109
111
cmake .. -DMLX_BUILD_METAL=OFF -DCMAKE_BUILD_TYPE=DEBUG
110
112
make -j `nproc`
@@ -130,33 +132,30 @@ jobs:
130
132
- run :
131
133
name : Install dependencies
132
134
command : |
133
-
134
- brew install openmpi
135
- python3.9 -m venv env
136
- source env/bin/activate
137
- pip install --upgrade pip
138
- pip install --upgrade cmake
139
- pip install nanobind==2.4.0
140
- pip install numpy
141
- pip install torch
142
- pip install tensorflow
143
- pip install unittest-xml-reporting
135
+ HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 \
136
+ brew install openmpi uv
144
137
- run :
145
138
name : Install Python package
146
139
command : |
147
- source env/bin/activate
140
+ uv venv --python 3.9
141
+ uv pip install \
142
+ nanobind==2.4.0 \
143
+ cmake \
144
+ numpy \
145
+ torch \
146
+ tensorflow \
147
+ unittest-xml-reporting
148
148
DEBUG=1 CMAKE_ARGS="-DCMAKE_COMPILE_WARNING_AS_ERROR=ON" \
149
- pip install -e . -v
149
+ uv pip install -e . -v
150
150
- run :
151
151
name : Generate package stubs
152
152
command : |
153
- source env/bin/activate
154
- pip install typing_extensions
155
- python setup.py generate_stubs
153
+ uv pip install typing_extensions
154
+ uv run --no-project setup.py generate_stubs
156
155
- run :
157
156
name : Run Python tests
158
157
command : |
159
- source env /bin/activate
158
+ source .venv /bin/activate
160
159
LOW_MEMORY=1 DEVICE=cpu python -m xmlrunner discover -v python/tests -o test-results/cpu
161
160
LOW_MEMORY=1 DEVICE=gpu METAL_DEVICE_WRAPPER_TYPE=1 METAL_DEBUG_ERROR_MODE=0 python -m xmlrunner discover -v python/tests -o test-results/gpu
162
161
mpirun --bind-to none -host localhost:8 -np 8 -x DYLD_LIBRARY_PATH=/opt/homebrew/lib/ python python/tests/mpi_test_distributed.py
@@ -165,16 +164,15 @@ jobs:
165
164
- run :
166
165
name : Build example extension
167
166
command : |
168
- source env/bin/activate
169
167
cd examples/extensions
170
- pip install -r requirements.txt
171
- python setup.py build_ext -j8
168
+ uv pip install -r requirements.txt
169
+ uv run --no-project setup.py build_ext -j8
172
170
- store_test_results :
173
171
path : test-results
174
172
- run :
175
173
name : Build CPP only
176
174
command : |
177
- source env /bin/activate
175
+ source .venv /bin/activate
178
176
mkdir -p build && cd build && cmake .. && make -j `sysctl -n hw.ncpu`
179
177
- run :
180
178
name : Run CPP tests
@@ -183,7 +181,7 @@ jobs:
183
181
- run :
184
182
name : Build small binary
185
183
command : |
186
- source env /bin/activate
184
+ source .venv /bin/activate
187
185
cd build/
188
186
cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel \
189
187
-DBUILD_SHARED_LIBS=ON \
@@ -195,12 +193,13 @@ jobs:
195
193
- run :
196
194
name : Run Python tests with JIT
197
195
command : |
198
- source env/bin/activate
199
196
CMAKE_ARGS="-DMLX_METAL_JIT=ON" \
200
- pip install -e . -v
197
+ uv pip install -e .
201
198
LOW_MEMORY=1 DEVICE=gpu METAL_DEVICE_WRAPPER_TYPE=1 \
202
199
METAL_DEBUG_ERROR_MODE=0 \
203
- python -m xmlrunner discover -v python/tests -o test-results/gpu_jit
200
+ uv run --no-project python -m xmlrunner discover \
201
+ -v python/tests \
202
+ -o test-results/gpu_jit
204
203
205
204
cuda_build_and_test :
206
205
parameters :
@@ -212,22 +211,42 @@ jobs:
212
211
resource_class : gpu.nvidia.small.gen2
213
212
steps :
214
213
- checkout
214
+ - restore_cache :
215
+ keys :
216
+ - cuda-<< parameters.image_date >>-{{ arch }}-
215
217
- run :
216
- name : Install Python package
218
+ name : Install dependencies
217
219
command : |
218
220
sudo apt-get update
219
221
sudo apt-get install libcudnn9-dev-cuda-12
220
222
sudo apt-get install libblas-dev liblapack-dev liblapacke-dev
221
- python3 -m venv env
222
- source env/bin/activate
223
+ curl -sL https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3-linux-x86_64.tar.xz | tar xJf -
224
+ sudo mv ccache-4.11.3-linux-x86_64/ccache /usr/bin/ccache
225
+ rm -rf ccache-4.11.3-linux-x86_64
226
+ curl -LsSf https://astral.sh/uv/install.sh | sh
227
+ - run :
228
+ name : Install Python package
229
+ command : |
230
+ uv venv
223
231
CMAKE_ARGS="-DMLX_BUILD_CUDA=ON -DCMAKE_CUDA_COMPILER=`which nvcc`" \
224
- pip install -e ".[dev]"
232
+ uv pip install -e ".[dev]" -v
225
233
- run :
226
234
name : Run Python tests
227
235
command : |
228
- source env /bin/activate
236
+ source .venv /bin/activate
229
237
LOW_MEMORY=1 DEVICE=cpu python -m unittest discover python/tests -v
230
238
LOW_MEMORY=1 DEVICE=gpu python -m tests discover python/tests -v
239
+ - run :
240
+ name : CCache report
241
+ command : |
242
+ ccache --show-stats
243
+ ccache --zero-stats
244
+ ccache --max-size 400MB
245
+ ccache --cleanup
246
+ - save_cache :
247
+ key : cuda-<< parameters.image_date >>-{{ arch }}-{{ epoch }}
248
+ paths :
249
+ - /home/circleci/.cache/ccache
231
250
232
251
build_release :
233
252
parameters :
@@ -323,14 +342,10 @@ jobs:
323
342
export DEBIAN_FRONTEND=noninteractive
324
343
export NEEDRESTART_MODE=a
325
344
sudo apt-get update
326
- sudo apt-get upgrade -y
327
345
TZ=Etc/UTC sudo apt-get -y install tzdata
328
- sudo apt-get install -y apt-utils
329
- sudo apt-get install -y software-properties-common
330
346
sudo add-apt-repository -y ppa:deadsnakes/ppa
331
347
sudo apt-get install -y $PYTHON $PYTHON-dev $PYTHON-full
332
348
sudo apt-get install -y libblas-dev liblapack-dev liblapacke-dev
333
- sudo apt-get install -y build-essential git
334
349
$PYTHON -m venv env
335
350
source env/bin/activate
336
351
pip install --upgrade pip
@@ -555,6 +570,9 @@ workflows:
555
570
requires : [ hold ]
556
571
- cuda_build_and_test :
557
572
requires : [ hold ]
573
+ matrix :
574
+ parameters :
575
+ image_date : ["2023.11.1", "2025.05.1"]
558
576
nightly_build :
559
577
when :
560
578
and :
0 commit comments