The Elixir community is glad to announce the arrival of several Neural Networks models, from GPT2 to Stable Diffusion, to Elixir. This is feasible because of the just announced Bumblebee library, which is an implementation of Hugging Face Transformers in pure Elixir.
To assist anyone start with those models, the team behind Livebook – a computational notebook platform for Elixir – created a set of “Smart cells” that enables developers to scaffold different Neural Network tasks in just 3 clicks. You possibly can watch my video announcement to learn more:
Due to the concurrency and distribution support within the Erlang Virtual Machine, which Elixir runs on, developers can embed and serve these models as a part of their existing Phoenix web applications, integrate into their data processing pipelines with Broadway, and deploy them alongside their Nerves embedded systems – with out a need for Third-party dependencies. In all scenarios, Bumblebee models compile to each CPU and GPU.
Background
The efforts to bring Machine Learning to Elixir began almost 2 years ago with the Numerical Elixir (Nx) project. The Nx project implements multi-dimensional tensors alongside “numerical definitions”, a subset of Elixir which will be compiled to the CPU/GPU. As an alternative of reinventing the wheel, Nx uses bindings for Google XLA (EXLA) and Libtorch (Torchx) for CPU/GPU compilation.
Several other projects were born from the Nx initiative. Axon brings functional composable Neural Networks to Elixir, taking inspiration from projects reminiscent of Flax and PyTorch Ignite. The Explorer project borrows from dplyr and Rust’s Polars to offer expressive and performant dataframes to the Elixir community.
Bumblebee and Tokenizers are our most up-to-date releases. We’re thankful to Hugging Face for enabling collaborative Machine Learning across communities and tools, which played an important role in bringing the Elixir ecosystem up to the mark.
Next, we plan to give attention to training and transfer learning of Neural Networks in Elixir, allowing developers to enhance and specialize pre-trained models in response to the needs of their businesses and applications. We also hope to publish more on our development of traditional Machine Learning algorithms.
Your turn
If you desire to give Bumblebee a try, you’ll be able to:
-
Download Livebook v0.8 and robotically generate “Neural Networks tasks” from the “+ Smart” cell menu inside your notebooks. We’re currently working on running Livebook on additional platforms and Spaces (stay tuned! 😉).
-
We’ve also written single-file Phoenix applications as examples of Bumblebee models inside your Phoenix (+ LiveView) apps. Those should provide the vital constructing blocks to integrate them as a part of your production app.
-
For a more hands on approach, read a few of our notebooks.
If you desire to help us construct the Machine Learning ecosystem for Elixir, take a look at the projects above, and provides them a try. There are various interesting areas, from compiler development to model constructing. As an illustration, pull requests that bring more models and architectures to Bumblebee are actually welcome. The longer term is concurrent, distributed, and fun!
