Live data from Hacker News

Mojo – a new programming language for AI developers

modular.com

11–20 of 272 posts

Re: Mojo – a new programming language for AI developers

#12
post #8

This looks quite interesting with big names behind it. I'd love to see a comparison vs Julia though, which I think tried to tackle some of the same problems.

> we want full compatibility with the Python ecosystem

Oh, I guess that's one big philosophical difference.

Re: Mojo – a new programming language for AI developers

#13
post #8

This looks quite interesting with big names behind it. I'd love to see a comparison vs Julia though, which I think tried to tackle some of the same problems.

I was thinking about Julia too. I guess they will try to make it reasonably compatible with Python directly making rewrites easier than Julia?

Edit: just saw this is a project by Chris Latner and Tim Davis. Hahaha ... that's immediate credibility.

Re: Mojo – a new programming language for AI developers

#14
post #8

This looks quite interesting with big names behind it. I'd love to see a comparison vs Julia though, which I think tried to tackle some of the same problems.

I was thinking about Julia too. I guess they will try to make it reasonably compatible with Python directly making rewrites easier than Julia? Edit: just saw this is a project by Chris Latner and Tim Davis. Hahaha ... that's immediate credibility.

but Mojo seems to keep all of that numpy cruft that's there because Python. (numeric computing was bolted onto python via numpy, but it's built-into Julia)

Re: Mojo – a new programming language for AI developers

#15
post #8

This looks quite interesting with big names behind it. I'd love to see a comparison vs Julia though, which I think tried to tackle some of the same problems.

I was thinking about Julia too. I guess they will try to make it reasonably compatible with Python directly making rewrites easier than Julia? Edit: just saw this is a project by Chris Latner and Tim Davis. Hahaha ... that's immediate credibility.

I'm sure there are reasons for it, but Chris Lattner has been jumping around a bit. Remember swift4TF. But hopefully this one is seen through with lots of open source too.

Re: Mojo – a new programming language for AI developers

#16
post #8

This looks quite interesting with big names behind it. I'd love to see a comparison vs Julia though, which I think tried to tackle some of the same problems.

It is a little disappointing that they're setting the bar against vanilla Python in their comparisons. While I'm sure they have put massive engineering effort into their ML compiler, the demos they showed of matmul are not that impressive in an absolute sense; with the analogous Julia code, making use of [LoopVectorization.jl](https://github.com/JuliaSIMD/LoopVectorization.jl) to automatically choose good defaults for vectorization, etc...

    julia> using LoopVectorization, BenchmarkTools, Test
           function AmulB!(C,A,B)
               @turbo for n = indices((C,B),2), m = indices((C,A),1)
                   Cmn = zero(eltype(C))
                   for k = indices((A,B),(2,1))
                       Cmn += A[m,k]*B[k,n]
                   end
                   C[m,n]=Cmn
               end
           end
           M = K = N = 144; A = rand(Float32, M,K); B = rand(Float32, K,N); C0 = A*B; C1 = similar(C0);
           AmulB!(C1,A,B)
           @test C1 ≈ C0
           2e-9*M*K\*N/@belapsed(AmulB!($C1,$A,$B))
    96.12825754527164
I'm able to achieve 96GFLOPs on a single core (Apple M1) or 103 GFLOPs on a single core (AMD EPYC 7502). And that's not even as good as what you can achieve using e.g. TVM to do the scheduling exploration that Mojo purports to do.

Perhaps they have more extensive examples coming that showcase the capabilities further. I understand it's difficult to show all strengths of the entire system in a short demonstration video. :)

EDIT: As expected, there are significantly better benchmarks shown at https://www.modular.com/blog/the-worlds-fastest-unified-matr... so perhaps this whole discussion truly is just a matter of the demo not showcasing the true power of the system. Hopefully achieving those high performance numbers for sgemm is doable without too much ugly code.

Re: Mojo – a new programming language for AI developers

#17
post #2

Well, I'm blown away. If this succeeds, it will allow you to use Python for the entire AI stack: high-level model composition (as usual), fast compiled CPU code (instead of, say, libs written with C++), and on-device operations (instead of, say, libs that use CUDA). Oh, and it will make your Python code parallel (i.e., there's no GIL). Obviously, we'll have to wait until Mojo is production-ready, but I'm excited afte…

This isn’t Python though, right? It’s just a Python-like syntax for a much lower level programming language (sort of like Cython) from my cursory glance? It seems a lot like Rust with a Pythonic veneer, so I would expect it will run into many of the same problems that Rust has (lots of difficulty pacifying the borrow checker)?

Re: Mojo – a new programming language for AI developers

#19
Swift already imported Python code in a similar fashion. Feels like this is a more Pythonic syntax for Swift and likely carries over all the underlying goodness.

[FWIW, folks waiting for this should also look at Cython, which is different, but uses Pythonic syntax for more of a C-like semantics.]

Re: Mojo – a new programming language for AI developers

#20
There are a bunch of questions about Julia, so I'll do my best to give a short answer to a very long and complicated topic. Up front, Julia is a wonderful language and a wonderful community, I am a super fan.

That said, Mojo is a completely different thing. It is aligned with the Python community to solve specific problems outlined here: https://docs.modular.com/mojo/why-mojo.html

Mojo also has a bunch of technical advancements compared to Julia by virtue of it being a much newer development and being able to learn from it (and Swift and Rust, and C++ and many many other languages). Including things like ownership and no GC. We also think there is room for a new language that is easier to deploy, scales down to small envelopes, works directly with the full Python ecosystem, is designed for ML and for MLIR from first principles, etc.

Julia is far more mature and advanced in many ways. Many folks have and will continue to push Julia forward and we wish them the best, it is a lovely ecosystem and language. There is room for more than one thing! :)

EDIT: Just in case there is any confusion, I work for Modular, built LLVM, Swift, Clang, MLIR and a variety of other things. I wasn't trying to misrepresent as being unaffiliated.

Post reply on HN