Forge crafts Metal: an Array framework with eager execution and JIT graph compilation for Apple Silicon GPUs
Project description
Forge
Forge crafts Metal: an Array framework with eager execution and JIT graph compilation for Apple Silicon GPUs
Forge was initially intended as a Python library to run Metal Kernels on Apple Silicon (M-series) GPUs. Through it's development, it's picked up more features of general array/tensor libraries like numpy, pytorch, and mlx.
Then why build Forge?
I built Forge and continue to work on it primarily because it's a passion project with a lot to learn from. In writing the code for this project, I learned about software design, compilers, GPU kernels, Python libraries, and testing. I hope to learn much more as I continue working on the project. I also believe that in due time, certain features could be done better than in existing available frameworks.
Features:
- Eager Execution: operations run asynchronously, seamlessly on GPU with a familiar API design
- JIT Graph Compilation (WIP): functions are compiled and optimized using the
@forgedecorator to be re-run more efficiently
Example:
This simple code snippet below will add the two arrays using your GPU.
from Forge import Array
a1 = Array([[1.0, 2.0], [3.0, 4.0]])
a2 = Array([[4.0, 5.0], [6.0, 7.0]])
result = a1 + a2
Further information
If this sounds interesting and you'd like to try out the library, you can install it and run it on your own macbook using this guide.
If you find anything interesting around and wish to contribute feel free to. You can take a look at this guide to get setup and contribute or shoot me a message @kellen05 on discord.
Thanks be to our contributors!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forge_metal-0.0.1.tar.gz.
File metadata
- Download URL: forge_metal-0.0.1.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4b0412ef2d95b9c02437a09a30df4f5f4bf1338da7b770a877f4dfaeb2b13c7
|
|
| MD5 |
3795ae6df3be928be745487fe9fd4eb0
|
|
| BLAKE2b-256 |
6543fb6153ff8d1a45571939c50c626b9aa0c7678bf6c39ef5e427d01ec995d0
|
File details
Details for the file forge_metal-0.0.1-cp313-cp313-macosx_26_0_arm64.whl.
File metadata
- Download URL: forge_metal-0.0.1-cp313-cp313-macosx_26_0_arm64.whl
- Upload date:
- Size: 95.3 kB
- Tags: CPython 3.13, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b79acb4e5c877758c2502b868a25c864332338b5ae0a0cd425ce8c61419d1c
|
|
| MD5 |
f4c9934659ee550969d7574b2186a9dd
|
|
| BLAKE2b-256 |
5315e4e75ad67c6993dd3d2b35f382be5288445eff880e9463677bc4c799c50b
|