# Hand written kernels in MAX

**URL:** https://forum.modular.com/t/hand-written-kernels-in-max/118
**Category:** MAX
**Tags:** discussion
**Created:** [December 9, 2024, 8:36pm UTC](https://forum.modular.com/t/hand-written-kernels-in-max/118 "2024-12-09T20:36:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sarthak](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Sarthak](https://forum.modular.com/u/Sarthak)
#### Post date: [December 9, 2024, 8:36pm UTC](https://forum.modular.com/t/hand-written-kernels-in-max/118/1 "2024-12-09T20:36:30Z")

</div>

Hi, I’m curious about the implementation details of the MAX engine in Mojo. In your compilation pipeline, do you rely on pre-written libraries or hand-written kernels (like Torch Inductor or TensorRT), or is the approach entirely focused on code generation and transformation, using MLIR passes to ensure performance and portability across hardware?

---

<div class="post-metadata">

### Author: ![clattner](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/clattner/32/201_2.png) [@clattner](https://forum.modular.com/u/clattner)
#### Post date: [December 9, 2024, 11:37pm UTC](https://forum.modular.com/t/hand-written-kernels-in-max/118/2 "2024-12-09T23:37:50Z")

</div>

Hi Sarthak,

If you’re interested in implementation details, I’d check out some of the technical talks on [the Modular blog](https://www.modular.com/blog), e.g. the [LLVM DevMtg talk](https://www.modular.com/blog/mojo-llvm-2023) from a year ago.

To answer the question in a short way: our approach is based on hand-written kernels (more similar to triton lang) with a very fancy set of compiler and runtime technologies that include automatic fusion and memory planning etc, that benefit from being able to see into the IR representation of those kernels. This is a novel approach, that moves forward from the “put everything into the compiler” or “use vendor libraries” approach, and is uniquely extensible.

We are working on releasing our GPU support soon, and that does NOT use NVIDIA libraries like cudnn and cublas. We (intentionally) haven’t explained all of this yet, but will be sharing more as it becomes generally available.

-Chris

---

<div class="post-metadata">

### Author: ![philbutler](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@philbutler](https://forum.modular.com/u/philbutler)
#### Post date: [December 10, 2024, 5:08am UTC](https://forum.modular.com/t/hand-written-kernels-in-max/118/3 "2024-12-10T05:08:55Z")

</div>

I’m rooting for y’all, we can’t wait!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)
#### Post date: [June 8, 2025, 5:09am UTC](https://forum.modular.com/t/hand-written-kernels-in-max/118/4 "2025-06-08T05:09:05Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
