An agentic framework for converting Triton kernels to Gluon kernels and optimizing the performance based on Gluon kernels.
-
Set up AgentTemplate before using this project.
-
Clone the upstream Triton repository:
git clone git@github.com:triton-lang/triton.git
The converter agent requires access to the Triton source code to understand op semantics during conversion.
-
Create a folder containing your Triton kernel (e.g.,
./examples/01-vector-add) -
Run the tuner agent:
cd tuner codex -c model_provider="amd-openai"
Then prompt:
tune the triton kernel for ../examples/01-vector-addThe agent will ask if you want to edit
<base>-shape.jsonto customize tensor shapes before tuning. -
Run the converter agent:
cd converter codex -c model_provider="amd-openai"
Then prompt:
convert the triton kernel to gluon kernel for ../examples/01-vector-addThe agent will ask for the target architecture (e.g.,
rdna4) and the path to your Triton repository.
Tunes Triton kernel configurations for best performance. Generates shape/config JSON files and harness, then iterates on configs using IR dumps to optimize runtime.
Converts tuned Triton kernel to Gluon kernel. Uses TTGIR dumps to translate the kernel and iterates until correctness and performance targets are met.
Each agent is powered by the Codex CLI. Each subfolder represents a dedicated agent, containing an AGENTS.md file and a collection of skills.
To contribute, update the AGENTS.md file or add/update skills in the corresponding agent folder.