Config parameters#
Each task’s config.yaml sets how KernelFoundry runs it. This page covers the parameters worth
knowing, grouped by section.
The Required and Common top-level parameters below are all most users need. The later sections (evaluation, inference, prompt, evolutionary database) are reference for tuning.
KernelFoundry uses Hydra for hierarchical configuration, so parameters are
grouped into topical sections. Anything you set in a task’s config.yaml is merged over the
defaults in
kernelfoundry/configs/run.yaml,
which is the authoritative list.
Important
A task config.yaml may only set keys that already exist in kernelfoundry/configs/run.yaml. Anything else
aborts the run with ConfigKeyError: Key '<name>' is not in struct. This is deliberate: it
catches typos rather than silently ignoring them.
Every parameter can also be overridden on the command line:
python -m kernelfoundry.algorithm run task=tasks/example_custom task_origin=custom \
job_name=my_job gpu_arch=lnl language=SYCL max_iters=10
Required parameters#
Parameter |
Type |
Description |
|---|---|---|
|
string |
Name for the operation the kernel implements, e.g. |
|
string |
Name for one execution of the algorithm. Appears in the UI. |
|
string |
The task package to run: a directory, tar archive or zip file. |
|
string |
Where the task comes from. Use |
task_name and job_name have no defaults at all; a run that omits either aborts immediately.
Common top-level parameters#
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
string |
Kernel language, which determines the compiler and profiler used. One of |
inferred |
|
string |
Architecture to benchmark on. Intel: |
inferred |
|
int |
Maximum optimization iterations. |
|
|
int |
Kernels generated per iteration (LLM calls). Above 1 this enables evolutionary search: a parent kernel is sampled and multiple branches explored. At 1 the algorithm simply improves the previous kernel. |
|
|
bool |
Stop as soon as a correct kernel is found. Useful for pure translation tasks. |
|
|
int |
Compilation timeout, seconds. Raise if you see build timeouts. |
|
|
int |
Timeout for execution, correctness testing, benchmarking and profiling, seconds. Raise if tests load models or data. |
|
|
bool |
Whether to test and benchmark the reference. Needed to compute speedup; set false only if the reference exists for the prompt but is not executable. |
|
|
bool |
Whether the task has a |
|
|
bool |
Whether the reference needs building. False when the reference is e.g. PyTorch. |
|
|
bool |
Use a second LLM to summarize evaluation logs such as compile errors before feeding them back. |
|
|
bool |
Start from the best kernel recorded for this |
|
|
bool |
Evaluate the kernel currently in the evolve block. Combine with |
|
There is no evolve_mode parameter; evolutionary search is derived from
branches_per_iteration > 1.
Hierarchical structure#
Sections nest under a top-level key:
prompt:
reference_language: SYCL
inference:
servers:
- _target_: kernelfoundry.algorithm.inference_server.InferenceServer
server_type: openai
model_name: gpt-5
temperature: 0.3
eval_config:
warmup_min_time: 0.1
profile_original_model: false
That config tells the prompt the reference is SYCL, generates with one OpenAI model at
temperature 0.3, and benchmarks with a 0.1 s warmup. Lists are written with dashes, and inference
takes several servers to form an ensemble.
Task hyperparameters (hyperparameters)#
Values your own task needs, passed through untouched. KernelFoundry does not interpret them;
it only delivers them to your build function and your tests, so you can vary a tile size or a
problem shape from config.yaml instead of editing task.py.
hyperparameters:
buildtime:
tile_size: 32
runtime:
batch_size: 8
buildtime is expanded as keyword arguments into your task’s build function, alongside the
gpu_arch it always receives. The example above calls build(gpu_arch=..., tile_size=32), so
every key must be a parameter that function accepts. An unexpected one raises TypeError.
runtime is JSON-encoded and handed to pytest as --runtime_params. Read it in a test with:
import json
def test_something(self, request):
params = json.loads(request.config.getoption("--runtime_params") or "{}")
batch_size = params.get("batch_size", 1)
For a value needed at collection time, in a @pytest.mark.skipif condition for example, the
argument is not yet parsed, so use kernelfoundry.conftest.get_runtime_params_from_argv()
instead, which reads it straight from sys.argv.
Both default to null, and both are recorded with the run so a result can be traced back to
the values that produced it.
Evaluation (eval_config)#
Controls how a candidate is measured.
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
int |
Timed trials used for the runtime measurement. |
|
|
int |
Minimum warmup iterations before timing. |
|
|
float |
Minimum warmup duration, seconds. |
|
|
float |
A kernel pass must take at least this long, so synchronization overhead does not dominate. |
|
|
bool |
Also profile the reference, not just the candidate. |
|
|
int |
Iterations used when profiling. |
|
|
bool |
Verbose evaluation logging. |
|
Profiler selection is top-level. Leaving these null picks the language default: SYCL uses unitrace, OCL uses VTune, CUDA uses ncu:
profiler_kernel: vtune
profiler_reference: vtune
LLM inference (inference)#
Configures the model used for generation. The open-source InferenceServer supports
server_type: openai and server_type: anthropic, reading OPENAI_API_KEY or
ANTHROPIC_API_KEY from the environment respectively. Any OpenAI-compatible endpoint can be
targeted by setting base_url.
Each server accepts:
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
string |
|
— |
|
string |
Model identifier. |
|
|
int |
Maximum tokens to generate. |
|
|
float |
Sampling temperature; |
|
|
int |
Completions per call. Requires |
|
|
int |
Request timeout, seconds. Raise if you hit inference timeouts. |
|
|
bool |
Log inference details. |
|
Ready-made variants live in
kernelfoundry/configs/inference/:
server.yaml for a single model, ensemble.yaml for several.
Any model your provider offers works; model_name is passed straight through, so there is no
list to keep in step with provider catalogues. The DEFAULT_MODELS table at the top of
inference_server.py
is only the fallback consulted when model_name is left as default; it is not a validation
list.
Prompt (prompt)#
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
string |
Language the reference is written in. |
|
|
int |
High-level optimization strategies sampled into the prompt. |
|
|
bool |
Include prior generated kernels as inspiration. Only meaningful when evolutionary search is active. |
|
|
bool |
Include the best kernel so far for reference. Only meaningful when evolutionary search is active. |
|
|
bool |
Include target hardware specifications. |
|
|
bool |
Let the model write templated kernels with multiple parameter options; all options get benchmarked. Only SYCL and CUDA ship the worked example this requires; enabling it for |
|
Evolutionary database (database)#
Active when branches_per_iteration > 1. Tunes the MAP-Elites quality-diversity search.
branches_per_iteration: 3
database:
config:
exploration_ratio: 0.3
num_top_programs: 2
Parameter |
Type |
Description |
Default |
|---|---|---|---|
|
int |
Top-performing programs included in the prompt. |
|
|
int |
Diverse programs included in the prompt. |
|
|
int |
Inspiration examples drawn from the archive. |
|
|
int |
Total population. |
|
|
int |
Size of the elite archive. |
|
|
int |
Evolutionary islands, for maintaining diversity. |
|
|
int |
Programs per island before switching. |
|
|
float |
Fraction selected as elites. |
|
|
float |
Exploration versus exploitation balance. |
|
Defaults for every field are in
kernelfoundry/configs/database/evolve_db_optimization_aware.yaml.
For the strategies these parameters serve, see Optimization strategies.