Next-Gen GPU Programming: Hands-On with Mojo and Max Modular HQ
44 points by solarmist 2 months ago | 21 comments- diabllicseagull 2 months agoIt is a noble cause. I've spent ten years of my life using CUDA professionally, outside the AI domain mind you. Most of these years, there was a strong desire to break off of CUDA and the associated Nvidia tax on our customers. But one thing we didn't want was to move from depending on CUDA to depending on another intermediary which would also mean financial drain, like the enterprise licensing these folks want to use. Sadly, open source alternatives weren't fostering much confidence, either with their limited feature coverage or just not knowing if they will be supported in the long term (support for new hardware, fixes, etc.).
- pjmlp 2 months agoAlso while as language nerd I find Mojo cool, given NVidia's going full speed ahead with Python support in CUDA as announced at GTC 2025, to the point of designing a new IR as basis for their JIT, very few researchers will bother with Mojo.
Also what NVIDIA is doing has full Windows support, while Mojo support still isn't there, other than having to make use of WSL.
- melodyogonna 2 months agoWhy? Will the new Nvidia Python stuff work on AMD GPU and other non-nvidia accelerators?
- pjmlp 2 months agoIt still remains to be seen how much that will happen to Mojo and MAX, while most researchers are using CUDA anyway, and best of all, it works on their laptops, which cannot be said for AMD GPU and other non-nvidia accelerators.
Naturally assuming they are using laptops with NVidia GPUs.
- pjmlp 2 months ago
- melodyogonna 2 months ago
- pjmlp 2 months ago
- solarmist 2 months agoI'm really hoping Modular.ai takes off. GPU programming seems like a nightmare, I'm not surprised they felt the need to build an entire new language to tackle that bog.
- pjmlp 2 months agoThere are already plenty of languages in CUDA world, that is one reasons it is favoured.
The problem isn't the language, rather how to design the data structures and algorithms for GPUs.
- melodyogonna 2 months agoYes, the problem isn't language, it is the entire stack. I think people focus too much on Mojo while ignoring the actual solution Modular has built, which is MAX. The main idea here is that MAX provides a consistent API for both library authors (e.g vLLM, Ollama) to target, as well as for hardware vendors to integrate with - so similar to LLVM.
Basically, imagine if you can target Cuda, but you don't have to do too much for your inference to also work on other GPU Vendors e.g AMD, Intel, Apple. All with performance matching or surpassing what the hardware vendors themselves can come up with.
Mojo comes into the picture because you can program Max with it, create custom kernels that is JIT compiled to the right vendor code at rumtime.
- solarmist 2 months agoNot sure I fully understand your comment, but I'm pretty sure the talk addresses exactly that.
The primitives and pre-coded kernels provided by CUDA (it solves for the most common scenarios first and foremost) is what's holding things back and in order to get those algorithms and data structures down to the hardware level you need something flexible that can talk directly to the hardware.
- pjmlp 2 months agoC, C++, Fortran, Python JIT from NVidia, plus Haskell, .NET, Java, Futuhark, Julia from third parties, and anything else that can bother to create a backend targeting PTX, NVVM IR, or now cuTile.
The pre-coded kernels help a lot, but you don't have to use them necessarly.
- pjmlp 2 months ago
- melodyogonna 2 months ago
- mirsadm 2 months agoGPU programming isn't really that bad. I am a bit skeptical this is the way to solve it. The issue is that details do matter when you're writing stuff on the GPU. How much shared memory are you using? How is it scheduled? Is it better to inline or run multiple passes etc. Halide is the closest I think.
- solarmist 2 months agoWhat are you skeptical of? I believe the problem this is solving is a framework that's not CUDA that allows low level access to the hardware, makes it easy to write kernels, and is not Nvidia only. If you watch the video you can write directly in asm if you need to. You have full control if you want it. But it provides primitives and higher level objects that handle common cases.
I'm a novice in the area, but Chris is well respected in this area and cares a lot of about performance.
- varelse 2 months ago[dead]
- solarmist 2 months ago
- pjmlp 2 months ago
- throwaway314155 2 months agoThey desperately need to disable whatever noise cancellation they're using on the audio. Keeps cutting out, sounds terrible.
- catapart 2 months agoMy mistake completely, but I thought this was going to be something to do with a new scheme or re-thinking of graphics programming APIs, like Metal, Vulkan or OpenGL. Now I'm kind of bummed that it is what it is, because I got really excited for it to be that other thing. =(
- ashvardanian 2 months agoThere is a "hush-hush open secret" between minutes 31 and 33 of the video :)
- refulgentis 2 months agoTL;Dr same binary runs on Nvidia and ATI today, but not announced yet
- refulgentis 2 months ago
- Archit3ch 2 months ago> Other Accelerators (e.g. Apple Silicon GPUs): free for <= 8 devices
From their license.
It's not obvious what happens when you have >8 users, with one GPU each (typical laptop users).
- threecheese 2 months agoThis is covered by ARM which they consider CPU, and doesn’t fall into that clause. IOW no restrictions.
- threecheese 2 months ago