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

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
Fl4m3Ph03n1x
Background A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell. I...
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New
AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
AstonJ
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books f...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New

Other popular topics Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
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
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement