VR

MacFleet: Distributed ML for Apple Silicon

Pool Apple Silicon Macs into a distributed ML training cluster with auto-discovery, adaptive compression, and thermal-aware scheduling.

PythonPyTorchMLXgRPCmDNSRing AllReduce

Why I Built This

Apple Silicon Macs have serious GPU power, but there's no native way to combine them for ML training. If you have three Macs sitting on a desk, that's three GPUs training could use, but they just sit idle. I wanted to make pip install macfleet and macfleet join the only things standing between a few Macs and a training cluster.

How It Works

  • Automatic discovery via mDNS/Bonjour helps Macs find one another on the local network.
  • Framework-agnostic core where the communication layer uses only NumPy, never importing PyTorch or MLX. Both engines work through the same infrastructure.
  • Adaptive gradient compression using TopK and FP16. The current README describes local compression with dense gradients on the wire; roughly 20x savings over Ethernet and 200x over WiFi are targets for sparse transmission.
  • Heterogeneous scheduling where faster Macs get proportionally larger batches based on GPU core count. The scheduler re-profiles throughput continuously and adjusts for thermal throttling (nominal → 100%, fair → 90%, serious → 70%, critical → 30%).
  • Ring AllReduce for N-node gradient synchronization that scales linearly with cluster size.
  • Dual engine support for both PyTorch (MPS backend) and Apple MLX with identical APIs.
  • A gRPC control plane and raw TCP tensor transport, with HMAC authentication and TLS support. The implementation handles asynchronous gRPC coordination and includes memory controls for 16 GB machines.

Results

FeatureDetail
Installpip install macfleet
DiscoveryAutomatic via mDNS (zero config)
EnginesPyTorch (MPS) + Apple MLX
CompressionLocal TopK + FP16; 20x Ethernet and 200x WiFi wire savings are targets
Tensor benchmarkAbout 8 GB/s effective tensor throughput after compression over Thunderbolt 4, measured as uncompressed tensor workload per second
Reported latencyBelow 1 ms
Training runResNet-18 (11.2M parameters) on CIFAR-10 across two M4 Macs
Workload split16:10 GPU-core weighting across M4 Pro and M4
Thermal managementReal-time workload adjustment
CLI toolsjoin, status, train, bench, diagnose
API patternsOne-liner, context manager, decorator