Add a task in AgentKernelArena#
2026-07-21
4 min read time
A task is a single GPU kernel optimization problem. Each task lives below its
task-type directory and is described by a config.yaml. Optional suite and
difficulty directories can appear between the task type and task name, for
example tasks/triton2triton/rocmbench/hard/gemm/.
Task types#
The task_type field declares what kind of optimization the task represents.
|
Meaning |
|---|---|
|
Optimize an existing HIP kernel |
|
Port and optimize a CUDA kernel to HIP |
|
Optimize an existing Triton kernel |
|
Write a Triton kernel from an instruction/spec |
|
Replace a PyTorch reference with a HIP kernel |
|
Replace a PyTorch reference with a FlyDSL kernel |
|
Translate a Triton kernel to FlyDSL |
|
Optimize a FlyDSL kernel (requires FlyDSL) |
|
Repository-level task |
The repository ships task suites including hip2hip (gpumode and others),
triton2triton (vLLM and ROCmBench), torch2hip, instruction2triton,
torch2flydsl, triton2flydsl, and flydsl2flydsl, plus repository-level
tasks under tasks/repository/.
Directory layout#
tasks/<task_type>/[<suite>/...]/<task_name>/
├── config.yaml # Task configuration (required)
├── scripts/
│ └── task_runner.py # Compile/correctness/performance runner (recommended)
└── source/ # or src/
└── <kernel files> # .cu, .hip, .py, etc.
Makefile-based or test-file-based layouts are also acceptable, as long as every
path referenced in config.yaml resolves inside the task directory.
Required config.yaml fields#
Most tasks optimize files that are copied into the task workspace. For those isolated-kernel tasks, all command fields are lists, even when there’s a single command.
# Source files containing the kernel code (relative to the task root)
source_file_path:
- source/my_kernel.hip
# Kernel function names that must be defined in the source files
target_kernel_functions:
- my_kernel_function
# Command(s) to compile or build-check the task
compile_command:
- python3 scripts/task_runner.py --mode compile
# Command(s) to run correctness validation
correctness_command:
- python3 scripts/task_runner.py --mode correctness
# One of: hip2hip, cuda2hip, triton2triton, triton2flydsl,
# instruction2triton, torch2hip, torch2flydsl,
# flydsl2flydsl, repository
task_type: hip2hip
Repository-level tasks (task_type: repository) use a different shape because
they clone and optimize an upstream project rather than a small source bundle.
They require repo_url, repository_language, compile_command, and
correctness_command; source_file_path and target_kernel_functions are
optional hints when the target files and symbols are known.
repo_url: https://github.com/ROCm/rocPRIM.git
# repo_subdir: rocPRIM # optional; defaults from repo_url
task_type: repository
repository_language: hip
compile_command:
- python3 scripts/task_runner.py compile
correctness_command:
- python3 scripts/task_runner.py correctness
Optional config.yaml fields#
# Command(s) to measure performance
performance_command:
- python3 scripts/task_runner.py --mode performance
# Optional per-command limits in seconds (framework defaults are 3600).
compile_timeout: 3600
correctness_timeout: 3600
performance_timeout: 3600
# Legacy compatibility only; the centralized evaluator always writes the
# standard task_result.yaml schema.
task_result_template: null
# Prompt overrides for the optimization agent (null = auto-generated)
prompt:
source_code: null # override the default source-code section
instructions: null # custom instructions
cheatsheet: null # reference/cheatsheet content
# Optional platform gate. Omit this block for tasks that run everywhere.
platform_support:
required_arch: gfx942 # compared with the detected GPU architecture
status: active # active | skip
skip_reason: null # recommended when status is skip
Some specialized launchers and task runners use additional fields such as
harness_path or target_file_path. Document those fields with the task or
agent that consumes them; they are not part of the common evaluator schema.
Tasks with platform_support.status: skip, or with a required_arch that does
not match the current run, are skipped before workspace creation. Historical
per-suite fields such as runnable_on_gfx942 are documentation only.
Performance helper stubs#
The shared performance timing helpers are generated from src/tools/perf/ into each
run workspace. In committed task sources:
tasks/*/rocmbench/**/performance_utils_pytest.pyis intentionally a stub.The
AKA-GENERATEDregion intriton2triton/vllm/*/scripts/task_runner.pyis intentionally a stub block.
Do not hand-edit those stubs. If a task needs shared timing behavior, add the
stub/marker and run make sync-perf-helpers. If you need to change timing logic,
edit the canonical file in src/tools/perf/ and run make check-perf-helpers
before pushing. To inspect a task with the real helpers injected, run
make materialize-perf-task TASK=tasks/....
Validate before merging#
Every new task must pass the task_validator agent before it’s merged. It
runs 10 automated checks and emits a validation_report.yaml. See
Validate tasks for the full check list and how to run it.