This repository was archived by the owner on Mar 21, 2026. It is now read-only.
fix: remove memory_efficient_threshold incompatible with MLX 0.22+#56
Closed
PatrickHeneise wants to merge 2 commits intoargmaxinc:mainfrom
Closed
fix: remove memory_efficient_threshold incompatible with MLX 0.22+#56PatrickHeneise wants to merge 2 commits intoargmaxinc:mainfrom
PatrickHeneise wants to merge 2 commits intoargmaxinc:mainfrom
Conversation
The `memory_efficient_threshold` parameter was removed from `scaled_dot_product_attention` in MLX 0.22+. Remove it from the two SDPA call sites in mmdit.py to restore compatibility. Also guard the `DiffusionKitInferenceContext.os_spec()` call in `__init__.py` — it raises an IndexError on macOS when the system profiler output format doesn't match the expected tab layout, crashing generation after the image is already decoded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
memory_efficient_thresholdfrom the twoscaled_dot_product_attentioncall sites inmmdit.py— this parameter was removed in MLX 0.22+ and causes aTypeErrorat the start of denoisingDiffusionKitInferenceContext.os_spec()in__init__.pywith a try/except — it raisesIndexErroron some macOS configurations where the system profiler output doesn't match the expected tab-delimited layout, crashing generation after the image is already decoded (the image was never saved)Repro
and after patching mmdit.py:
Test plan
diffusionkit-cliwithargmaxinc/mlx-stable-diffusion-3.5-largeon MLX 0.31.1 — image generates and saves successfully🤖 Generated with Claude Code