Repository navigation
Bump mlx to b2c93bd1: build and hash each custom kernel variant once, bounded memo (gemma4-qat #189) - #7
Merged
Conversation
…l-explore#189) Bumps Source/Cmlx/mlx to numen-tech/mlx#5 (fork/189-kernel-hash-memo): metal_kernel builds and hashes each kernel variant once. tools/update-mlx.sh (run with LC_ALL=C so the CUDA jit source order matches the committed file) changes no generated source; only the Metal.hpp commit stamp moves.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… gemma4-qat ml-explore#189) Bumps Source/Cmlx/mlx to numen-tech/mlx#5 head b2c93bd1: the per-kernel variant memo now holds at most 64 shared_ptr-owned entries and is cleared when full (Codex P2). tools/update-mlx.sh (run with LC_ALL=C) changes no generated source; only the Metal.hpp commit stamp moves.
jeethu
added a commit
that referenced
this pull request
Oct 4, 2026
…ero implied-bias factor gradient, gemma4-qat ml-explore#190)
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.
Depends on numen-tech/mlx#5. Merge that PR first, with a merge commit so
b2c93bd1(andf5428f85) stay reachable, and then merge this one. The gemma4-qat branchperf/189-kernel-hash-memopins this PR's head.Source/Cmlx/mlxfrom 2f0e44f9 to b2c93bd1 (metal_kernel: build and hash each kernel variant once (gemma4-qat#189) mlx#5 head; the first commit c7f1b05 pinned f5428f85, the second commit bb14f0c moves to b2c93bd1):fast::metal_kernelbuilds and hashes each kernel variant once per kernel object.CustomKernelstores a shared source and a precomputed hash.shared_ptr-owned variants per kernel object, cleared when full. No raw entry pointer leaves the lock, and a pending array whose entry was evicted still evaluates.MLXFast.metalKernelbehaves the same. The memo key includes each template arg's kind, soint1 andbooltrue stay distinct kernels, as they already were through the library cache.tools/update-mlx.shchanges no generated source. The mlx change touches no JIT source. The only regenerated diff is the commit stamp inMetal.hpp.LC_ALL=C. Under my shell's default locale, the zsh glob sortsgather_axis.cuhbeforegather.cuh. That reorderscuda_jit_sources.hagainst the committed file: the bytes are the same, but the order differs.xcrun swift buildsucceeds. It still prints warnings, but they predate this PR, and none of them are in the changed files.Testing is on the gemma4-qat side (
perf/189-kernel-hash-memo, commit 715862f7, and re-run at 0596ed0d on this PR's head bb14f0c with the same results):Full Swift suite passes. XCTest totals, as executed/skipped: NumenCoreTests 1506/61, NumenAppTests 1988/11, NumenStudioUITests 750, NumenSessionTests 649/4, NumenIndexTests 90, NumenMemoryTests 31, NumenDispatchTests 19, NumenCLITests 4. Swift Testing: ParoQuantMLXTests 127. Skips are models not provisioned on the host and opt-in soak/live-web runs.
ParoQuantMLXTestspasses 3 of 3 runs (127 tests each).NumenDispatchTestspasses 3 of 3 runs, and every budget is unchanged: decode 327/2/0/2, prefill 434/3/0 with waits 1-3, speculative k=4 418/5/0/5.Greedy stdout from a Release
numen-cli(--greedy --no-draft --max-tokens 128) is byte-identical between base a08b1ee and this PR for Granite 4.1 3B PARO, Qwen3.5 2B PARO and Gemma 4 E2B.Host microbench, µs per call, Debug build on a loaded machine, so indicative only:
At bb14f0c (bounded memo), same Debug microbench: 95 KB header eval 10.4–11.0, no header 10.4–11.0, PARO rotation 12.7–12.9 µs/call, unchanged from the unbounded memo. Greedy stdout is byte-identical base vs bb14f0c for the same three models on two prompt files.
The quiet-machine A/B is still to do.