Why I Switched from Python to Rust for AI Deployment

preview_player
Показать описание
In this video, I share my journey of deploying the same AI project with both Rust and Python, highlighting the challenges, successes, and performance differences. I also compare The performance difference between Polars and Pandas.

🤔 Key Points:
* Polars VS Pandas
* Speed comparison between Rust VS Python
* Scalability comparison between Rust VS Python
Рекомендации по теме
Комментарии
Автор

So what's the conclusion? Is it ready for ML or datascience production systems

zendr
Автор

Now you can switch from Rust to Mojo and make new video about why I switched

MnCr
Автор

I have been trying rust and the learning curve it steep . Unfortunately python has a huge ecosystem and u cant just jump it. Thats why i am looking carefully at Mojo which has similar memory management features to rust, the borrower checker and how referencing is done in rust. This can be a game changer. Mojo can bring in C perforance, Rust security and python versatility in one language

francismatsika
Автор

I’m curious if in the Rust implementation of polars, did you use lazy execution or eager?

houstonbova
Автор

What about Mojo? The language that was literally designed for AI from the ground up? Plus Mojo's speed could be tested too.

vectoralphaSec
Автор

running multi workers for the api will solve the concrent request issue,

MbdBaldod
Автор

Anyway polar can run also in 1 thread, maybe you were using only the default which is multi-thread and that's bad for non intensive request

julyort
Автор

when trying to learn rust polars functionality, each time I run the code the compilation time takes around 10 seconds!
any body knows how to reduce the time spent in compilation to make it ideal to learn and try polars functionality as a newbie ?

Singlton
Автор

So did you switch from Python to Go or Rust?

jnorris
Автор

look at virtually any published benchmarking of pandas vs polars and polars is many times faster. Without seeing your code it's impossible to prove, but this was almost certainly a skill issue in terms of writing the rust. I am also extremely skeptical about your Golang conclusions, were you using goroutines?

as for your last slide, you can spawn threads in Python too

but, for all the newbies out there, alas you're unlikely to see almost any of these options. Much more likely to see something like Java, Kafka, Flink, or even Postgres with plugins. For applications that need super quick inference speed, very likely to see C or CPP

djthedadiofficial
Автор

is there any git code link to check your recommendation project?

martincontreras
Автор

The only thing that was stopping me from moving from python to something like c/c++ before was ergonomics, not that c++ can't be concise, but a lot of libraries seem to require verbose interfacing. Rust, like python, seems to be very concise, so it offers a best of both, in brevity and performance, that I always thought were mutually exclusive. I was never under the illusion that python was efficient, it just had great syntax, which made prototyping a joy. It feels like I can prototype in rust same as I used to in python, and then get the proper implementation for free at the end.

All that said, wasn't the GIL getting removed and couldn't you use multiprocessing.pool?

johanngambolputty
Автор

please provide free resources for rust

enchantedshit
Автор

Hi, if possible, can you please do a tutorial how to deploy AI on production? Thank you. I know you when im interested in Go and Rust, and now im working in AI industry too. Those banger videos about AI project on your channel really help, but its a coincident when I realize this video is on the same channel.

rgolanng
Автор

Biggest advantage of using rust is Zero-Cost-Abstraction, For example `sumation()` function could be write as:

(1..=n).sum()

and it would still out performed.

nurmohammed
Автор

Well, I didn't learn anything from the video, but it did add yet another data point confirming what I already knew. Python makes it immensely difficult to write efficient code and requires external libraries written in better languages to achieve any degree of speed and general usefulness. Rust is basically a more obtuse C++ that nearly everyone in the future will use because the propaganda machine surrounding it is exceedingly effective. I know that a lot of people will claim that Rust is easier to learn, but since you can write your code in C++ exactly the same way as in Rust to achieve the same goal the same way and it will be equally as fast, the ease of use of C++ for simple projects shouldn't be understated. If you write idiomatic modern C++, it's as safe as Rust.

anon_y_mousse
Автор

Only c++, rust is a copy of that, dont be naive

rqrlhsj