Live data from Hacker News

How Mojo gets a speedup over Python – Part 2

modular.com

31–40 of 66 posts

Re: How Mojo gets a speedup over Python – Part 2

#31

35Kx speedup is not scaled speedup. Throw this, naively parallelizable task at a bigger computer and get 70kx speedup, etc. While i think there are tons of optimizations to be done for python (looking at you GIL) giving access to low level cpu primitives is not one I think that will be broadly adopted by the python community. That's one of the joys of python: system agnostic, looks pretty close to pseudocode, coding.…

> 35Kx speed up is not scaled speed up. Right. However, this is a comparison versus Python and the GIL, which can’t do that at all. > While i think there are tons of optimizations to be done for python (looking at you GIL) giving access to low level cpu primitives is not one I think that will be broadly adopted by the python community. It doesn’t need to be, any more than writing Numba or Pyrex is done on a large sca…

Have you played with Mojo? It really doesn’t feel high level.

I feel like JAX has been eating Julia’s lunch lately, making me think that there’s a real market for a small functional differentiable programming language with good Python interop - like a more polished Dex or Futhark.

Re: How Mojo gets a speedup over Python – Part 2

#32
post #10

I don't understand the play here for Modular. If this is a worthwhile improvement that is broadly applicable, won't it at some point make it's way into Python, numpy, etc? In Java land we had a bunch of other JVMs over the years offering better performance. Most important things got absorbed into what is now OpenJDK, and the other JVMs, if they even exist at all, are niche players. Performance is a huge focus in Pyth…

Just based on their website, I think selling Mojo as a faster Python-like language isn't intended to be their main product. They place a lot more emphasis on AI/ML acceleration than on Mojo, and on creating compatibility between different AI hardware acceleration systems.

I have the impression they hope vendors of AI acceleration hardware, clusters and cloud services will be their customers, to provide uniform and heavily backward-compatible cross-acclerator AI/ML APIs to those vendors' customers.

And hope that users of those services and hardware will also pay for high quality well-researched APIs that work reliably with many different AI/ML accelerators, even if Mojo is free. Similar to how RedHat provides value through commercial-grade QA and sustained development for Linux on high-end hardware, that would be complicated and risky to use otherwise.

Re: How Mojo gets a speedup over Python – Part 2

#33
post #26
post #12

Earlier quoted context omitted.

If they've figured out how to deliver performance that Python might get around to in 5-10y, shouldn't they tout that, for people who might want that now? Ultimately promoting the possibility for better performance, & current contrast, is good for prodding other languages/runtimes like Python to match these options. The "important things [get] absorbed" process you mention relies on teams making some "play for" altern…

Totally, just trying to understand why this is a $100MM of VC money investment. Is the market that big for this? (Honest question)

I feel like there’s 100m of VC money here because it’s Chris Lattner’s company and he’s the best compilers person in the world right now.

Re: How Mojo gets a speedup over Python – Part 2

#34
post #13

At least they included numpy in this one. On their last post, after all their optimizations, numpy.matmul() produced almost the exact same throughput as their most optimized example. Would still need to dig in to see if this one has issues. Benchmarks are always such a minefield.

matmul is a wrapper for BLAS. If you're faster than BLAS you're beating handwritten assembler code specialized per CPU architecture.

But people use numpy for matrix multiplies in Python. Unless they are claiming to be 35k times faster on general-purpose code, the 35k number is absurd.

Re: How Mojo gets a speedup over Python – Part 2

#35
post #13

At least they included numpy in this one. On their last post, after all their optimizations, numpy.matmul() produced almost the exact same throughput as their most optimized example. Would still need to dig in to see if this one has issues. Benchmarks are always such a minefield.

matmul is a wrapper for BLAS. If you're faster than BLAS you're beating handwritten assembler code specialized per CPU architecture.

Right; but the point is that the optimizations didn't require an entirely new language; you just take the core logic and write it in an existing language that has decades of optimizations. If you're doing math; there's likely a natural, well defined interface that can be used, so you just call that interface from Python, which has historically always been the point of 'glue' languages :)

Re: How Mojo gets a speedup over Python – Part 2

#36

35Kx speedup is not scaled speedup. Throw this, naively parallelizable task at a bigger computer and get 70kx speedup, etc. While i think there are tons of optimizations to be done for python (looking at you GIL) giving access to low level cpu primitives is not one I think that will be broadly adopted by the python community. That's one of the joys of python: system agnostic, looks pretty close to pseudocode, coding.…

> At the end of the day, mojo's pay to play programming language harkens back to the early 90's Borland days.

I didn’t address this in my other post. Modular is about to release a freely available SDK. Also, the standard library sources will be open sourced shortly. There are hints of additional open source initiatives.

Modular’s main business plan appears to be adding value in the general area of AI, AI training, and AI deployment, including by offering SAAS. That plan in no way conflicts with (and in fact encourages) an open Mojo language ecosystem.

Re: How Mojo gets a speedup over Python – Part 2

#37
post #31

Earlier quoted context omitted.

> 35Kx speed up is not scaled speed up. Right. However, this is a comparison versus Python and the GIL, which can’t do that at all. > While i think there are tons of optimizations to be done for python (looking at you GIL) giving access to low level cpu primitives is not one I think that will be broadly adopted by the python community. It doesn’t need to be, any more than writing Numba or Pyrex is done on a large sca…

Have you played with Mojo? It really doesn’t feel high level. I feel like JAX has been eating Julia’s lunch lately, making me think that there’s a real market for a small functional differentiable programming language with good Python interop - like a more polished Dex or Futhark.

> Have you played with Mojo?

Yes.

> It really doesn’t feel high level.

Does Python “feel high level”?

Mojo is a proper superset of Python.

Particular functions may deal with low-level machine features, that is unavoidable when extracting maximum performance from hardware. Mojo is pursuing some innovative ideas there, such as autotuning and adaptive compilation.

As I said in a different post, I don’t think Mojo’s main audience is the general Python community, it’s the AI, real time, embedded, safety critical, HPC, and yes, gaming, communities that’ll likely benefit the most.

Re: How Mojo gets a speedup over Python – Part 2

#40

35Kx speedup is not scaled speedup. Throw this, naively parallelizable task at a bigger computer and get 70kx speedup, etc. While i think there are tons of optimizations to be done for python (looking at you GIL) giving access to low level cpu primitives is not one I think that will be broadly adopted by the python community. That's one of the joys of python: system agnostic, looks pretty close to pseudocode, coding.…

> At the end of the day, mojo's pay to play programming language harkens back to the early 90's Borland days. I didn’t address this in my other post. Modular is about to release a freely available SDK. Also, the standard library sources will be open sourced shortly. There are hints of additional open source initiatives. Modular’s main business plan appears to be adding value in the general area of AI, AI training, an…

that is good to hear. I read a post on Mojo months ago, signed up to the waitlist and then crickets. It would seem insane to think a non-open source, non-free compiler/interpreter could be successful these days.
Post reply on HN