News for hackers. Stuff that matters.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by josevalim on Thursday December 08, 2022 @04:16PM (#33913541)
Hi everyone, glad to be back here with the official announcement!

It is late here but feel free to drop questions and I will answer them when I am up. Meanwhile I hope you will enjoy the content we put out: the announcements, example apps, and sample notebooks!

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by shay_ker on Thursday December 08, 2022 @07:20PM (#33915780)
Congrats on the launch, this is fantastic. I love seeing these releases. They bring me so much joy & excitement.

Can you provide some thoughts on the benefits of doing ML on Elixir vs. Python? Is the benefit the language semantics? Is it much easier to get distributed work in Elixir ML vs Python ML? Are the tools better/smoother? Are there ML ops improvements? Perhaps there’s a blog post I missed :)

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by josevalim on Friday December 09, 2022 @01:40AM (#33918303)
I have written a bit about potential benefits in the initial announcement of Nx [0] and then on its first release [1].

In a nutshell, there has been trends in Python (such as JAX and Thinc.ai) that argue functional programming can provide better abstractions and more composable building blocks for deep learning libraries. And I believe Elixir, as a functional language with Lisp-style macros, is in an excellent position to exploit that - as seen in "numerical definitions" which compile a subset of Elixir to the CPU/GPU.

I also think the Erlang VM, with its distribution and network capabilities, can provide exciting developments in the realm of federated and distributed learning. We aren't exploring those aspects yet but we are getting closer to having the foundation to do so.

Regarding ML ops, I believe one main advantage is explained in this video announcement. When deploying a ML model with Nx, you can embed the model within your applications: you don't need a 3rd-party service because we batch and route requests from multiple cores and multiple nodes withing Erlang/Elixir. This can be specially beneficial for projects like Nerves [5] and we will see how it evolves in the long term (as we _just_ announced it).

Finally, one of the benefits on starting from scratch after Python has paved the way is that we can learn from its ecosystem and provide a unified experience. You can think of Nx as Numpy+JAX+TFServing all in one place and we hope that doing so streamlines the developer experience. This also means libraries like Scholar [2] (which aims to serve a similar role as SciPy) and Meow [3] (for Genetic Algorithms) get to use the same abstractions and compile to the CPU/GPU. The latter can show an order of magnitude improvement over other currently used frameworks [4].

[0]: https://dashbit.co/blog/nx-numerical-elixir-is-now-publicly-... [1]: https://dashbit.co/blog/elixir-and-machine-learning-nx-v0.1 [2]: https://github.com/elixir-nx/scholar/ [3]: https://github.com/jonatanklosko/meow [4]: https://dl.acm.org/doi/10.1145/3512290.3528753 [5]: https://www.nerves-project.org/

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by benswift on Friday December 09, 2022 @02:27AM (#33918633)
What will be interesting (and exciting) is seeing how GPU nodes are incorporated into platforms like fly.io, to really make this “elixir for ML/AI” thing seamless.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by josevalim on Friday December 09, 2022 @02:36AM (#33918678)
Definitely. Running ML/AI nodes close to your users on the edge and collocated with your app can be an exciting combo!
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by andy_ppp on Friday December 09, 2022 @04:45AM (#33919488)
AI that is specifically learning from your behaviour with a (partial) model per user I suspect is both terrifying and magical.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by Abishek_Muthian on Friday December 09, 2022 @12:31PM (#33924028)
I'm used to having a Python middleware in my Go web application just for ML, The idea of achieving the same with just one monolith application using Elixir is very tempting.

Has anyone switched to Elixir from Go for writing web apps? What has been your experience like?

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by matreyes on Saturday December 10, 2022 @07:58AM (#33932218)
You will not regret.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by Abishek_Muthian on Saturday December 10, 2022 @08:00AM (#33932234)
Please feel free to elaborate :)
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by kristerv on Monday December 12, 2022 @04:02AM (#33952502)
i switched from JS to Elixir. there are many benefits you can google yourself, but one thing i've realized for myself is that in regards to webapps LiveView is a real innovation. now PHP and others are copying what Elixir is doing, which is great, but it seems like Jose and others in the space are keeping Elixir on the frontline of innovation for a long time still. time and time again (like with the ML stuff) it amazes me how much Elixir is actually inventing new stuff and thinking outside of the "just a language" box. i almost quit programming honestly, because i just couldn't take the needless complexity of everyday life and Elixir saved my career. now i get shit done.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by losvedir on Thursday December 08, 2022 @04:36PM (#33913828)
What's the motivation for the name? I get "numbat" to "numerical", but not immediately seeing any connection for bumblebee.

Maybe a more serious question: is anyone using Elixir ML in production? I'm absolutely gobsmacked at the quantity and quality of development effort that's gone into it (and use Livebook daily, though not for ML stuff). It's clearly a major focus for the team. I'm wondering if it's ready for production adoption, and if so, if anyone has used it "in anger" yet.

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by cigrainger on Thursday December 08, 2022 @05:07PM (#33914336)
We use it in production at Amplified! It’s been a joy. We train our own large language models and have fine tuned and deployed using Elixir. I talked about it at ElixirConf this year (https://m.youtube.com/watch?v=Y2Nr4dNu6hI).

We were able to completely eliminate a few python services and consolidate to all Elixir for ETL and ML.

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by afhammad on Thursday December 08, 2022 @04:53PM (#33914107)
> Maybe a more serious question: is anyone using Elixir ML in production?

Checkout this recent talk about how https://www.amplified.ai/ moved from Python to an Elixir ML stack: https://www.youtube.com/watch?v=Y2Nr4dNu6hI

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by seanmor5 on Thursday December 08, 2022 @04:41PM (#33913912)
We are all really into bumblebees, specifically the kind that can transform into 1977 Yellow Camaros
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by AlphaWeaver on Thursday December 08, 2022 @04:52PM (#33914091)
Congrats on the launch! Been eagerly sitting in the #elixir IRC channel all day :)

How easy would it be to support OpenAI's new Whisper transcription model in Bumblebee?

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by seanmor5 on Thursday December 08, 2022 @05:24PM (#33914574)
It should not be too hard! From what I saw Whisper is similar to Bart, and we have Bart. The missing piece is a library for audio processing to tensors.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by tylrbrkr on Thursday December 08, 2022 @05:46PM (#33914842)
Would Nx Signal be that missing piece? https://github.com/polvalente/nx-signal
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by seanmor5 on Thursday December 08, 2022 @05:48PM (#33914861)
For some of it! I was thinking more something for loading different audio encodings to Nx tensors…so doing everything up until Nx
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by ricketycricket on Friday December 09, 2022 @01:14PM (#33924556)
I don't have the ML chops to make it happen, but whisper would be insanely useful to have in the tool chest.
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by pbowyer on Thursday December 08, 2022 @04:47PM (#33914010)
Congratulations on this release!

If I have a Huggingface model that I've finetuned, can I load it using Bumblebee? I fine-tuned ConvNext and changed it into a multi-label classifier and saved it as a PyTorch model. It works great but being able to use it in LiveBook instead of Jupyter Notebook would be fantastic.

I think I'd have to convert the format, but what then?

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by seanmor5 on Thursday December 08, 2022 @05:11PM (#33914395)
No need to convert the format! Bumblebee supports loading parameters directly from PyTorch. You can just specify `{:local, path/to/checkpoint}` in `Bumblebee.load_model`
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by chem83 on Thursday December 08, 2022 @04:47PM (#33914014)
Congrats on the launch! Muito legal!

Alternatively to EXLA/Torchx, any thoughts on supporting an ML compiler frontend like Google IREE/MLIR by generating StableHLO or LinAlg? This could pave the way towards supporting multiple hardware targets (Vulkan-based, RVV-based, SME-based etc.) with minimal effort from the framework.

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by josevalim on Thursday December 08, 2022 @05:47PM (#33914850)
Yes, we have been eyeing IREE but no work has started yet. However, our compiler architecture was designed exactly to make this possible, so it will be definitely welcome if someone decides to trail ahead on this road!
Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by seanmor5 on Thursday December 08, 2022 @05:26PM (#33914611)
There is a project in the ecosystem that builds on top of MLIR and can target any MLIR dialect, but it is not mature enough yet.

I think it would be great to see!

Re:Bumblebee: GPT2, Stable Diffusion, and More in Elixir by tommica on Thursday December 08, 2022 @04:20PM (#33913601)
Its really interesting- need to play with this!