Skip to content
Merged
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
11 changes: 6 additions & 5 deletions docs/BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6883,11 +6883,12 @@ us by about 1.5 points.
The default (non-MLX) build is **95.9%** against this corrected baseline, not
96.4%.

The 2026-08-03 MLX system-header dependency correction is **NOT APPLICABLE** to
benchmark results: it replaces translation-unit warning suppression with an
imported CMake dependency whose public headers are `SYSTEM`. Darwin CI remains
the build-verification gate; no runtime path, measurement, or binding number
changed.
The 2026-08-04 MLX system-header warning correction is **NOT APPLICABLE** to
benchmark results: the imported CMake dependency keeps its public headers
`SYSTEM`, and the provider now also scopes AppleClang's
`-Wgnu-folding-constant` suppression to those MLX public includes. Darwin CI
remains the build-verification gate; no runtime path, measurement, or binding
number changed.

**Everything qualitative in the entry below still holds** — MLX wins prefill, the
shape gate is the right disposition, the fallback hoist was worth 27.2 vs 17.8 —
Expand Down
6 changes: 4 additions & 2 deletions docs/STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,10 @@ per-lever chronology: [docs/BENCHMARKS.md](BENCHMARKS.md) and
[.agents/specs/metal-dispatch-attribution.md](../.agents/specs/metal-dispatch-attribution.md).
The MLX-enabled Darwin build remains **build-verification pending**: MLX is now
an imported CMake dependency whose public include directory is explicitly
`SYSTEM`; third-party header diagnostics stay outside project `-Werror`, while
vllm.cpp warnings remain fatal. Darwin CI is the binding AppleClang gate.
`SYSTEM`, and the provider additionally scopes AppleClang's
`-Wgnu-folding-constant` suppression to the MLX public includes. Third-party
header diagnostics stay outside project `-Werror`, while vllm.cpp warnings
remain fatal. Darwin CI is the binding AppleClang gate.

**CUDA architectures.** The production target is GB10/`sm_121a` (runtime-gated,
both gate models token-exact + at/above vLLM speed). The arch-additivity
Expand Down
7 changes: 7 additions & 0 deletions src/vt/metal/metal_mlx_provider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@

// MLX public headers. Deliberately NOT mlx/backend/metal/*: those pull in
// metal-cpp and, as noted above, their entry points are not exported anyway.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-folding-constant"
#endif
#include "mlx/allocator.h"
#include "mlx/array.h"
#include "mlx/dtype.h"
#include "mlx/ops.h"
#include "mlx/stream.h"
#include "mlx/transforms.h"
#if defined(__clang__)
#pragma clang diagnostic pop
#endif

#include "metal_buffers.h"
#include "metal_context.h"
Expand Down
46 changes: 44 additions & 2 deletions tests/scripts/test_mlx_system_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,50 @@


class MlxSystemHeadersTest(unittest.TestCase):
def test_dependency_module_is_shipped(self) -> None:
self.assertTrue((ROOT / "cmake" / "MLXDependency.cmake").is_file())
def test_dependency_target_marks_mlx_headers_as_system(self) -> None:
dependency = (ROOT / "cmake" / "MLXDependency.cmake").read_text(
encoding="utf-8"
)
self.assertIn("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", dependency)

def test_mlx_includes_have_source_scoped_clang_warning_suppression(self) -> None:
provider = (ROOT / "src" / "vt" / "metal" / "metal_mlx_provider.mm").read_text(
encoding="utf-8"
)
required_pragmas = (
"#pragma clang diagnostic push",
'#pragma clang diagnostic ignored "-Wgnu-folding-constant"',
"#pragma clang diagnostic pop",
)
for pragma in required_pragmas:
self.assertIn(pragma, provider)
self.assertEqual(provider.count("#if defined(__clang__)"), 2)
self.assertIn(
"#if defined(__clang__)\n"
"#pragma clang diagnostic push\n"
'#pragma clang diagnostic ignored "-Wgnu-folding-constant"\n'
"#endif\n",
provider,
)
self.assertIn(
'#include "mlx/transforms.h"\n'
"#if defined(__clang__)\n"
"#pragma clang diagnostic pop\n"
"#endif\n",
provider,
)
push = provider.index("#pragma clang diagnostic push")
ignored = provider.index(
'#pragma clang diagnostic ignored "-Wgnu-folding-constant"'
)
first_mlx_include = provider.index('#include "mlx/allocator.h"')
last_mlx_include = provider.index('#include "mlx/transforms.h"')
pop = provider.index("#pragma clang diagnostic pop")
first_project_include = provider.index('#include "metal_buffers.h"')
self.assertLess(push, ignored)
self.assertLess(ignored, first_mlx_include)
self.assertLess(last_mlx_include, pop)
self.assertLess(pop, first_project_include)

@unittest.skipUnless(
shutil.which("cmake") and shutil.which("clang++") and shutil.which("ar"),
Expand Down
Loading