Live data from Hacker News

Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

notamonadtutorial.com

71–80 of 117 posts

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#71
post #69
post #47

Earlier quoted context omitted.

It's important to enjoy your work, which is - among other causes - about having right tools. Also, some of us actually get to have some influence over what language we write our projects in.

I think you misunderstand the parent. The obsession to always focus on tools is I think, what they described. In the end of the day what matters is what you produce, not what tools you used. Nobody cares about what you used, apart from engineers.

You care.

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#72
post #70

Earlier quoted context omitted.

C++ has sum types as of several years ago with std::variant.

The way Python has macros, sure :) You would have to keep everything in variants, or wrap/unwrap manually all over the place to get similar functionality. And C has tagged unions.

Can you elaborate more? What do other languages have over std::variant/visit?

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#73
post #27

Also worth checking out OmniSci (formerly MapD), which features an LLVM query compiler to gain large speedups executing SQL on both CPU and GPU: https://github.com/omnisci/omniscidb . And here's a link to a blog post giving a high level overview of the advantages of JIT compilation of queries over an interpreter: https://devblogs.nvidia.com/mapd-massive-throughput-database... .

That tweetmap is impressive

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#74
post #9

I saw a performance comparision with XLA, and it's interesting that Weld is faster, because XLA is supposed to optimize the code using the known tensor sizes during compile time. Weld and XLA seem to have similar optimization steps though.

XLA and Weld do have similar optimizations -- at their core, one of the main things they do is removing inefficiencies like unnecessary scans over data, common subexpressions, etc. across many operators. The speedup in the benchmark you're referring to actually involved some NumPy code too for pre-processing, and the reason Weld outperformed XLA is because Weld could perform those kinds of optimizations across Tensor…

For what it's worth, Jax (github.com/google/jax) now lets you use XLA to compile Numpy code. It'd be cool to see how that would stack up in a modern comparison.

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#75
post #69
post #47

Earlier quoted context omitted.

It's important to enjoy your work, which is - among other causes - about having right tools. Also, some of us actually get to have some influence over what language we write our projects in.

I think you misunderstand the parent. The obsession to always focus on tools is I think, what they described. In the end of the day what matters is what you produce, not what tools you used. Nobody cares about what you used, apart from engineers.

It’s not mutually exclusive. We are craftsmen and craftswomen. Definitely obsess over the problem but also obsess over the tools used to carve out the most usable elegant and efficient solution.

It’s really asking the same questions over and over again. Can we do better ? Does this tool allow me to be efficient, write safer and faster code, how good is the adjacent libraries and ecosystem ? What other kinds of things does it make it possible to solve?

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#76
post #69

Earlier quoted context omitted.

I think you misunderstand the parent. The obsession to always focus on tools is I think, what they described. In the end of the day what matters is what you produce, not what tools you used. Nobody cares about what you used, apart from engineers.

You care.

Are you coding as a hobby or a profession?

If you are a professional, you will use the most effective tool for the job - to get results. What tool will produce the best results - schedule, budget, quality, maintainability, scalabi, portability, etc.?

Other than outliers that will crush your productivity, or multiply it, your feelings are pretty irrelevant.

Similarly, when you get into a racecar, your feelings about your preferred driving style are irrelevant - if you can change the setup to accommodate your style without slowing jt down, great = but if not, your job is to adapt to the situation and reliably get the best possible result.

Either way, you have fun and produce a crap result, you will not be congratulated (or re-hired), and if you have little fun and produce a great result, you'll get both.

If it's a hobby, do whatever you want.

Obviously, in terms of professional development, you want to use more forward looking tools, but what is the best measure of that - your feelings or results?

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#77
post #70

Earlier quoted context omitted.

The way Python has macros, sure :) You would have to keep everything in variants, or wrap/unwrap manually all over the place to get similar functionality. And C has tagged unions.

Can you elaborate more? What do other languages have over std::variant/visit?

Pattern matching syntax (eg in Rust) makes a big difference.

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#78
post #76

Earlier quoted context omitted.

You care.

Are you coding as a hobby or a profession? If you are a professional, you will use the most effective tool for the job - to get results. What tool will produce the best results - schedule, budget, quality, maintainability, scalabi, portability, etc.? Other than outliers that will crush your productivity, or multiply it, your feelings are pretty irrelevant. Similarly, when you get into a racecar, your feelings about y…

I am a professional and I do not choose my tools based on the job.

I choose the best tools for me, invest a lot of time in getting better at them, and choose jobs I can do with minimal changes to my toolset.

To expand your analogy, if I have spent the last few years of my life getting better at driving bulldozers, I will not take any job requiring me to get into a racecar.

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#79
post #51

"the first implementation was in Scala, which was chosen because of its algebraic data types and powerful pattern matching. This made writing the optimizer, which is the core part of the compiler, very easy. Our original optimizer was based on the design of Catalyst, which is Spark SQL’s extensible optimizer. We moved away from Scala because it was too difficult to embed a JVM-based language into other runtimes and l…

Not that you should replace Rust with Haskell, but Haskell would've been a better choice than Scala. It has its own runtime, but it's not difficult to call Haskell code from C or ATS or whatever.

Not difficult to call from C? How does that work, exactly? Wouldn't you need to properly setup the whole runtime (incl. GC) first?

Re: Weld: Accelerating numpy, scikit and pandas as much as 100x with Rust and LLVM

#80

This post combines pretty much every technology I'm obsessed with right now: Python, Rust, Pandas, Numpy, and LLVM. Yess!!!

If these things interest you, check out Julia

how do you know someone uses Julia? don't worry they'll tell you.
Post reply on HN