Introducing MLIR playground

Hello everyone,

In the past few months folks in the MLIR China community has been working on a project to make experiencing and sharing MLIR developments easier. Instead of going through the CMake flow locally, the aim is to put everything in a web browser page and let developers only focus on patterns and their inputs/outputs far fast iterations. This is expected to lower barriers for folks new to MLIR and also make sharing runnable code snippets during discussions easier.

Now the first version is fully functional and oneline at playground.mlir-china.org! Please feel free to give it a try and feedback welcome! :slight_smile: You can also run it via Docker as docker run -d -p 3000:3000 mlirchina/mlir-playground.

The project draws idea from Compiler Explorer and OpenAI playgrounds, following the trend of leveraging web technology to boost collaboration efficiency and lower entrance barriers. In this first version (for testing the possibility), the whole stack is compiled to WebAssembly and run locally with the browser. For more technical details, see the source code repo.

Code snippet sharing is a planned feature. There are also other cool features we can add there, like supporting writing patterns using transform dialects. Feel free to create feature requests in the source repo and so stay tuned!

16 Likes

I love this

2 Likes

Nice! I hope we have a similar tool for LLVM (passes) as well

1 Like

Thanks @antiagainst for posting this! Yeah, the key motivation for MLIR-Playground is providing a common media for people to debate on technical details. I recall that when I started the MLIR journey, the highlevel idea was very fascinating, but turning that highlevel idea into a concrete mental model took me quite a while. If it was not the friendly help from the community, the journey could be much tougher to me. I still remember the first time when I reached out to @stellaraccident and @mehdi_amini out of blue for help on converting XLA-HLO to MLIR-HLO, they gave me an interesting off label usage of IREE that I could never think of on my own. That’s why we created this tool to contribute back to the community, hoping it can enable some more efficient technical debates and lower the barrier for people to tryout new CPP features in the MLIR library without going through the CMake config hell first.

That sounds like a very cool idea! Maybe this script could be helpful of setting up the WASM build process for LLVM passes. mlir-playground/build-compiler-in-docker.sh at main · MLIR-China/mlir-playground · GitHub

1 Like