Forge is an open-source neural network toolkit for Apple’s Metal framework, written in Swift by Matthijs Hollemans to make deep neural networks on iOS and macOS easier to build by hand.
Forge is a collection of helper code that sits on top of Apple’s MPSCNN framework and removes much of its boilerplate. A small domain-specific language lets you define a network as a readable chain of layers – input, resize, convolution, max pooling, dense, softmax – instead of pages of Metal setup code. Around that core it adds conversion functions between MPSImage/MTLTexture and plain Swift float arrays, custom layers that MPSCNN lacks (such as depthwise convolution), preprocessing kernels, helpers for writing your own compute kernels, and debugging tools for inspecting what a network actually computed. It ships with complete example apps using pretrained networks: LeNet-5 on MNIST, Inception-v3 for image classification, Tiny YOLO for object detection, and MobileNets running at 20 FPS on an iPhone 6s. The project has about 1,265 stars on GitHub. One honest caveat, stated in its own README: the author no longer maintains Forge – it targets the older MPSCNN APIs of the iOS 10/11 era (last push in 2018), and Core ML now covers most of the needs it originally served. It remains a clear, readable reference for how GPU neural networks are implemented on Apple hardware.
Forge is completely free and open source under the MIT license, with no paid tiers or services attached.
Forge is for developers and students who want to understand or experiment with hand-built GPU neural networks on Apple hardware, and for anyone maintaining legacy MetalPerformanceShaders code from the pre-Core ML era.