Skip to content

docs: MPS/Apple-GPU acceleration pathways (#72) - #73

Merged
neuromechanist merged 1 commit into
mainfrom
72-mps-apple-silicon-gpu-acceleration-pathway-gated-on-float32-stability
Jul 8, 2026
Merged

docs: MPS/Apple-GPU acceleration pathways (#72)#73
neuromechanist merged 1 commit into
mainfrom
72-mps-apple-silicon-gpu-acceleration-pathway-gated-on-float32-stability

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #72. Research deliverable: .context/mps_pathways.md.

Governing finding

Apple-Silicon GPUs have no FP64 hardware; PyTorch MPS and MLX both support float64 only on CPU (confirmed mid-2026 via PyTorch/Apple-Developer/MLX sources). AMICATorchNG runs float64 for parity, so the parity path can never run on an Apple GPU -- every MPS pathway is gated on a numerically stable float32 AMICA.

Pathways (cited)

  • A (enabler): float32 stabilization via Kahan/compensated summation + mixed precision -- targets the ~30504-sample sufficient-stat accumulation (a float32 precision sink the Stabilize float32 AMICATorchNG for the GPU fast path #70 attempt didn't address). Kahan gives near-float64 accuracy independent of N.
  • B: exploit the large-tensor regime -- MPS lost on 32 channels due to fixed per-op dispatch overhead, which amortizes on big tensors; sweep channel count/block/n_models for the crossover.
  • C: MLX port (2-3x over PyTorch MPS, Apple-native fusion) -- higher ceiling, full rewrite, v2.
  • D: FP64 emulation (metal-float64) -- dead end (custom-Metal-only, no transcendentals, 18-32x penalty).

Recommendation

Gated on A. Sequence A -> B -> C. Until then float64-CUDA (4.5x, bit-safe) is the production GPU path. Docs-only.

Research into accelerating AMICATorchNG on Apple Silicon. Governing fact: Apple
GPUs have no FP64 hardware, and neither PyTorch MPS nor MLX supports float64 on
GPU (CPU-only, confirmed mid-2026). So the float64 parity path can never run on
an Apple GPU, and every MPS pathway is gated on a stable float32 AMICA.

Pathways: (A) float32 stabilization via Kahan/compensated summation + mixed
precision -- the enabler, with a concrete technique the #70 attempt lacked;
(B) exploit the large-tensor regime where MPS's fixed dispatch overhead
amortizes (sweep channels/blocks to find the CPU crossover); (C) MLX port
(2-3x over PyTorch MPS, full rewrite, v2); (D) FP64 emulation -- dead end
(custom-Metal-only, no transcendentals). Cited throughout.
@neuromechanist
neuromechanist merged commit e6c9846 into main Jul 8, 2026
1 check passed
@neuromechanist
neuromechanist deleted the 72-mps-apple-silicon-gpu-acceleration-pathway-gated-on-float32-stability branch July 8, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MPS / Apple-Silicon GPU acceleration pathway (gated on float32 stability)

1 participant