In December, we enabled the capability for customizing Python MAX models and layers within your local modular checkout, and then using Bazel to run tests against your local changes. Over the last couple of months, we’ve significantly enhanced this capability to the point where you can now build, test, and run pretty much any kind of modification to the open source code in the modular repository.
This includes being able to customize your Mojo standard library, any Mojo kernel, Python layers, and model architectures, and then build and run that all with one Bazel command. For example, if you wanted to add support for a missing kernel for an Apple silicon or AMD RDNA GPU, you can now check out the modular repository, edit the appropriate kernel files or add entries to the Mojo standard library for your hardware, and then build and test that inside a full MAX model using a command like:
./bazelw run //max/python/max/entrypoints:pipelines -- generate --model-path Qwen/Qwen2.5-0.5B-Instruct --prompt "The sky is blue because"
This is a pretty powerful enhancement of MAX development, because you can now work on all of the open source components of the stack, from language, to kernels, to models, and see it all flow up into serving models on your hardware. This also should aid in support for new hardware. While there are still some base level parts of functionality that need compiler or other low-level modifications, there’s a lot you can do in Mojo code once the basics are there for a piece of hardware. Really excited to see what people can do with this.
These advancements are provided both through better build infrastructure in the modular repository and some structural changes in the graph compiler. The latter is worthy of a presentation all its own, but we’ll maybe talk more about that when we land some other developer-facing features from this change.