How alibaba/atrex-kernel-agent works
Atrex Kernel Agent turns an evaluator-owned operator into an optimized GPU kernel through a single orchestrated workflow: the supervisor establishes baselines, runs coding-agent episodes in isolated worktrees, checks correctness and performance, and promotes only verified candidates. Supporting branches provide sandboxed hardware execution and recovery, plugin-based GPU Wiki retrieval, and profiling tools. The README documents the workflow and capabilities; connections for unsampled subsystems are limited to documented relationships.
Main entry points: campaign.py Campaign supervisor · session.py Episode engine · sandbox.py Sandbox execution · optimize.py Optimization CLI
Components 19
Campaign supervision
- Optimization CLI
orchestrator/optimize.py - Campaign supervisor
long_horizon/campaign.py
Agent episodes
- Episode engine
long_horizon/session.py - Agent session adapter
long_horizon/main_adapter.py - Agent backends
orchestrator/agent_runtime/adapter.py - Git-isolated workspace
long_horizon/git_episode.py
Verification and policy
- Correctness evaluation
reference/atrex_bench_test_kernel.py - Candidate verification
long_horizon/verifier.py - Acceptance policy
orchestrator/optimization_policy.py - Numerical probes
long_horizon/remote_numerical.py
Execution and recovery
- Sandbox execution
tools/sandbox.py - Hardware configuration
orchestrator/hardware.py - Environment recovery
orchestrator/environment_recovery.py - Durable recovery state
orchestrator/durable_state.py
Knowledge and profiling
- Plugin runtime
plugin_runtime/registry.py - GPU Wiki plugin
plugins/gpu-wiki/adapter.py - GPU Wiki retrieval
gpu-wiki/tools/query_nl.py - GPU profiling tools
tools/ncu_helpers
Other components
- Operator owner
Connections 18
- Operator owner → Optimization CLI: starts task
README.md - Optimization CLI → Campaign supervisor: starts campaign
README.md - Campaign supervisor → Episode engine: runs episodes
README.md - Episode engine → Agent session adapter: runs session
long_horizon/session.py - Agent session adapter → Agent backends: normalizes output
long_horizon/main_adapter.py - Episode engine → Git-isolated workspace: uses worktree
long_horizon/campaign.py - Campaign supervisor → Correctness evaluation: checks candidate
README.md - Campaign supervisor → Candidate verification: verifies performance
README.md - Campaign supervisor → Acceptance policy: enforces acceptance
README.md - Campaign supervisor → Numerical probes: runs probes
README.md - Episode engine → Sandbox execution: executes isolated
README.md - Sandbox execution → Hardware configuration: targets hardware
README.md - Sandbox execution → Environment recovery: reports failures
README.md - Environment recovery → Durable recovery state: persists handoff
orchestrator/environment_recovery.py - Campaign supervisor → Plugin runtime: loads plugins
README.md - Plugin runtime → GPU Wiki plugin: registers adapter
- GPU Wiki plugin → GPU Wiki retrieval: queries knowledge
- Campaign supervisor → GPU profiling tools: profiles kernels
README.md