Add native Metal acceleration for Apple Silicon inference SD1.5 First - #17469
Open
dmikey wants to merge 17 commits into
Open
Add native Metal acceleration for Apple Silicon inference SD1.5 First#17469dmikey wants to merge 17 commits into
dmikey wants to merge 17 commits into
Conversation
…ing instructions Signed-off-by: Derek Anderson <dmikey@users.noreply.github.com>
… optimization details Signed-off-by: Derek Anderson <dmikey@users.noreply.github.com>
- Implement opt-in capture of UNet calls for native-backend experiments in mps_unet_capture.py. - Enhance sd_hijack_unet.py to utilize the new capture functionality for validating outputs. - Create inspect_mps_unet_capture.py for inspecting captured data and validating replay accuracy. - Add unit tests for capture functionality in test_mps_unet_capture.py to ensure correct behavior. - Update state-of-things-next.md with findings from initial capture and performance benchmarks. Signed-off-by: Derek Anderson <dmikey@users.noreply.github.com>
dmikey
requested review from
AUTOMATIC1111,
catboxanon and
w-e-w
as code owners
August 12, 2026 15:45
Signed-off-by: Derek Anderson <dmikey@users.noreply.github.com>
…eration Signed-off-by: Derek Anderson <dmikey@users.noreply.github.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 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.
Description
SEEKING FEEDBACK
This PR adds a focused Apple Silicon acceleration path to Automatic1111 while preserving its existing UI, API, models, samplers, LoRA syntax, extensions, and PyTorch fallbacks. Currently focused on SD1.5 and Apple M1.
~ 40% improvement for LCM based models, than out of the box settings.
Changes
The primary optimized workload is Stable Diffusion 1.x with short DPM++ SDE/Karras schedules on Apple Silicon. Unsupported architectures, shapes, dtypes, training paths, and extension configurations continue through the existing PyTorch implementation.
Issues
No linked issues are close
Screenshots/videos
Representative M1 measurements are documented in the README including:
Validation
ruff check .using the CI-pinned Ruff 0.3.3: passed.Checklist
The focused tests pass, but the complete live-server suite remains to be run.
AI Disclosure
Codex assisted benchmarking and hot path traces were used to find measurable increases in performance for offloading attention, and other MPS attributes.