as well as Kernel Bench in Wild , KBWv2, which is second version of Wild Kernel Bench...
NewKernelBench is a benchmark and diagnosis workspace for LLM-driven kernel generation. It starts from the original KernelBench task set, adds a richer planning layer, and pushes toward a more realistic evaluation loop for real workloads.
NewKernelBench adds several things that the original benchmark does not organize as first-class concepts:
- multi-axis task planning instead of level-only grouping
- dtype-aware variants, including
fp32,fp16,bf16, and selectedint8cases - layout-aware variants, including contiguous, channels-last, transposed, and non-contiguous cases
- execution-mode variants: forward, backward, and forward-plus-backward
- tiered analysis planning so heavy profiling is only used when justified
- unified result bundles for correctness, gradient correctness, speedup, and failure taxonomy
- manual harvesting scripts for expanding the benchmark from mainstream libraries
- manual profiling scripts for
torch.profiler, CUDA memory, andncu - a full runner that executes a seed task and a candidate implementation under a chosen variant configuration
NewKernelBench/
docs/
architecture.md
encoding.md
harvesting.md
performance-tools.md
verification-2026-04-17.md
adr/
plans/
examples/
candidates/
scripts/
bootstrap_from_kernelbench.py
check_encoding.py
harvest_library_candidates.py
manual_profile_demo.py
ncu_profile_task.py
preview_benchmark.py
run_candidate_benchmark.py
smoke_runtime_validation.py
src/newkernelbench/
analysis_plan.py
candidate_loader.py
catalog.py
evaluator.py
kernelbench_adapter.py
planner.py
report.py
schema.py
task_loader.py
taxonomy.py
variants.py
configs/
results/
profile_runs/
All text files in this project should use UTF-8:
- markdown
- python
- json
- toml
The project includes:
.editorconfigwithcharset = utf-8docs/encoding.mdscripts/check_encoding.py
Check encoding with:
python scripts/check_encoding.pycd /supercloud/llm-code/mkl/project/clang/KernelGen/NewKernelBench
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/bootstrap_from_kernelbench.py --kernelbench-root ../KernelBench/KernelBench --output configs/starter_manifest.json
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/preview_benchmark.py --manifest configs/starter_manifest.json --show-tasks 5Example for operator-style harvesting:
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/harvest_library_candidates.py --module torch.nn --limit 80 --output configs/harvest_torch_nn.jsonExample for model- or block-style harvesting:
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/harvest_library_candidates.py --module transformers.models.bert.modeling_bert --limit 40 --output configs/harvest_bert_modeling.jsonThese harvest outputs are intended for manual review. They help you decide which operators, blocks, or model components should become new seed tasks.
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/manual_profile_demo.py --task ../KernelBench/KernelBench/level1/19_ReLU.py --tool all --output-dir profile_runs/relu_demoThis writes:
summary.jsontorch_profiler.txtcuda_memory.json- an
ncucommand you can run manually or trigger from the same script
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/run_candidate_benchmark.py --task ../KernelBench/KernelBench/level1/1_Square_matrix_multiplication_.py --candidate examples/candidates/1_square_matmul_modelnew.py --mode forward_backward --with-compile-baseline --output results/matmul_demo.jsonA second example with parameters and channels-last layout:
CUDA_VISIBLE_DEVICES=1 conda run -n aikg python scripts/run_candidate_benchmark.py --task ../KernelBench/KernelBench/level2/1_Conv2D_ReLU_BiasAdd.py --candidate examples/candidates/1_conv2d_relu_biasadd_modelnew.py --layout channels_last --mode forward_backward --output results/conv_demo.jsonThe full runner now covers the core loop that was missing before:
- load a real seed task from the original
KernelBench - apply variant settings for device, dtype, layout, and execution mode
- load a candidate implementation from a Python file
- attempt weight synchronization from the reference model when possible
- evaluate correctness and input-gradient correctness
- measure speedup versus eager and optionally versus
torch.compile - save a UTF-8 result bundle plus profiler artifacts
The current verified items include:
- UTF-8 repair for the paper summary markdown in both local Windows and remote Linux copies
- UTF-8 validation across
NewKernelBench - manifest generation for all 250 original seed tasks and 9494 planned variants
- smoke validation for forward and backward execution paths
- manual profiling with
torch.profilerand CUDA memory stats ncuinvocation path prepared and tested- full runner executed successfully on:
- matmul candidate demo
- conv-plus-relu-plus-bias candidate demo
See docs/verification-2026-04-17.md for details.
ncu is installed on the machine, but the current user does not have permission to access GPU performance counters. The prepared command path works, but the profiler returns ERR_NVGPUCTRPERM until the system-side counter permission is enabled.
The next useful step is to extend the full runner so it can ingest batches of candidate files, run multiple variants automatically, and emit aggregated summaries on top of the per-run JSON bundles.