-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing Ax on a Raspberry Pi (Model 3B+) #412
Comments
Hey Nicolas, this sounds super exciting! Admittedly I've been getting hyped up about ARM recently and it's great to hear Ax is finding its way onto Raspberry Pis. Unfortunately, I don't think we've tried to build and run Ax & Botorch on ARM yet, but if you are able to get it to work, we'd love to head about it (and are open to PRs). Here are some rough notes that might help:
fwiw, it seemed like 32-bit ARM support is shaky, with Pytorch issues like pytorch/pytorch#27040, so arm64 might be your best bet. |
Note that Unfortunately no ARM-compatible pytorch conda package yet though... |
Thanks for your replies. I suspected that 32-bit would be a problem, so I tried the Raspberry Pi OS 64bit (beta): https://www.raspberrypi.org/forums/viewtopic.php?t=275370 I also found the ARM64 build for PyTorch that @stevemandala refered to and successfully installed it on a model 3B+. That worked fine. I stopped when bulding scikit-learn didn't finish through the night and instead I ran into a bunch of errors. I read somewhere that this is a difficult task, especially if you don't know exactly what you're doing (I am not a linux expert). The reason I wanted Ax on RPis is simple: In a project we are building a research platform to automate the execution of experiments with Ax. For this, we need a number of compute instances that carry out the experiments on demand. As we have many RPis at the university, I thought why not give it a spin. I now switched to Google compute VMs for that, which works perfectly fine. That said - IF you should ever find a working solution for Ax on a Raspberry Pi I would be super interested to hear about it and try it myself! Nicolas |
We will now be tracking wishlist items / feature requests in a master issue for improved visibility: #566. Of course please feel free to still open new feature requests issues; we'll take care of thinking them through and adding them to the master issue. |
@winf-hsos curious to hear more about this! Both the automated research experiments and the Google compute VMs. I'm interested in getting Ax installed on an RPi in the context of this hackaday project [GitHub] and was thinking about offloading some of the more intensive optimizations to Google Colab, but wasn't entirely sure how I'd go about sending commands to the RPi remotely. |
I was able to get
Altogether: sudo apt-get install gcc
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh
exit # <or Ctrl+D, i.e. MUST close and restart terminal for conda to be recognized> After closing and opening the terminal per the last step above: conda create -n ax python==3.9.*
conda activate ax
pip install ax-platform I ran the Service API script, and the output was as expected!
Note that I was running the RPi in headless mode via VS Code's Remote SSH which lets me use debugging among many other things like linting and auto-formatting. |
This is awesome stuff! I'm going to share this with folks for some karma. The main problem is that it's probably not going to scale particularly well since the BO algorithms can be pretty compute heavy and benefit a lot from HW acceleration such as MKL that you won't have on a RPi, so if you have large search spaces / many trials / many objectives I expect the little berry to burst pretty quickly. We have a (currently internal) project that might interest you - It's a remote service based on Ax designed to be deployed on some machine (e.g. could be on AWS or some physical machine you've got sitting around) and then serve a client via RPC calls in an ask/tell fashion. The big benefit of course is that you can have a beefy machine doing the compute and then serve the results to super lightweight / embedded hardware that essentially just runs an RPC client (which could be python but also any other language you like). The RPC layer is currently based on Apache Thrift (this is what's well supported at Meta), but we actually do have plans (albeit no timelines yet) to abstract the RPC layer away from the server implementation so that other folks in OSS could easily implement their own. |
ax-platform does not have any compiled code, so this shouldn’t be required from ax itself. Maybe a dependency needs to be compiled on your platform. |
Thank you! 😸
Great point about acceleration. Agreed about this quickly getting unwieldy for more complex optimizations. At least in terms of RAM, the RPi 4B can go up to 8 GB, but the speed would still be a major issue. Also, I like the metaphor usage "berry to burst"! 😆
Definitely of interest to me! Thanks for mentioning this. This aligns with the needs of many autonomous research lab projects and would fit nicely with the autonomous research lab demo I mentioned. Very exciting! I would love to try it out when it would make sense on your end. |
Does anyone have experience with installing Ax on a Raspberry Pi, im my case the model is 3B+. I run Raspberry Pi OS 32bit and I also have one with the 64bit beta version. I'd like to install the Ax dependencies manually, but it's difficult to find the matching pre-compiled packages for the arm64 or arm7l architecture. Any help or hints (is this even possible?) would be very much appreciated!
Thanks
Nicolas
The text was updated successfully, but these errors were encountered: