mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2026-02-05 13:53:23 +02:00
ci : add sanitizer runs for server (#19291)
This commit is contained in:
16
.github/workflows/server.yml
vendored
16
.github/workflows/server.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
sanitizer: [ADDRESS, UNDEFINED] # THREAD is broken
|
sanitizer: [ADDRESS, UNDEFINED] # THREAD is very slow
|
||||||
build_type: [RelWithDebInfo]
|
build_type: [RelWithDebInfo]
|
||||||
include:
|
include:
|
||||||
- build_type: Release
|
- build_type: Release
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- build_type: Release
|
- build_type: Release
|
||||||
sanitizer: ""
|
sanitizer: ""
|
||||||
extra_args: "LLAMA_ARG_BACKEND_SAMPLING=1"
|
extra_args: "LLAMA_ARG_BACKEND_SAMPLING=1"
|
||||||
fail-fast: false # While -DLLAMA_SANITIZE_THREAD=ON is broken
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -72,7 +72,15 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
id: cmake_build
|
id: cmake_build
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -DLLAMA_BUILD_BORINGSSL=ON -DGGML_SCHED_NO_REALLOC=ON
|
cmake -B build \
|
||||||
|
-DLLAMA_BUILD_BORINGSSL=ON \
|
||||||
|
-DGGML_SCHED_NO_REALLOC=ON \
|
||||||
|
-DGGML_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
|
||||||
|
-DGGML_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
|
||||||
|
-DGGML_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }} \
|
||||||
|
-DLLAMA_SANITIZE_ADDRESS=${{ matrix.sanitizer == 'ADDRESS' }} \
|
||||||
|
-DLLAMA_SANITIZE_THREAD=${{ matrix.sanitizer == 'THREAD' }} \
|
||||||
|
-DLLAMA_SANITIZE_UNDEFINED=${{ matrix.sanitizer == 'UNDEFINED' }}
|
||||||
cmake --build build --config ${{ matrix.build_type }} -j ${env:NUMBER_OF_PROCESSORS} --target llama-server
|
cmake --build build --config ${{ matrix.build_type }} -j ${env:NUMBER_OF_PROCESSORS} --target llama-server
|
||||||
|
|
||||||
- name: Python setup
|
- name: Python setup
|
||||||
@@ -88,7 +96,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
id: server_integration_tests
|
id: server_integration_tests
|
||||||
if: ${{ (!matrix.disabled_on_pr || !github.event.pull_request) && matrix.build_type == 'Release' }}
|
if: ${{ (!matrix.disabled_on_pr || !github.event.pull_request) }}
|
||||||
run: |
|
run: |
|
||||||
cd tools/server/tests
|
cd tools/server/tests
|
||||||
export ${{ matrix.extra_args }}
|
export ${{ matrix.extra_args }}
|
||||||
|
|||||||
@@ -164,29 +164,6 @@ llama_option_depr(WARNING LLAMA_SYCL GGML_SYCL)
|
|||||||
llama_option_depr(WARNING LLAMA_SYCL_F16 GGML_SYCL_F16)
|
llama_option_depr(WARNING LLAMA_SYCL_F16 GGML_SYCL_F16)
|
||||||
llama_option_depr(WARNING LLAMA_CANN GGML_CANN)
|
llama_option_depr(WARNING LLAMA_CANN GGML_CANN)
|
||||||
|
|
||||||
if (NOT MSVC)
|
|
||||||
if (LLAMA_SANITIZE_THREAD)
|
|
||||||
message(STATUS "Using -fsanitize=thread")
|
|
||||||
|
|
||||||
add_compile_options(-fsanitize=thread)
|
|
||||||
link_libraries (-fsanitize=thread)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (LLAMA_SANITIZE_ADDRESS)
|
|
||||||
message(STATUS "Using -fsanitize=address")
|
|
||||||
|
|
||||||
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
|
||||||
link_libraries (-fsanitize=address)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (LLAMA_SANITIZE_UNDEFINED)
|
|
||||||
message(STATUS "Using -fsanitize=undefined")
|
|
||||||
|
|
||||||
add_compile_options(-fsanitize=undefined)
|
|
||||||
link_libraries (-fsanitize=undefined)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include("cmake/license.cmake")
|
include("cmake/license.cmake")
|
||||||
license_add_file("llama.cpp" "LICENSE")
|
license_add_file("llama.cpp" "LICENSE")
|
||||||
|
|
||||||
|
|||||||
@@ -32,4 +32,27 @@ function(llama_add_compile_flags)
|
|||||||
set(CXX_FLAGS "" PARENT_SCOPE)
|
set(CXX_FLAGS "" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT MSVC)
|
||||||
|
if (LLAMA_SANITIZE_THREAD)
|
||||||
|
message(STATUS "Using -fsanitize=thread")
|
||||||
|
|
||||||
|
add_compile_options(-fsanitize=thread)
|
||||||
|
link_libraries (-fsanitize=thread)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (LLAMA_SANITIZE_ADDRESS)
|
||||||
|
message(STATUS "Using -fsanitize=address")
|
||||||
|
|
||||||
|
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
||||||
|
link_libraries (-fsanitize=address)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (LLAMA_SANITIZE_UNDEFINED)
|
||||||
|
message(STATUS "Using -fsanitize=undefined")
|
||||||
|
|
||||||
|
add_compile_options(-fsanitize=undefined)
|
||||||
|
link_libraries (-fsanitize=undefined)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
Reference in New Issue
Block a user