automatically get thread count

This commit is contained in:
Eve 2023-09-23 03:37:52 +00:00 committed by GitHub
parent 25f4e523f1
commit 1e2fec1249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,9 +19,6 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GGML_NLOOP: 3
GGML_N_THREADS: 1
LINHOST_THR: 2
MACHOST_THR: 3
WINHOST_THR: 2
jobs:
ubuntu-focal-make:
@ -41,13 +38,13 @@ jobs:
- name: Build
id: make_build
run: |
CC=gcc-8 make -j ${LINHOST_THR}
CC=gcc-8 make -j $(nproc)
- name: Test
id: make_test
run: |
CC=gcc-8 make tests -j ${LINHOST_THR}
make test -j ${LINHOST_THR}
CC=gcc-8 make tests -j $(nproc)
make test -j $(nproc)
ubuntu-latest-cmake:
runs-on: ubuntu-latest
@ -69,7 +66,7 @@ jobs:
mkdir build
cd build
cmake ..
cmake --build . --config Release -j ${LINHOST_THR}
cmake --build . --config Release -j $(nproc)
- name: Test
id: cmake_test
@ -104,7 +101,7 @@ jobs:
mkdir build
cd build
cmake .. -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }} -j ${LINHOST_THR}
cmake --build . --config ${{ matrix.build_type }} -j $(nproc)
- name: Test
id: cmake_test
@ -138,7 +135,7 @@ jobs:
mkdir build
cd build
cmake -DLLAMA_MPI=ON ..
cmake --build . --config Release -j ${LINHOST_THR}
cmake --build . --config Release -j $(nproc)
- name: Test
id: cmake_test
@ -163,13 +160,13 @@ jobs:
- name: Build
id: make_build
run: |
make -j ${MACHOST_THR}
make -j $(sysctl -n hw.logicalcpu)
- name: Test
id: make_test
run: |
make tests -j ${MACHOST_THR}
make test -j ${MACHOST_THR}
make tests -j $(sysctl -n hw.logicalcpu)
make test -j $(sysctl -n hw.logicalcpu)
macOS-latest-cmake:
runs-on: macos-latest
@ -192,7 +189,7 @@ jobs:
mkdir build
cd build
cmake -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF ..
cmake --build . --config Release -j ${MACHOST_THR}
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
- name: Test
id: cmake_test
@ -226,7 +223,7 @@ jobs:
-DLLAMA_BUILD_SERVER=OFF \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
cmake --build . --config Release -j ${MACHOST_THR}
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
macOS-latest-cmake-tvos:
runs-on: macos-latest
@ -254,7 +251,7 @@ jobs:
-DLLAMA_BUILD_SERVER=OFF \
-DCMAKE_SYSTEM_NAME=tvOS \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
cmake --build . --config Release -j ${MACHOST_THR}
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
windows-latest-cmake:
runs-on: windows-latest
@ -327,7 +324,7 @@ jobs:
mkdir build
cd build
cmake .. ${{ matrix.defines }}
cmake --build . --config Release -j ${env:WINHOST_THR}
cmake --build . --config Release -j %NUMBER_OF_PROCESSORS%
- name: Add clblast.dll
id: add_clblast_dll
@ -418,7 +415,7 @@ jobs:
mkdir build
cd build
cmake .. -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=ON
cmake --build . --config Release -j ${env:WINHOST_THR}
cmake --build . --config Release -j %NUMBER_OF_PROCESSORS%
- name: Determine tag name
id: tag