Distributed Machine Learning Notebooks with Elixir and Livebook
news.livebook.dev
news.livebook.dev
When we started the Numerical Elixir effort, we were excited about the possibilities of mixing projects like Google XLA's (from Tensorflow) and LibTorch (from PyTorch) with the Erlang VM abilities to run concurrent, distributed, and fault-tolerant software.
I am very glad we are at a point where those ideas are coming to life and I explore part of it in the video. My favorite bit: making the tensor serving implementation cluster distributed took only 400 LOC (including docs and tests!): https://github.com/elixir-nx/nx/pull/1090
I'll be glad to answer questions about Nx or anything from Livebook's launch week!
The distributed ML currently seems focused on model execution. I see another commenter's excitement about "Looking forward to NX transformations that take distributed training next level." -- which I agree, will be quite interesting.
Where / how do you see Nx being used effectively in distributed training? Is distributed training a reality for open-sourced models to compete against big tech models?
For the second question, my understanding is that all big tech models rely on distributed training, so distributed training is a requisite for competing really.
Haven't found a big project for it yet, but I've done a bunch of little side projects since a friend who worked at Appcues gave me the hard sell on it around 2018.
I'm not an expert here, but I'd expect that capturing a sample using Membrane and piping it into Whisper should be doable.
On the other hand, if you expect a variety of formats (mp3, wav, etc), then shelling out or embedding ffmpeg is probably the quickest path to achieve something. The Membrane Framework[1] is an option here too which includes streaming. I believe Lars is going to do a cool demo with Membrane and ML at ElixirConf EU next week.
[0]: https://github.com/elixir-nx/bumblebee/blob/main/examples/ph...
Yes, the relevant part of his demo with the membrane pipeline appears to be here: https://github.com/lawik/lively/blob/master/lib/lively/media...
I have a rough one using Membrane (media framework) that you can find here: https://github.com/lawik/membrane_transcription
I am using it for this talk I am putting together for ElixirConf EU so if you want it used in context that might be helpful: https://github.com/lawik/lively
Neither is release-worthy levels of polish but if interest is there I should make a proper library out of it.
That is to say streaming chunks works great already. I would love two things. Stitching the edges of the chunks, would probably need to do overlapping for that. And building chunks based on silence. That's more DSP than I know though.
I think this work is very important. I don't understand whether I actually needed to install the library dependencies for Membrane's sake or specifically for this use case (mad, ffmpeg, portaudio). Doesn't feel right..
While accurate, it's a bit of an understatement :) Thanks for all your work, Jose.
Even reading the blog, after installing the windows app it's not obvious how to get to the machine learning demos.
Also, after I found the +smart button from another page, on windows it fails due to lack of make (and presumably a set of compiler tools). This was frustrating trying to demo for someone on their computer.
I didn't realize until a recent side project just how much progress had been made in Nx until I started implementing parts of Nx Serving myself only to find the Nx libraries already have distributed batched serving, faiss, pg_vector support and more.
Makes me want to quit all work obligations to hit the books and build product with Nx.
I do wonder if maybe streaming large data chunks over Erlang distribution might be a problem and a secondary data channel (e.g. over udp or sctp) might be worth playing with.
Looking forward to NX transformations that take distributed training next level.
I'm familiar with Joe Armstrong and Erlang/Elixir, but do you have a particular reference in mind where he was specifically discussing this? Is it one of his papers or talks? Just looking for another interesting thing Joe Armstrong said or thought. :)
You may want to take a look at the partisan[0] library written in Erlang. It is basically that, a reimagination of distributed Erlang, except that it can be multiplexed over multiple connections.
https://github.com/livebook-dev/livebook/blob/main/lib/liveb...
Or are you looking for something else?
Context: I’ve used Observable notebooks a fair bit, but not other kinds of notebooks.
Having both great native support for distribution and a performance, GPU able, numerical library could make Elixir a great fit for that platform.