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

New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
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
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement