Skip to content

Commit 3f32c84

Browse files
fix(build): suppress MLX folding warning after flags (#24)
Move the narrow AppleClang diagnostic suppression into the MLX-only translation unit so target-level -Werror cannot re-promote it. Keep all other warnings fatal. FOLLOWING_AGENTS_PROTOCOL Assisted-by: Codex:gpt-5 [systematic-debugging] Co-authored-by: localai-org-maint-bot <[email protected]>
1 parent 78137b1 commit 3f32c84

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -831,12 +831,6 @@ if(VLLM_CPP_METAL)
831831
endif()
832832
target_compile_definitions(vllm PUBLIC VLLM_CPP_MLX)
833833
target_sources(vllm PRIVATE src/vt/metal/metal_mlx_provider.mm)
834-
# MLX 0.29.x headers use GNU-folding expressions that AppleClang diagnoses.
835-
# Suppress that one external-header diagnostic for this TU. A source-level
836-
# -Wno-error is ordered before vllm_cpp_set_warnings' target-level -Werror,
837-
# so AppleClang promotes it again.
838-
set_source_files_properties(src/vt/metal/metal_mlx_provider.mm PROPERTIES
839-
COMPILE_OPTIONS "$<$<COMPILE_LANG_AND_ID:OBJCXX,AppleClang>:-Wno-gnu-folding-constant>")
840834
# SYSTEM so MLX's own headers cannot break our -Werror build.
841835
target_include_directories(vllm SYSTEM PRIVATE "${MLX_ROOT}/include")
842836
target_link_libraries(vllm PUBLIC ${MLX_LIBRARY})

docs/BENCHMARKS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6530,6 +6530,11 @@ us by about 1.5 points.
65306530
The default (non-MLX) build is **95.9%** against this corrected baseline, not
65316531
96.4%.
65326532

6533+
The 2026-08-02 AppleClang warning-suppression correction is **NOT APPLICABLE**
6534+
to benchmark results: it changes only whether the optional MLX provider compiles
6535+
under target-wide `-Werror`. Darwin CI remains the build-verification gate; no
6536+
runtime path, measurement, or binding number changed.
6537+
65336538
**Everything qualitative in the entry below still holds** — MLX wins prefill, the
65346539
shape gate is the right disposition, the fallback hoist was worth 27.2 vs 17.8 —
65356540
only the headline ratio moves. The gate is still worth about +1.7 points over the

docs/STATUS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,9 @@ loop, not parallelism or layout. An optional MLX GEMM provider is available via
14071407
`-DVLLM_CPP_MLX=ON` and currently measures net slower than our own kernels. Full
14081408
per-lever chronology: [docs/BENCHMARKS.md](BENCHMARKS.md) and
14091409
[.agents/specs/metal-dispatch-attribution.md](../.agents/specs/metal-dispatch-attribution.md).
1410+
The MLX-enabled Darwin build remains **build-verification pending**: its narrow
1411+
AppleClang header-warning suppression now lives in the provider translation unit
1412+
so the target-wide `-Werror` cannot re-promote it; Darwin CI is the binding gate.
14101413

14111414
**CUDA architectures.** The production target is GB10/`sm_121a` (runtime-gated,
14121415
both gate models token-exact + at/above vLLM speed). The arch-additivity

src/vt/metal/metal_mlx_provider.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
#include <cstring>
5151
#include <vector>
5252

53+
// MLX 0.29.x uses constant-folded variable length arrays in public headers.
54+
// Keep the target-wide -Werror policy, but ignore that external-header-only
55+
// AppleClang diagnostic after command-line warning options have been applied.
56+
#if defined(__clang__)
57+
#pragma clang diagnostic ignored "-Wgnu-folding-constant"
58+
#endif
59+
5360
// MLX public headers. Deliberately NOT mlx/backend/metal/*: those pull in
5461
// metal-cpp and, as noted above, their entry points are not exported anyway.
5562
#include "mlx/allocator.h"

0 commit comments

Comments
 (0)