Repository navigation
build(cuda): move the CUDA images to MLX v0.32.4 - #21
Merged
Merged
Conversation
MLX v0.32.0's CUDA graph cache counted every miss for the life of the process and threw once it passed twice the capacity, and a commit that threw left its dependency edges in the encoder, so every later commit failed with cudaGraphAddDependencies: invalid argument. A long go test process crossed the limit without real thrashing and 15 gpu tests then failed in one run while passing alone. v0.32.4 fixes both upstream (#4356 resets the encoder after a failed commit, #4661 counts only consecutive misses). Patches against v0.32.4: - worker wait: fixed upstream (#4452). The patch is removed; the worker check now asserts the pinned source does not spin (it fails on v0.32.0). - allocator reclaim: rebased. Upstream adopted the clear_cache trim but switches devices with make_current and never restores the caller's device, and still does not trim on set_cache_limit; keep ours. - JIT CCCL: dirs.cpp now includes common/utils.h for current_binary_dir(); the source check and archive probe supply a stand-in for that function. - conv-transpose grad and conv plan fallback apply unchanged. The app image now requires a base built from v0.32.4, since the encoder fixes come from the release itself rather than a marker-carrying patch.
The bridge replaced MLX's cache-thrash message with its own tuning hint, which hid the original error while diagnosing the CUDA graph cascade. The bridge now records MLX's text verbatim and Go appends the batching settings in effect when it reads the error, as a pure function that is tested without CGO.
The fixtures are strict FP32, but CUDA allows TF32 by default and the policy is frozen per process, so dilated convolutions missed them by TF32 rounding (~3e-4 absolute). The test now reruns itself in a child process with TF32 disabled, keeping the original tolerance.
data/example is gitignored, so a fresh checkout failed the test instead of skipping it as the repository convention requires.
The base build failed the worker check with only a CalledProcessError, hiding whether callbacks stopped arriving or the idle loop spun.
A failed marker or commit check stopped the build with only the whole RUN line, not which test failed.
v0.32.4 implements Cholesky with cuSOLVER (ml-explore/mlx#4208), so static libmlx now references cusolverDn*; the gpu test binary failed to link on a CUDA host.
On CUDA, HGRN2/mLSTM full-block fixtures and TTT-MLP split continuation missed their 2e-4 bounds under default TF32 (2.9e-4 to 6.5e-4) and passed with TF32 off. The child now starts with MLX_ENABLE_TF32=0, because Go does not see the bridge's setenv and config-driven precision would otherwise conflict.
NewLocalLearnerSession rejects non-Metal backends by design, so on CUDA these tests failed instead of skipping.
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.
Moves the CUDA images from MLX v0.32.0 to v0.32.4 and closes the follow-ups from #20.
Why
In one long
go testprocess, 15 CUDAgputests failed while passing alone. MLX v0.32.0's CUDA graph cache counted every miss for the process lifetime and threw past 2×capacity, and a commit that threw left its dependency edges in the encoder, so every later commit failed withcudaGraphAddDependencies: invalid argument. v0.32.4 fixes both upstream (ml-explore/mlx#4356, ml-explore/mlx#4661).Patch audit on v0.32.4
clear_cachetrim but usesmake_currentwithout restoring the device, and still does not trim onset_cache_limit.dirs.cppnow includescommon/utils.h; the source check and archive probe providecurrent_binary_dir().v0.32.4 implements Cholesky with cuSOLVER (ml-explore/mlx#4208), so every libmlx link line adds
-lcusolver. The app image now rejects a base not built from v0.32.4.Follow-ups
internal/strictfp32testhelper reruns them in a child process withMLX_ENABLE_TF32=0.set -x. Each failed once on Cloud Build without saying why, and neither reproduced.Opportunistic
TestSWAWindow128Smokeskips without the gitignored example shards instead of failing.Verification
make lint0 issues; portable suite passes; full MLX suite passes.golf-mlx-cuda-base:mlx-0.32.4-go1.27.4and archgolf-mlx-cuda:mlx-0.32.4-go1.27.4built. All patch checks pass before and after, and the NVRTC probe reportslibmlx CCCL fallback /usr/local/include/cccl compiles cuda::std::rint; toolkit-only control fails as expected. The validation app build succeeded.gpusuite in one process, default TF32, fresh PTX cache: exit 0, 173 top-level passes, no thrash orcudaGraphAddDependencieserrors.arch+train: exit 0 at e4cf45e (train 2052s, run with-timeout 60mbecause the suite exceeds go test's 10m default on an L4).golf-mlx-cuda:latestpromoted to the v0.32.4 image; the previous image stays taggedmlx-0.32.0-go1.27.4-jitcccl. The firstcheck-mixlab-imagesrun predates the promotion and was rejected by the new version guard, as intended.