Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,46 @@ jobs:
echo "Running test_ops_matmul_elem with VT_CPU_MATMUL_TIER=${tier}"
VT_CPU_MATMUL_TIER="${tier}" build/tests/test_ops_matmul_elem
done
build-newest-gcc:
# COMPILE-ONLY coverage on a compiler NEWER than any other lane's. Every
# other Linux lane installs the distro `g++`, which on ubuntu-latest is
# gcc 13, so a header that only compiles because of a TRANSITIVE include
# goes green here and red on a current distro. That is not hypothetical:
# ::getpid without <unistd.h> was fixed once and came back in five more
# files, one of them src/vllm/entrypoints/openai/server_main.cpp — a
# SHIPPED binary that does not build on gcc 16 (reported on issue #41).
#
# Deliberately does NOT run ctest: this lane exists to catch compile-time
# portability, and build-test-cpu already owns execution. Keeping it to a
# build is roughly one extra compile per PR.
concurrency:
group: ci-build-newest-gcc-${{ github.event_name }}-${{ github.ref }}-${{ github.repository }}
cancel-in-progress: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
if: github.event.action != 'closed'
runs-on: ubuntu-latest
timeout-minutes: 90
container: gcc:16
steps:
- name: Install build tools
# The gcc image ships the toolchain only; git is needed BEFORE checkout
# so actions/checkout uses git rather than the slower tarball path.
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates cmake git ninja-build python3
rm -rf /var/lib/apt/lists/*
- uses: actions/checkout@v4
- name: Report the compiler this lane is actually pinning
run: g++ --version
- name: Configure
run: |
cmake -S . -B build-newest-gcc -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DVLLM_CPP_BUILD_TESTS=ON
- name: Build
# Same bounded parallelism as build-test-cpu: a bare -j OOM-kills the
# runner during the parallel link of the test executables.
run: cmake --build build-newest-gcc -j 2
build-test-cpu-arm64:
# Independent Arm execution evidence: the x86 lane cannot prove HWCAP
# dispatch, Arm instructions, or the host ABI. The native runner exercises
Expand Down
27 changes: 26 additions & 1 deletion cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,37 @@ function(vllm_cpp_set_warnings target)
if(NOT VLLM_CPP_SANITIZE STREQUAL "OFF")
set(_vllm_cpp_werror "")
endif()

# GCC >= 16 reports -Warray-bounds inside LIBSTDC++ and the vendored nlohmann
# json for code that is correct, so the diagnostic stays VISIBLE but stops
# being fatal on those compilers only. Everything <= 15 is unchanged and still
# fails the build on a real out-of-bounds.
#
# It is the same false-positive class this file already documents above for
# the sanitizer lanes, and it is not something the calling code can avoid:
# `_Sp_counted_base::_M_release()` is identical machine code for every
# shared_ptr type, so after inlining GCC attributes ONE instantiation's
# destructor to ANOTHER instantiation's allocation size. On gcc 16.1.1 that
# presents as "array subscript 'std::mutex[0]' is partly outside array bounds
# of 'unsigned char [32]'" pointing at a json.dump() call, in a translation
# unit that contains no shared_ptr<std::mutex> at all.
#
# libstdc++ carries its own `#pragma GCC diagnostic` suppressions around that
# very destructor (bits/shared_ptr_base.h), i.e. the standard library treats
# this as a warning to silence rather than a bug to fix in user code. Upstream
# is GCC PR tree-optimization/122197; Eigen, assimp and CMSSW all disable the
# check the same way on the affected releases.
set(_vllm_cpp_array_bounds "")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
set(_vllm_cpp_array_bounds -Wno-error=array-bounds)
endif()
if(MSVC)
target_compile_options(${target} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:/W4 /WX>)
else()
target_compile_options(${target} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-Wall -Wextra ${_vllm_cpp_werror}>
$<$<COMPILE_LANGUAGE:CXX>:-Wall -Wextra ${_vllm_cpp_werror} ${_vllm_cpp_array_bounds}>
# OBJCXX (.mm — the Metal backend) is a SEPARATE COMPILE_LANGUAGE from CXX,
# so the CXX genex above does not reach it. Without this line the Metal TUs
# would be the only unwarned code in the tree (BACKEND-METAL-MLX W0).
Expand Down
16 changes: 16 additions & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ example targets are named after the directories they are built from, so an
in-source build makes the linker write each executable over its own source
directory (issue #85).

### Host compilers

gcc 13 and 14 and clang are exercised by CI, and **gcc 16 builds the tree,
including the OpenAI server**. Before this it did not: several files, one of
them the server's own `main`, called `getpid()` without including `<unistd.h>`
and compiled only because an older libstdc++ happened to pull that header in
for them. A compile-only CI lane on the newest released gcc now guards this,
because every other Linux lane uses the distro compiler and cannot see it.

On gcc 16 the `array-bounds` warning is reported but is **not** treated as an
error, unlike on every earlier gcc. That release emits it inside libstdc++ and
the vendored JSON library for code that is correct, and no change to the
calling code avoids it (`cmake/CompilerWarnings.cmake` explains the mechanism
and cites the upstream gcc bug). A genuine out-of-bounds still fails the build
on gcc 15 and earlier, which is what the rest of CI enforces.

### Setting the compiled build identity

`vllm-server --version` reports the CMake project version by default. Release
Expand Down
1 change: 1 addition & 0 deletions src/vllm/entrypoints/openai/server_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
// tests/vllm/entrypoints/openai/test_api_server.cpp). The wiring below is the
// same either way.
#include <algorithm>
#include <unistd.h>
#include <cmath>
#include <cstdlib>
#include <exception>
Expand Down
1 change: 1 addition & 0 deletions tests/vllm/models/test_indextts2_s2mel_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// skipped otherwise -- skipped LOUDLY, so "the real checkpoint was never
// checked" cannot read as "the real checkpoint passed".
#include <algorithm>
#include <unistd.h>
#include <cmath>
#include <cstdint>
#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions tests/vllm/models/test_indextts2_talker_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The real-checkpoint cases run when VLLM_CPP_INDEXTTS2_GPT points at the
// converted gpt.safetensors, and skip LOUDLY otherwise.
#include <algorithm>
#include <unistd.h>
#include <cmath>
#include <cstdint>
#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions tests/vllm/models/test_ltx2_text_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// a 1.19e-5 ABSOLUTE floor under any epsilon, which would let a tight tolerance
// silently accept anything (including zero).
#include <algorithm>
#include <unistd.h>
#include <cmath>
#include <cstdint>
#include <cstdio>
Expand Down
1 change: 1 addition & 0 deletions tests/vllm/models/test_minimax_music3_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// number against a reference implementation, and nothing below should be read
// as having done so.
#include <algorithm>
#include <unistd.h>
#include <cmath>
#include <cstdint>
#include <cstdio>
Expand Down