alibaba/atrex-kernel-agent
Tentang
An end-to-end agent project for GPU kernel implementation, analysis, profiling, and iterative optimization. It helps an agent turn PyTorch logic or an existing kernel into a high-performance GPU kernel through a structured, profile-driven workflow.
Pembelajaran mesinPertumbuhan bintang terukur
- dalam 24 jam
- +2
- dalam 7 hari
- +8
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli
GPU kernel optimization with coding agents and measured evidence
Overview
Atrex Kernel Agent (AKA) optimizes GPU kernels through an iterative loop of research, implementation, profiling, and evaluation. In the lightweight workflow, one persistent coding Session owns its Git history from the initial source onward. The Supervisor provides measured evidence, final-source policy review, private audit storage, and optional peer-history exchange; it does not install a winner or force one trajectory to follow another.
Its lightweight workflow keeps the optimization loop focused, while a plugin architecture lets users configure and replace agents, workspaces, evaluation, execution, and knowledge providers.
AKA supports Claude, Qoder, Codex, Pi, and DSH, with CUDA, Triton, CuTeDSL, FlyDSL, and TileLang tooling for supported NVIDIA, AMD, and T-Head PPU environments. Native Atrex-Bench evaluation runs through Agate or a provisioned OpenSSH GPU backend; GPU Wiki provides optimization knowledge. The Light skill provides installation and launch guidance. Observation tools report retained execution, performance and session evidence. Both are checkout resources; keep a checkout matching the installed module distributions.
How AKA works
- Prepare the initial source. Freeze evaluator inputs and create one canonical Agent Git root. The Agent decides whether to measure the initial implementation.
- Explore and measure. The Agent researches, edits, commits, and calls Runtime Evaluate/Profile/Dev/Command as needed.
- Submit a measured commit when useful.
submit-kernelrequires a saved full Evaluate whose correctness check passed and whose per-Shape performance result is complete and parseable for the exact commit, then applies the selected Fast, Performance or Ultra final-source policy. Submission imposes no performance threshold. It does not launch another Evaluate, run ABBA, promote, or roll back. - Continue in the same Session. An Episode is only an Agent-chosen audit segment; the next segment resumes the same conversation, workspace, branches, and WIP.
- Share without overwriting. Pooled trajectories exchange immutable peer Git refs, research claims, and Gateway Records. Each lineage winner and the global best are derived from accepted
submit-kernelcommits with passing full Evaluate evidence and broadcast for inspection; they never replace another trajectory's HEAD.
News
[2026-11] v0.4.1: More autonomy for coding agents. Agents keep a persistent session and control their own Git history, choosing what to explore, when to benchmark, and which measured commits to submit for review. Release notes.
[2026-10] v0.4.0: A lightweight workflow and plugin architecture. Better kernel performance with 20–30% lower average token consumption, plus configurable, replaceable providers for agents, workspaces, evaluation, execution, and knowledge. Release notes.
[2026-09] From leaderboards to real-world workloads: accelerating Qwen3.8-Max's core inference operators (WeChat): AKA delivers lower average latency than expert implementations for all three key operator families across 60 real-world shapes, with up to 1.55× speedup over production/official baselines.

