3 ms·
These articles are kind of funny - they cargo cult things that are generally sound so you can't really be mad but it still reads like a shibboleth. Like the cl
by mathisfun123 3y ago
These articles are kind of funny - they cargo cult things that are generally sound so you can't really be mad but it still reads like a shibboleth.
Like the claim that jax's jit speeds things up or that it looks at whole functions. Fact: jax doesn't have a jit on its own, at least not a machine code jit (maybe they cache ir/lowerings). Jax has an IR and a ~semi-novel perspective on tracing. That's it. Note that tracing means basically the exact opposite of "whole function" compilation. Jax also has two backends XLA and LLVM (through MLIR/stablehlo). Now I'll honestly plead ignorance of XLA - it probably does have some kind of jit but what it definitely has is hyperoptimized kernel implementations (thanks to hundreds of millions in dev time invested by Google).
LLVM definitely has a jit but is it really that good that it beats numpy which itself is pretty well optimized (since it's so mature)?
Then the suggestion to use numba: numba does do whole function compilation but numba just punts to the LLVM jit. So like what's significance of suggesting one vs the other?
So this is my point: it's always a good thing when people search for optimization opportunities (more perf, less wall time, less power consumption, etc etc everyone wins) but it's not enough to just buy into the buzzwords. Or at least one shouldn't buy in and then present themselves as having actually done the due diligence. In serious compiler/perf engineering work everything is measured and remeasured and ablated and no one will take your seriously if you don't present your kernel counters (I'm kidding on the one but not really). Not everyone needs to be a compiler engineer but then you shouldn't pretend either.