Repository navigation
Harden MLX inference reliability and prepare 0.3.0 - #31
Merged
Merged
Conversation
ToluClassics
marked this pull request as ready for review
July 26, 2026 19:18
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.
Summary
This PR establishes a trustworthy inference baseline for MLX Transformers 0.3.0 on Apple silicon.
It adds bounded CI and tests, makes checkpoint loading strict and offline-capable, replaces duplicated/unbounded generation loops with a finite batched contract, fixes compatibility defects exposed by real checkpoints and the minimum dependency matrix, and makes package/release metadata match the tested support contract.
Why
The existing package could silently retain randomly initialized parameters when checkpoint keys did not match, could not reliably load cached Hub models offline, and had broken or unbounded generation behavior across several causal families. The default test suite could initiate large checkpoint downloads without an explicit resource gate.
Packaging also declared MIT despite an Apache-2.0 license, reused an already-published version, installed UI/test dependencies as core requirements, and rebuilt unverified artifacts during publication.
What changed
MLX_TRANSFORMERS_RUN_HUB_TESTS=1max_new_tokensgeneration with batching, mixed padding, EOS/pad handling, cache updates, and caller-input immutabilitypyproject.tomlthe canonical package definition for version 0.3.0 and Apache-2.0mainCI artifact for the exact release commit and matching version tagValidation
Local host: Apple M2 Max, macOS 26.0.
Dependency matrices:
Release-candidate gates:
pip check: passedReal cached-checkpoint checks passed for MiniLM/BERT task heads, Llama 3.2 1B, Phi-2, Phi-3 Mini, Qwen3 0.6B, Gemma 3 1B and 4B multimodal, Qwen3-VL 2B text generation, NLLB 600M, and 4-bit MLX Phi-3.
Support boundaries
.binloading, remote model code, non-Metal execution, and unbounded generation are unsupportedAll required CI checks pass. The PR is ready for review and awaits the repository's required human approval.