[2026-09] We released Atrex Kernel Agent v0.3.0 with resumable fast, full, and goal episodes; native Atrex-Bench and multi-framework production campaigns; Claude, Qoder, Codex, and Pi backends; isolated SSH GPU execution with recovery; PPU profiling; plugin-backed GPU Wiki retrieval; and production-mode supplemental numerical probes. See the v0.3.0 release notes.
[2026-08] We slimmed down Atrex Kernel Agent by consolidating on a single orchestrated workflow and removing legacy paths and redundant context for a smaller context footprint and lower token usage.
[2026-07] We helped Qwen3.8 rank No. 1 on the SOL-ExecBench FlashInfer operator optimization leaderboard.
[2026-07] We released Atrex Kernel Agent v0.2.0 with an orchestrated clean-session loop, native SOL-ExecBench operator workflow, Triton-to-Gluon conversion support, and a fuller NVIDIA profiling toolchain. [Release]
[2026-07] We released the Atrex paper: Are LLM-Generated GPU Kernels Production-Ready? A Trace-Driven Benchmark and Optimization Agent.
[2026-06] We released Atrex Kernel Agent v0.1.0 as the initial open-source version, with the GPU Wiki knowledge base, profile-driven optimization workflow, profiling tools, and reference templates. [Release]
Quick Start
Agent-visible Agate tools default to env, evaluate, and command.
On supported backends, agents can request an ABBA comparison by passing
--baseline-commit to evaluate.
Select them with --agate-tools env evaluate command profile, or use --agate-tools all
to also expose profile, dev, check, and disassemble. This is a replacement list,
not an additive flag. Disabled tools are rejected before GPU submission. Wiki,
Direction/Experiment, and submit-kernel keep their independent configuration.
Choose one final-source policy:
- Fast:
--optimization-mode fast; the Agent chooses a DSL and may use declared, reproducible compute libraries. - Performance:
--optimization-mode performance; the Agent chooses a DSL using expert guidance, while submitted core computation must be self-authored. - Ultra:
--optimization-mode ultra --framework Cuda; submitted core computation must be self-authored in the explicitly configured DSL. Ultra rejects launch when--frameworkis absent.
Recommended: launch through a prompt. Open this repository in your coding agent and give it the operator path, target GPU, framework, and optimization budget:
Read docs/quickstart.md and set up the matching AKA packages from this checkout.
Optimize /path/to/atrex-bench/operator on a <gpu_arch> Agate worker using CUDA,
Claude as the coding agent, Ultra mode with CUDA, and up to 20 iterations.
Use ~/aka-opt as the workspace. Check the required environment, launch the
campaign, and report the verified result and output location.
Replace the example values with your workload and configured GPU environment. For a Fast run, replace the framework instruction with:
Run one Fast campaign so the Agent chooses the implementation DSL freely and may use
declared reproducible compute libraries. The persistent optimization Session starts directly
from V0 and may perform bring-up, diagnostics and optimization in any order.
See the setup guide for prerequisites and problem preparation.
Override the Agent and Reviewer model
Add --agent-model MODEL_NAME to your launch alongside the usual problem and
campaign options, for example --agent-cli codex --agent-model MODEL_NAME.
The main optimization Agent and all Reviewers use the specified model. AKA reuses the user's existing backend login, API key, provider, and endpoint configuration; no additional key is required and user configuration files are not modified. Omitting this option keeps the backend default. The launch settings retain the model across Episode resume, campaign restart, and pooled trajectories. Each backend retains its existing authentication and provider configuration. The model must be available through the configured provider.
When --agent-model is provided, startup first makes a minimal real model call
through each required backend (including the Claude Claim Reviewer when enabled).
A timeout, failed call, or missing assistant response rejects startup before
Campaign preparation or GPU work. The probe has a 120-second timeout and uses
the same Agent owner, sandbox setting, and existing credentials. It runs in a
temporary workspace, separate from optimization and Review Sessions.
Design and failure paths: model override and startup checks.
Documentation
- Documentation index — all guides and validation reports.
- Quick Start — setup, inputs, launch, and outputs.
- Architecture — ownership, lifecycle, verification, and recovery.
- Configuration — modules, profiles, and optional features.
- Source layouts — multi-file candidates and native CUDA.
- GPU Wiki — structured optimization knowledge.
- Release notes — changes and upgrade guidance.
Acknowledgements
AKA builds on and learns from many open-source projects, including:
- GPU kernel projects: CUTLASS, cutex, cuLA, FlashAttention, FlashInfer, FlyDSL, Triton, DeepGEMM, LeetCUDA, FlashMLA, Composable Kernel, cute-gemm, hpc-ops, AIter, quack, and TileLang.
- Knowledge and agent tooling: KernelWiki, modern-gpu-programming-for-mlsys, ncu-report-skill, humanize, AKO4ALL, and KDA.
Citation
If AKA is useful in your work, please cite the Atrex paper:
@misc{atrex2026,
title = {Are LLM-Generated GPU Kernels Production-Ready? A Trace-Driven Benchmark and Optimization Agent},
author = {Lingyun Yang and Yuxiao Wang and Shenghao Liang and Linfeng Yang and Daocheng Ying and Chunbo You and Rui Zhang and Luping Wang and Yinghao Yu and Guodong Yang and Liping Zhang},
year = {2026},
eprint = {2607.14541},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2607.14541}
}
License
Licensed under the Apache License 2.0.
Jelajahi proyek terkait
Memuat…