woohaaha

woohaaha

Run Elixir/Livebook on Google Colab

Google Colab is a great resource to learn/practice machine learning. We can go to Google Colab rather than running an ML stack on our local machines and it’s mostly free. (There are also other services out there like Kaggle that provide a similar service)

I did a bit of searching but couldn’t find any references to being able to run Elixir on Google Colab or using Livebook on it. Anyone know if there are any plans in this direction?

I know Fly.io have Livebook hosting but I’m guessing we can’t pick the hardware for it to be run on like a GPU/TPU as is possible with Google Colab.

Most Liked

NduatiK

NduatiK

I’ve had some success running Livebook on Colab and Kaggle. The trick is to start Livebook then expose the port using ngrok. I’ll share a link to the notebooks when I’m back on my desktop.

The main downside is how long it takes to install everything, but the precompiled EXLA should speed this up.

NduatiK

NduatiK

@woohaaha, check this Kaggle example out.

Funny enough, this thread inspired me to try this out last year (Thanks!). Just never got back.


Here’s the colab example, not sure it still works. This is much older than the Kaggle example.


Importantly, you need to provide cuda options in your Livebook when installing dependencies,

Mix.install(
  [
    {:axon, "~> 0.1.0-dev", github: "elixir-nx/axon", branch: "main"},
    {:exla, "~> 0.2.0", github: "elixir-nx/nx", sparse: "exla", override: true},
    {:nx, "~> 0.2.0", github: "elixir-nx/nx", sparse: "nx", override: true},
    {:scidata, "~> 0.1.5"}
  ],
  system_env: [
    {"XLA_TARGET", "cuda111"},
    {"EXLA_TARGET", "cuda"},
    {"LIBTORCH_TARGET", "cuda"}
  ]
)

Lastly, you can import this livebook autoencoder gist for testing

NduatiK

NduatiK

If this helps you out and you find an free way to persist the notebooks on Kaggle, please share.

Where Next?

Popular in Questions Top

belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement