Prototype course-owned Metal matrix tiles - #277
Draft
skyzh wants to merge 2 commits into
Draft
Conversation
AI-Assisted: GPT-5.6 Sol + Forge
AI-Assisted: GPT-5.6 Sol + Forge
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.
Why
Prototype the course's quantized-prefill and paged-prefill Metal paths without relying on hidden
mlx::steelloader or MMA primitives, while preserving the existing algorithms and measuring the cost honestly.Change
BlockMMAwith a small direct-simdgroup_matrixwrapper;Starter code, chapters, navigation, workflows, publication files, public APIs, dispatch, block-table translation, manual cross-page loading, QKᵀ/PV, masking, online softmax/rescaling, int4 dequantization, Split-K policy, and reduction are unchanged.
Review note
Experimental Draft only. Base is
1078c08130fa0648fe45f11bf32ca33a7ecfdd58/ tree164b5f9c867b51458a6dc3a85c197fd3e4322774. Frozen head is84f6f4f9e9ae0e8b3bfee458569b063464ea0e3c/ tree43300470ae50c5b99016b78d9725a00f32c9a91e; the measured implementation commit is69c4df4aa187088bdf6b78f3f1fc46be6107a0e7/ tree17dd72ea5e818cb394d11647a34d030f0ba123d7(the successor commit only adds evidence).Validation on Apple M4 Pro / Python 3.12.13 / MLX 0.32.0:
mlx::steelsource matches: zero;4ec26111a26adbe84a65da69e533911f14a8f94441b1a54ce61784085d22d3b6.Accepted interleaved command-level comparison (positive latency delta is slower):
Recommendation: retain this as a readable correctness prototype, but do not mainline this exact implementation until the direct-MMA/quantized-prefill gap is closed under the same contract. No Ready, merge, release, tag, or deployment is requested.
AI-Assisted: GPT-5.6 Sol + Forge