Teaching Automatic1111 to Speak Metal on an M1
A developer details a personal fork of Automatic1111 optimized for Apple Silicon (M1/M3 Pro), aiming to close the performance gap with Draw Things without abandoning the WebUI, checkpoints, extensions, and workflow. The work includes a shape-selective Metal Flash Attention path, deferred Metal command-buffer submission (avoiding per-call commits), unified-memory-aware attention routing instead of fixed VRAM thresholds, streaming online softmax for the sub-quadratic fallback, removal of obsolete MPS workarounds gated by PyTorch version, and a fused GroupNorm+SiLU Metal kernel. Several promising ideas—packed QKV projections and moving residual blocks into MPSGraph—were implemented, benchmarked, and then deleted because full-generation timing showed them to be neutral or slightly slower despite good microbenchmarks. Results: the M3 Pro workload moved from roughly 8-10 seconds to 3-7 seconds, and a matched M1 Mac mini comparison showed 12.8s vs 8.7s (about 1.47x throughput), with NGMS treated separately since it reduces actual guidance work rather than engine overhead.
