OpenBMB/ForgeKernel
Machine LearningSelf-evolving GPU kernel agent that optimizes kernels against a reference and evolves them generation by generation.
What it does
ForgeKernel targets the slow, expert-heavy work of writing high-performance GPU kernels. Starting from a reference kernel, it runs, times and profiles that reference, then distills the result into an architecture-first curriculum split into milestones. An architecture agent (the teacher) fixes kernel split, tile shapes, warp roles and register/shared-memory budgets in milestone M0; a coding agent (the student) implements decisions inside that structure while GPU jobs judge correctness, speed and profiling. Accepted kernels are promoted to become the next reference, and hardware mechanisms certified by GPU probes accumulate in a per-architecture knowledge base (hw_kb/). Typical users are performance engineers and researchers working on NVIDIA Hopper or Blackwell accelerators, not general Python developers.
Quick start
You need a Linux or macOS control machine with Python ≥ 3.11, git and the Claude Code CLI (logged in or with ANTHROPIC_API_KEY), plus a Hopper sm90 or Blackwell sm100 GPU machine with a CUDA build of PyTorch. nvidia-cutlass-dsl is recommended for CuTe DSL tasks, and Nsight Compute is optional.
cd ForgeKernel
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
pip install nvidia-cutlass-dsl
forge --version # forgekernel 0.1.0
Then copy local.env.example to local.env and choose FK_DELIVERY=local or ssh with REMOTE_HOST/REMOTE_WORKDIR. Run the bundled RMSNorm task:
forge new tasks/rmsnorm --dry-run # validate and print the plan
forge new tasks/rmsnorm # creates .artifacts/rmsnorm_<id>
tmux new -s forge 'forge run .artifacts/rmsnorm_<id>'
forge status .artifacts/rmsnorm_<id>
A run writes report.md and best/kernel.py under the artifact directory. The documented B200 example stopped at 5.2× the PyTorch reference after about 1.5 hours. forge run exits 0 on reaching its target and 2 otherwise. The full launch reference is in docs/design/v1-launch.md; the setup instructions are in the README quick start.
Task authoring and self-evolution
forge init <op> copies tasks/_template/; you fill description.md, shapes.json and task.toml. The presence of a reference block selects source, blackbox, generate or leaderboard mode. Defaults target 1.2× device time, a 4-hour loop and 3 teacher rounds. To chain generations, run python scripts/self_evolve.py tasks/<op> [--step 1.05] [--max-gen N], which creates tasks/<op>-g<k>/ with the previous best kernel as reference; the chain stops at the noise floor or without a confirmed best.
Constraints
- GPU support is limited to NVIDIA Hopper and Blackwell; four operator families were exercised in the paper.
- The agent still needs frontier-model API access and per-run hours of GPU time, with permissions bypassed inside a driver-written policy — use a dedicated machine.
- A reference implementation helps most; the paper's ablation stalls without one.
- Self-evolution stopping on the noise floor is an estimate, not proof that no improvement exists.
- The code is Apache-2.0; the leaderboard evaluator adapts FlashInfer-Bench and SOL-ExecBench code, documented in NOTICE.
HotRepo's take
The repository first appeared on HotRepo's Python new-project list on 2026-11-03, reporting 60 stars and 7 forks gained over a roughly 24-hour window from 2026-11-02 to 2026-11-03. The 8-day star curve rose from 103 on 2026-10-31 to 202, with a steep step from 172 to 200 around 2026-11-03 01:45–03:45 UTC. No all-language daily rank was recorded, so the observed traction is within the Python new-project pool rather than a broader ranking. The README's leaderboard claims (FlashInfer-Bench, CANN-Bench) are author-stated and not independently verified in this data; the practical evidence readers can check is the released kernels/ directory and the generation script.
Written by AI from the project's README, updated . The project's own docs are the source of truth.