mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-03-14 16:26:54 +00:00
ci : more platforms coverage (#1101)
* add multi platform * add image name * fix * fix /bin/sh path * add missing \ * add all platforms for check * remove platforms * remove s390x * - add arm v6 - format run cmd * remove arm v6 * - bump checkout to v3 - use setup emsdk action - add arch to all ubuntu jobs * mymindstorm/setup-emsdk to v12 * add missing QEMU step * add fail-fast: false for debug * add freebsd * remark all jobs except freebsd for test * add sudo * enable all tests again * format * check __AVX__ support before include immintrin.h * try auto detect flag by cmake * fix check for immintrin.h * fix include check for immintrin.h * Remove all platforms for sanitizer build except amd64 We have no clue why they failed. --------- Co-authored-by: Alon Faraj <alon.faraj@mapcore.com>
This commit is contained in:
parent
4774d2feb0
commit
3998465721
156
.github/workflows/build.yml
vendored
156
.github/workflows/build.yml
vendored
@ -1,31 +1,41 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
env:
|
||||||
|
ubuntu_image: "ubuntu:22.04"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu-latest:
|
ubuntu-latest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v2
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install build-essential
|
|
||||||
sudo apt-get install libsdl2-dev
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build ${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
|
docker run --platform ${{ matrix.arch }} --rm \
|
||||||
|
-v ${{ github.workspace }}:/workspace \
|
||||||
|
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
|
||||||
|
apt update
|
||||||
|
apt install -y build-essential libsdl2-dev
|
||||||
make
|
make
|
||||||
make stream
|
make stream'
|
||||||
|
|
||||||
macOS-latest:
|
macOS-latest:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
run: |
|
run: |
|
||||||
@ -37,82 +47,104 @@ jobs:
|
|||||||
make
|
make
|
||||||
make stream
|
make stream
|
||||||
|
|
||||||
|
freeBSD-latest:
|
||||||
|
runs-on: macos-12
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: cross-platform-actions/action@v0.15.0
|
||||||
|
with:
|
||||||
|
operating_system: freebsd
|
||||||
|
version: '13.2'
|
||||||
|
run: |
|
||||||
|
sudo pkg update
|
||||||
|
sudo pkg install -y gmake sdl2
|
||||||
|
gmake
|
||||||
|
gmake stream
|
||||||
|
|
||||||
ubuntu-latest-gcc:
|
ubuntu-latest-gcc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build: [Debug, Release]
|
build: [Debug, Release]
|
||||||
|
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v2
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install build-essential
|
- name: Build ${{ matrix.arch }}
|
||||||
sudo apt-get install cmake
|
|
||||||
sudo apt-get install libsdl2-dev
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
run: cmake . -DWHISPER_SUPPORT_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
run: |
|
||||||
|
docker run --platform ${{ matrix.arch }} --rm \
|
||||||
|
-v ${{ github.workspace }}:/workspace \
|
||||||
|
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
|
||||||
|
apt update
|
||||||
|
apt install -y build-essential cmake libsdl2-dev
|
||||||
|
cmake . -DWHISPER_SUPPORT_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }}
|
||||||
make
|
make
|
||||||
ctest -L gh --output-on-failure
|
ctest -L gh --output-on-failure'
|
||||||
|
|
||||||
ubuntu-latest-clang:
|
ubuntu-latest-clang:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build: [Debug, Release]
|
build: [Debug, Release]
|
||||||
|
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v2
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install build-essential
|
- name: Build ${{ matrix.arch }}
|
||||||
sudo apt-get install cmake
|
|
||||||
sudo apt-get install libsdl2-dev
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
run: cmake . -DWHISPER_SUPPORT_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
run: |
|
||||||
|
docker run --platform ${{ matrix.arch }} --rm \
|
||||||
|
-v ${{ github.workspace }}:/workspace \
|
||||||
|
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
|
||||||
|
apt update
|
||||||
|
apt install -y build-essential cmake libsdl2-dev
|
||||||
|
cmake . -DWHISPER_SUPPORT_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
|
||||||
make
|
make
|
||||||
ctest -L gh --output-on-failure
|
ctest -L gh --output-on-failure'
|
||||||
|
|
||||||
ubuntu-latest-gcc-sanitized:
|
ubuntu-latest-gcc-sanitized:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
sanitizer: [ADDRESS, THREAD, UNDEFINED]
|
sanitizer: [ADDRESS, THREAD, UNDEFINED]
|
||||||
|
arch: [linux/amd64]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v2
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install build-essential
|
- name: Build ${{ matrix.arch }}
|
||||||
sudo apt-get install cmake
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
run: cmake . -DCMAKE_BUILD_TYPE=Debug -DWHISPER_SANITIZE_${{ matrix.sanitizer }}=ON
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
run: |
|
||||||
|
docker run --platform ${{ matrix.arch }} --rm \
|
||||||
|
-v ${{ github.workspace }}:/workspace \
|
||||||
|
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
|
||||||
|
apt update
|
||||||
|
apt install -y build-essential cmake
|
||||||
|
cmake . -DCMAKE_BUILD_TYPE=Debug -DWHISPER_SANITIZE_${{ matrix.sanitizer }}=ON
|
||||||
make
|
make
|
||||||
ctest -L gh --output-on-failure
|
ctest -L gh --output-on-failure'
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@ -134,7 +166,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v1
|
||||||
@ -195,7 +227,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v1
|
||||||
@ -261,7 +293,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v1
|
||||||
@ -308,24 +340,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dependencies
|
- name: Setup emsdk
|
||||||
run: |
|
uses: mymindstorm/setup-emsdk@v12
|
||||||
wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
|
|
||||||
tar -xvf master.tar.gz
|
|
||||||
emsdk-master/emsdk update
|
|
||||||
emsdk-master/emsdk install latest
|
|
||||||
emsdk-master/emsdk activate latest
|
|
||||||
|
|
||||||
- name: Configure
|
- name: Verify
|
||||||
run: echo "tmp"
|
run: emcc -v
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
pushd emsdk-master
|
|
||||||
source ./emsdk_env.sh
|
|
||||||
popd
|
|
||||||
emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
|
emcmake cmake . -DCMAKE_BUILD_TYPE=${{ matrix.build }}
|
||||||
make
|
make
|
||||||
|
|
||||||
@ -338,7 +362,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
@ -356,7 +380,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Java
|
- name: Install Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
@ -376,7 +400,7 @@ jobs:
|
|||||||
needs: [ 'windows' ]
|
needs: [ 'windows' ]
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Java
|
- name: Install Java
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
|
@ -256,16 +256,16 @@ else()
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||||
else()
|
else()
|
||||||
if(NOT WHISPER_NO_AVX)
|
if(__AVX__)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
|
||||||
endif()
|
endif()
|
||||||
if(NOT WHISPER_NO_AVX2)
|
if(__AVX2__)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
|
||||||
endif()
|
endif()
|
||||||
if(NOT WHISPER_NO_FMA)
|
if(__FMA__)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma")
|
||||||
endif()
|
endif()
|
||||||
if(NOT WHISPER_NO_F16C)
|
if(__F16C__)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
2
ggml.c
2
ggml.c
@ -292,7 +292,7 @@ typedef double ggml_float;
|
|||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#else
|
#else
|
||||||
#if !defined(__riscv)
|
#if defined(__AVX__) || defined(__AVX2__) || defined(__AVX512F__) || defined(__SSSE3__)
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user