6 ms·
I wish there wouldn’t be such a song and dance about “moving away from Python”. There’s nothing wrong with creating ML tools in Elixir, but it’s always Python i
by matt_daemon 3y ago
I wish there wouldn’t be such a song and dance about “moving away from Python”. There’s nothing wrong with creating ML tools in Elixir, but it’s always Python is slow, Python has no concurrency support, blah blah
- OJFord 3y ago"Everything is working fantastically with our python ML project but we're rewriting it in Elixir anyway" would be a weird article wouldn't it?
- substation13 3y agoThose are real issues though.
- antupis 3y agoyes but generally they are not that kind make or break type issues like eg Julia correctness problems.
- lopatin 3y agoIs concurrency useful for ML?
- not-my-account 3y agoYou end up having to do a lot of things in a ML training run, some of which you can do in parallel because it’s not important now (eg saving metadata) or because you’d otherwise be resource limited (eg loading data and formatting batches for training)
- davidktr 3y agoAnd for this you cannot use Python's multiprocessing because ... ? Sure, moving data between processes is slow because of pickling [0]. However, I'm using parallel processing for the things you suggested, and for these it works great. If I really had the use case and needed threads, I'd much rather use C++ bindings in a Python package than rebuilding the whole thing. Guess it depends on the scale we are talking about. [0] https://pythonspeed.com/articles/faster-multiprocessing-pickle/ https://pythonspeed.com/articles/faster-multiprocessing-pick...
- hosh 3y agoIt’s handling all the things that can go wrong when communicating and coordinating across processes, across machines, or troubleshooting bottlenecks on running systems that Elixir (and Erlang) excels.
- formulathree 3y agoNo, parallelism is useful, concurrency without parallelism is not useful. Go and elixir provide some parallelism but the primary focus for both languages is concurrency.
- NaiveBayesian 3y agoIf your data loading pipeline grows even slightly complex, then yes, you absolutely need concurrency in order to deliver your samples to the GPU fast enough. The current workarounds to make this happen in python are quite ugly imho, e.g. Pytorch spawns multiple python processes and then pushes data between the processes through shared memory, which incurs quite some overhead. Tensorflow on the other hand requires you to stick to their Tensor-dsl so that it can run within their graph engine. If native concurrency were a thing, data loading would be much more straightforward to implement without such hacks.
- substation13 3y agoYes, it can be. 1. Loading data 2. Running algorithms that benefit from shared memory 3. Serving the model (if it's not being output to some portable format) There are also general benefits of using one language across a project. Because Python is weak on these things, we end up using multiple languages.
- throwawaymaths 3y agoIt's not. Until you need to deploy it.
- itronitron 3y agoConcurrency generally makes things run faster. If you test your ML methods your tests will complete faster if the ML methods are able to use and take advantage of concurrency. Some people consider that useful.
- thibaut_barrere 3y agoI come from Ruby but the reactions can be similar, happy to give my data point. The thing is Elixir is really good at an increasing number of things. If you need to write a HTTP proxy in the middle of your application, since Elixir processes & incoming HTTP workers are cheap, you do not need to go evented: it just works. If you need to have reactive web apps with automated changes pushed to the client, it's the same: there is no need to external tools (e.g. any cable) at certain scale. If you need to do some scripting, there is `Mix.install/2` for single-file dependencies description & use. If you start crawling too much web pages or process to many APIs, the concurrency support kicks in and there is less need to scale (or later), turning into fewer machines, fewer ops problems (or delayed) etc. And now you start being able to use MachineLearning, deploy the same type of code on GPU, embed Machine Learning models right in the middle of your web app without much work, etc, which in turns makes it a nice platform for apps / SaaS. Elixir really is becoming a Swiss-army knife which scales easily :-)
- knewter 3y agoAnd nerves makes it easy to do IoT stuff / almost-embedded
- parthdesai 3y agoadd rustler and you can even do some systems stuff! (We use it at work)
- gv83 3y agostill not easy at the most important thing of all: being approachable, instrumented and intuitive to people less dedicated to programming. I say this as someone that likes elixir, but after seeing it failing miserably at my org, I'm very skeptical it can be thrown around like a spring or node or django project. It needs real support from the org and requires module design skills that are not present in most random devs from a random org.
- pythonaut_16 3y agoCould you expand on what you mean by this? Module design doesn't seem any harder than class design in JS or Python. Do you mean the language is generally harder for non-developers? Or that Elixir is harder for JS/Python developers to pick up and write good code? Or something else? Writing well designed Elixir code does seem to require a fairly different approach from most common OO languages, at least at a surface level. (Although IMO that's more because you can copy OO patterns you've seen before without thinking much about why they're good patterns than because good design in Elixir is much different from OO)
- sodapopcan 3y agoThis article in particular doesn't feel like there's any song and dance. The very first line is directed at people already using Elixir who are looking to stay in Elixir-land while getting deeper into ML.
- whalesalad 3y agoPython is slow and concurrency is not great.