Skip to content

Commit b46898d

Browse files
netrunnereveyusiwen
authored andcommitted
ci : multithreaded builds (ggml-org#3311)
* mac and linux threads * windows * Update build.yml * Update build.yml * Update build.yml * automatically get thread count * windows syntax * try to fix freebsd * Update build.yml * Update build.yml * Update build.yml
1 parent a2ad9b5 commit b46898d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
- name: Build
3939
id: make_build
4040
run: |
41-
CC=gcc-8 make
41+
CC=gcc-8 make -j $(nproc)
4242
4343
- name: Test
4444
id: make_test
4545
run: |
46-
CC=gcc-8 make tests
47-
make test
46+
CC=gcc-8 make tests -j $(nproc)
47+
make test -j $(nproc)
4848
4949
ubuntu-latest-cmake:
5050
runs-on: ubuntu-latest
@@ -66,7 +66,7 @@ jobs:
6666
mkdir build
6767
cd build
6868
cmake ..
69-
cmake --build . --config Release
69+
cmake --build . --config Release -j $(nproc)
7070
7171
- name: Test
7272
id: cmake_test
@@ -101,7 +101,7 @@ jobs:
101101
mkdir build
102102
cd build
103103
cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
104-
cmake --build . --config ${{ matrix.build_type }}
104+
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
105105
106106
- name: Test
107107
id: cmake_test
@@ -135,7 +135,7 @@ jobs:
135135
mkdir build
136136
cd build
137137
cmake -DLLAMA_MPI=ON ..
138-
cmake --build . --config Release
138+
cmake --build . --config Release -j $(nproc)
139139
140140
- name: Test
141141
id: cmake_test
@@ -160,13 +160,13 @@ jobs:
160160
- name: Build
161161
id: make_build
162162
run: |
163-
make
163+
make -j $(sysctl -n hw.logicalcpu)
164164
165165
- name: Test
166166
id: make_test
167167
run: |
168-
make tests
169-
make test
168+
make tests -j $(sysctl -n hw.logicalcpu)
169+
make test -j $(sysctl -n hw.logicalcpu)
170170
171171
macOS-latest-cmake:
172172
runs-on: macos-latest
@@ -189,7 +189,7 @@ jobs:
189189
mkdir build
190190
cd build
191191
cmake -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF ..
192-
cmake --build . --config Release
192+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
193193
194194
- name: Test
195195
id: cmake_test
@@ -223,7 +223,7 @@ jobs:
223223
-DLLAMA_BUILD_SERVER=OFF \
224224
-DCMAKE_SYSTEM_NAME=iOS \
225225
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
226-
cmake --build . --config Release
226+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
227227
228228
macOS-latest-cmake-tvos:
229229
runs-on: macos-latest
@@ -251,7 +251,7 @@ jobs:
251251
-DLLAMA_BUILD_SERVER=OFF \
252252
-DCMAKE_SYSTEM_NAME=tvOS \
253253
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
254-
cmake --build . --config Release
254+
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
255255
256256
windows-latest-cmake:
257257
runs-on: windows-latest
@@ -324,7 +324,7 @@ jobs:
324324
mkdir build
325325
cd build
326326
cmake .. ${{ matrix.defines }}
327-
cmake --build . --config Release
327+
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
328328
329329
- name: Add clblast.dll
330330
id: add_clblast_dll
@@ -415,7 +415,7 @@ jobs:
415415
mkdir build
416416
cd build
417417
cmake .. -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
418-
cmake --build . --config Release
418+
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
419419
420420
- name: Determine tag name
421421
id: tag
@@ -472,7 +472,7 @@ jobs:
472472
# run: |
473473
# sudo pkg update
474474
# sudo pkg install -y gmake automake autoconf pkgconf llvm15 clinfo clover opencl clblast openblas
475-
# gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15
475+
# gmake CC=/usr/local/bin/clang15 CXX=/usr/local/bin/clang++15 -j `sysctl -n hw.ncpu`
476476

477477
release:
478478
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

0 commit comments

Comments
 (0)