Repository navigation
Warn at configure time when NAX kernels are disabled - #3824
Merged
Merged
Conversation
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3821.
What
Add a
message(WARNING)in theelse()branch of the NAX-kernel gate inmlx/backend/metal/kernels/CMakeLists.txt, so a build that silently drops theM-series Neural-Accelerator (NAX) kernels says so — and prints the two inputs
that decided it:
Why
The NAX gate (added in #3622) requires Metal 4, macOS SDK ≥ 26.2, and
CMAKE_OSX_DEPLOYMENT_TARGET ≥ 26.2. CMake takes the deployment target from theMACOSX_DEPLOYMENT_TARGETenvironment variable when the Python build toolchainexports one (with it unset, the top-level CMakeLists falls back to the host OS
version). Any target in [14.0, 26.2) configures fine but silently compiles
without NAX — that is exactly how we hit it: a build with target 26.0 lost the
NAX kernels with no indication, costing ≈3–4× on prefill-dominated workloads
(NAX covers GEMM / quantized-matmul / attention) and a debugging session that
initially looked like an upstream performance regression. A configure-time
warning turns that silent cliff into a one-line diagnosis; printing the actual
SDK and deployment-target values makes it self-explanatory.
Notes on scope
being dropped), not on any inference about why the target is set the way it
is. zcbenz noted on the issue he wasn't sure there is a reliable way to detect
whether the target came from the Python toolchain vs. elsewhere — this change
sidesteps that question entirely: it states the requirement, prints the
observed values, and makes no claim about intent. Anyone who set the target
deliberately can read it and move on.
is informational rather than actionable. If that is too chatty, the warning
could be limited to the actionable case (
SDK ≥ 26.2but target < 26.2) witha
message(STATUS)otherwise — either shape works; this PR keeps the simpleform.
is a runtime check there); non-macOS builds never enter this file.
+5 lines,
cmake-format(v0.6.13, the pre-commit pin) clean, no behavior changeto the build output itself.