This directory contains the backend generation, optimization, and benchmarking logic.
src/
├── generator/ # Kernel generation + correctness validation
│ ├── main.py # Generator entrypoint (operator-level)
│ ├── generator.py # LLM interaction and code extraction
│ └── prompts/ # Prompt templates/system prompts
├── optimizer/
│ ├── workflow.py # Canonical orchestration CLI (profile/generate/optimize/benchmark)
│ ├── pipeline.py # Optimization pipeline (MCTS-driven)
│ ├── benchmarking/ # Baseline + optimized benchmarking pipeline
│ ├── core/ # MCTS core types/logic
│ └── backends/ # CUDA and Triton backend abstractions (Metal is a skeleton)
└── progress.py # Job progress + pause/cancel helpers via state.json
python -m src.optimizer.workflow <action> [flags]Actions:
profilegenerateoptimizebenchmark
src.generator.main is called by workflow for generation.
src.optimizer.pipeline is called by workflow for optimization.
profile: captures operator data and baseline benchmark artifacts.generate: runs per-operator generation, verifies success markers, then optionally optimize+benchmark.optimize: runs optimization by operator, optionally benchmark.benchmark: rebuildsop_benchmarks.jsonfrom current project outputs.
kernels/projects/<project_name>/...
Key files:
state.jsonio/summary.jsonkernels/generated/individual_op_kernels/<op>/trees/<op>/benchmarks/op_benchmarks.json