text
stringlengths
0
2.02k
I do know a thing or two about Elixir, but nowhere near as much as José... And here we're at the intersection of those two worlds, so kind of an exciting time. We're here first to talk about Nx. So José, what is this Nx thing you're here to tell us about?
**José Valim:** Alright, so Nx stands for Numerical Elixir. Back in November last year we started working on this. I can tell more about the story later... But the important thing is that in February we finally unveiled Nx, which is a library, but also this idea of a collection of libraries to improve Elixir, so we can...
\[03:49\] So I'll just give an overview of what we have out so far, so everybody is on the same page, and then we'll expand on that. So we started with Nx, which is the idea and the library itself, and the main abstraction in Nx, as you would expect, is multi-dimensional tensors. So you can do -- when I announced Nx, o...
So that's where we started. That was the first building block that we built. And one of the things that people ask a lot is that, you know, Elixir is a functional programming language, and functional programming languages promote immutability a lot, which means if you have a multi-dimensional tensor, like if you have a...
So to solve this, what we did -- and this is an idea that we've seen elsewhere. For example, in the Python community we have Jax, so a lot of the inspirations in Nx come from Jax... So the way we solved this in Nx is that we have this thing called numerical definitions. And what numerical definitions are is that they a...
So those are the two building blocks. We can come back to this and talk a lot about those things later. And then we released two bindings for Nx. One is EXLA. EXLA is a binding for the Google XLA, which stands for Accelerated Linear Algebra. So if you're using TensorFlow, what is running, the things in TensorFlow is Go...
And two months later - so that was in February - we released two other libraries. One is Axon -- so we starting with the building block, which was tensors, multi-dimension arrays, numerical definitions... So we released Axon, which is a high-level library for building neural networks... And we just announced LiveBook t...
**Daniel Whitenack:** So José, I'm curious, from the AI perspective - and I'm going to have to admit, for listeners, that I know almost nothing about Elixir, except what I've learned on the Changelog Podcast from you, in previous episodes... So I'm curious - from the community standpoint, what was really driving your m...
**José Valim:** \[08:27\] That's a great question. To give some context - one of the things... Like, going way, way back, it always started because of the Erlang Virtual Machine; the only reason that Elixir as a programming language exists is because of the Erlang Virtual Machine... And the Erlang Virtual Machine was b...
So I've created Elixir, and I've always thought -- in terms of programming languages, I really think that Python is a really stellar example of tackling a bunch of different problems. I always had in mind that I want that for Elixir and for the Erlang Virtual Machine, for the Erlang ecosystem. I think we can grow diver...
The first time I expanded this was back in 2016 we released abstractions for data pipelines and data ingestion. So if you need to consume queues, and you need to do that very efficiently, we released libraries for that, and that brought Elixir to a new domain, which was like data processing, and there are some very nic...
So we started that segment, and then the community started to grow, so people started bringing Elixir in the Erlang Virtual Machine for embedded. So there is the Nerves framework; people started bringing that to \[unintelligible 00:10:53.25\] streaming... And then there's always the question, "Why not numerical computi...
And this always started - just to finish giving more context - when PragProg... I always had this interest. Actually, my thesis, my master thesis was in task classification. But that was 11 years ago... So we were not talking about deep learning at the time yet; I think everything was still support-vector machines were...
\[11:49\] So in October last year, PragProg announced a book, which is "Genetic Algorithms in Elixir." And then I was like, "Hey, apparently there is somebody who knows things about AI and machine learning in the Elixir community", and he is Sean Moriarity. I sent him an email and I was like "Hey, I think the platform ...
**Jerod Santo:** So if we stay big-picture but we do a bit of a comparison, trying to understand exactly your aim here... If I was a happy NumPy/PyTorch, that Python data scientist kind of a person, are you hoping that maybe someday the Nx based and Elixir-based tooling would draw me over to Elixir? Are there aspects o...
**José Valim:** Honestly, I never tried to look at it that much ahead. For me, my goal right now is that for example -- imagine you are building an application in Elixir and then you need to do something with machine learning or data science, and like "Oh, I need to go to Python to solve this problem." If we have a too...
**Jerod Santo:** Gotcha.
**José Valim:** And then we'll see. Baby steps.
**Jerod Santo:** Daniel, what tools do you use in your day-to-day work?
**Daniel Whitenack:** Yeah, I like the framing of how you've just framed it, José... Because actually, my team's toolset - we develop models in Python using TensorFlow and PyTorch, but typically, in terms of the products that we're building, or what we're developing - we're developing either API servers, or something, ...
Now there's new stuff coming onto the scene in the Go community as well to try to support that same sort of workflow, where -- like, I would love to not do that. If I was working in Go and I didn't have to call into Python, that would be super-cool. And I think that's still developing.
So I totally get what you're saying - if you're working in Elixir, then it would be great for those developers to not have to do this sort of awkward call into Python for inferencing. It's awkward in always managing that and monitoring it and all of that is sort of dicey... Also though, I think that there is this sense...
\[16:07\] I don't think it's necessarily the best tools for AI will be built using Python; actually, I think a lot of my frustrations in life are because of working in Python. And I'm not trying to bash that, because it's also great, like you're saying. I think there is an opportunity for both sides of things I guess i...
**Jerod Santo:** That's interesting to hear that. José, one of the things you did with Elixir which I appreciated and I think a lot of people appreciated, because you've got a lot of people loving and using the language... As you took all of these things that influenced you and that you appreciated, and you brought the...
**José Valim:** Yeah, so this time it has really been shown in Jekyll. So all the deep learning, how things should work. Sean - he's really the one leading it... But the main seed that led to this was actually \[unintelligible 00:17:47.13\] before we started working together, I sent a tweet; I don't remember, but it wa...
And then I was reading the docs for Jax, so we were saying "Hey, Elixir is a functional programming language, and as a functional programming language, everything's immutable, so working with multi-dimensional data would actually be very expensive." But then I'm reading the docs for Jax, which is a Python library, and ...
And the whole idea in there is because the way that Jax works and the way that numerical definitions in Nx works is that when you are doing all the operations in your neural network, like "Hey, we need to multiply those tensors, we need to calculate softmax, we need to do the sum" - when you're doing all those computat...
\[19:53\] When we saw this idea, it was like "Hey, everything can be functional." And when it started, it was like a bunch of happy accidents, a book being published... I like to say, I really have a thank you for PragProg, because if they did not publish this book, if somebody read the proposal that Sean sent to PragP...
So I said, "We are going to start working, and as we build the tools, we are going to try to find what advantages Elixir can have compared to other programming languages, for example", and it turned out that as I kept saying what I thought would be a negative aspect, which is immutability, it really turned out to be a ...
So the way that Jax works is that -- in Python they call it the tape pattern. Basically, as they're calling methods in an object, it is requiring all the methods that you call. In Ruby we know it as method missing, but there are some operations in Python that cannot be recorded. For example, if you are setting a proper...
**Break:** \[22:20\]
**Jerod Santo:** So sitting on top of Nx is Axon, which is Nx-powered neural networks. Do you wanna give us the skinny on that tool, José?
**José Valim:** Yeah, so it's pretty much what the name says, it's neural networks built on top Nx. A lot of those things, Sean is the person behind it - Axon, EXLA, it's all Sean's work. And what he did for Axon is that he built all of the building blocks of a neural network, he built just using functions. They are re...
\[24:03\] So he built all of this -- it was really funny, because I think we can still find it in the repo... He created the initial issue, which I think had like 100 checkboxes, which was just like all of the functions that you use, all the initialization functions, optimizers, layers, activations - everything that yo...
So the same level of API convenience that you would expect from Keras or from PyTorch is there in Axon, but the building blocks as well. That's what Axon is about. It's a little bit out of my reach of my understanding... And it's kind of funny, because I can run the basic examples, but I still don't have a GPU. And the...
We have some very classical datasets that people use in machine learning, like MNIST, CIFAR... I don't know if I'm pronouncing those correctly, Daniel, but you probably what I mean. The Fashion-MNIST, and so on... And he has examples of -- and then \[unintelligible 00:25:38.11\] ResNet, and this kind of stuff... And th...
**Jerod Santo:** Don't you have a GitHub Sponsors or a donation button, man? Let's get this man a GPU. Someone's gotta get you a GPU.
**Daniel Whitenack:** Yeah, I know, right?
**Jerod Santo:** Come on...! \[laughter\] The world would be a better place if José Valim owned a GPU. I'm gonna put it on record.
**José Valim:** Yeah, I was really -- just an aside... I was like "I'm going to buy a Linux machine, so I can have the GPU." And then Apple came out and was like "Oh, we have TensorFlow running on M1." But they released just the compiled executables, and not the source code... So I'm like, "Do I buy a new machine that ...
**Jerod Santo:** Well, you've come to the right place. This is Daniel's expertise right here. This guy - he builds these things in his house.
**Daniel Whitenack:** Yeah... Unfortunately, it's all crazy right now. I know we ordered a server, and we had to switch the GPUs because of -- I don't know if you saw NVIDIA's... They kind of got mad that everybody was putting consumer cards in their enterprise servers, and so that all got switched up, which - I unders...
**Jerod Santo:** Supply shortages and everything?
**Daniel Whitenack:** Yeah, it's insane. Just scrolling through this, I'm pretty excited to try this in my little workstation with a GPU. I think it's cool that -- again, I'm coming not from an Elixir standpoint, but I recognize the API; it's very Keras-like, this high-level API that you're talking about, where you're ...
\[28:15\] So I don't know a ton about Elixir structs, but serializing it to multiple formats is really interesting to me, because - at least from my perspective, what I'm seeing is a lot of push for interoperability in the AI world, where people publish their model that they wrote in PyTorch on PyTorch Hub, and then I'...
**José Valim:** Yeah, definitely. When Sean was working on it, from the design, he was thinking "How can we get an ONNX model, load that into an Elixir data structure so we can get that, and send to the GPU, and have that running on the GPU?"
It goes back to what we were talking about a while ago - I think that the first users of this... Maybe I'm wrong, and I'll be very glad to be wrong, but I think the first users are going to be like "Hey, we have our data scientists that are super-familiar with this tooling in Python that is very productive, very useful...
One of the things that I think is really worth talking about with this idea - a lot of people, when they think about Elixir, they think about web. But Elixir is also really good thanks to the Nerves framework for embedded, and I think there is a lot of potential in this area of having machine learning neural networks r...
Serialization is there, and I think it's a matter of time. A lot of those things we are working on them. We also started a machine learning working group in the Erlang Ecosystem Foundation for people who are interested in this. So it's something that we plan to work, but if somebody is really excited about this - so if...
**Daniel Whitenack:** So how long have you both been working on Axon? Because it just seems like there's so much implemented. You were talking about "Hey, we need all of these different layers implemented that people know about." Typically, I see libraries maybe that have a new API for machine learning or something - i...