Run tinygrad code using your iPhone or iPad’s GPU
steps
- install and open this app on your iPhone or iPad
-
install tinygrad on a computer connected to the same wifi network
- run any tinygrad code
REMOTE=1 HOST={your iphone/ipad IP address}:6667 python3 examples/gpt2.py --model_size=gpt2
Also try YOLOv8 on tinygrad, by caching tinygrad remote batches, models can be easily ran locally.
notes
- tinygrad’s REMOTE API is not stable, there is no guarantee that this will work on the newest commit on tinygrad master. You may have to checkout an older tinygrad commit (from the date of the latest commit in this repo). PRs welcome.
- Max allowed app RAM < total RAM. An iPhone 13 (4GB RAM) cannot use over 2GB in a single app for example, it will crash. Each device has its own limit.
- Metal cannot be ran in the background on iOS, the app must be open to run.
- Modifying one line in tinygrad to send batches on copyin() can increase the amount of memory that can be used, depending on the situation. This needs to be fixed within this app.