kokolegorille

kokolegorille

Elixir and Deep learning

Hello everyone,

This is a light talk about Alphazero.

Recently I have been impressed by latest AI from google, learning the game of go in 21 days and chess in 4 hours. It looks like the matrix world is not so far.

Most of the tools for deep learning are not done in Erlang/Elixir, because they are not really good at numbers crunching. But they can communicate with external libraries, for example with Python.

It looks like a breaking change, the year computers started to learn by themselves.

Any thoughts about the possible role of Erlang/Elixir could play in building the next super AI?

Most Liked

CptnKirk

CptnKirk

I think that all BEAM languages are currently hamstrung by not having an easy way of using them as front-end LLVM targets. As far as I know, most popular Deep Learning libraries are written in C/C++ with higher level language bindings made available via automated compiler toolchain magic. Compile to LLVM and generate the front-end language bindings (bytecode, opcode, whatever).

This may be due to a number of reasons: Data type incompatibilities, BEAM scheduler/thread incompatibility, BEAM isolation semantics, etc.

Dirty schedulers might help to a certain degree. But one would still need to be able to concretely map all low-level types present in C to BEAM bytecode and I don’t know how difficult that is.

This state of affairs bums me out and not just for Deep Learning. There seem to be many libs and SDKs available for a dozen languages, and Erlang/Elixir never makes these lists. Presumably, because it’s too difficult to auto-generate the language binding.

This doesn’t mean that all is lost. There are a number of ways to bridge Elixir with AI-ready languages. For example, Python is an incredibly popular language for building/training deep learning models. Inference can then happen in another front-end language. You can then bridge Elixir to this language. Or keep the small inference logic in Python and the rest of your inference server logic in Elixir. Use Ports to communicate between the Elixir/other_lang processes.

Even in this case you really need to like doing “everything else” in Elixir in order to justify the architecture and code overhead. And you still need to deal with data type impedance problems over the Port. That, unfortunately, is where I think Elixir and Deep Learning will be stuck in 2018.

CptnKirk

CptnKirk

Thanks. :slight_smile: I’m no expert. Just done a bit of research out of anger. There are others that can probably give a more correct and nuanced technical explanation of why BEAM can’t have nice things.

I think it boils down to this scenario being the other side of the BEAM coin. The same characteristics that make it better than other VMs for certain things, make it worse for this thing.

Where Next?

Popular in Discussions Top

AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
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
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement