This section answers common questions about KernelGenBench.
A: Python 3.10 or higher is required.
A: No, KernelGenBench requires GPU hardware for kernel verification. The generated Triton kernels must be executed on actual GPU hardware.
A: vLLM is designed for NVIDIA GPUs. On non-NVIDIA platforms, torch and triton are pre-installed in vendor container images. Do NOT install vLLM on these platforms — the ATen dataset is automatically used instead.
A: Run npm install -g @anthropic-ai/claude-code. You'll also need an Anthropic API key set via export ANTHROPIC_API_KEY=your_key.
A:
- LLM Track: Tests direct kernel generation without execution feedback. Lower cost, suitable for comparing base model capabilities.
- Agent Track: Tests iterative generation with execution feedback. Higher cost but better results, suitable for production-ready kernel generation.
A: Use the --op-name parameter:
# LLM Track
python scripts/generate_kernel_and_verify.py --op-name aten::add --single-test
# Agent Track
cd agent_bench && bash test_ops.sh add --device-count 1A:
- NVIDIA GPUs: Use
KernelGenBench(210 operators) for full evaluation - Non-NVIDIA platforms: Use
KernelGenBench-aten(110 operators), which is auto-selected - Specific focus: Use
KernelGenBench-vllmfor inference kernels orKernelGenBench-cublasfor linear algebra
A:
- LLM Track (Pass@5, 210 operators): ~6-12 hours depending on model and hardware
- Agent Track (Claude Code, 210 operators): ~24-48 hours depending on operator complexity
A:
- Use
--debugmode (only 8 operators) for testing - Increase
--device-countfor parallel verification - Use smaller datasets (
KernelGenBench-ateninstead of full) - Use LLM Track instead of Agent Track
A: Accuracy is the percentage of operators where at least one generated kernel passes all test cases and anti-hack checks.
A: Speedup is the geometric mean of (generated kernel time / baseline time). A speedup > 1.0× means the generated kernel is faster than the baseline.
A: Generated kernels may not always outperform optimized baselines. This is expected, especially for:
- cuBLAS operators (highly optimized over decades)
- Complex vLLM operators
- Operators on immature non-NVIDIA platforms
A:
- LLM Track:
output/pass_at_k/<timestamp>/ - Agent Track:
agent_bench/runs/<method>_<dataset>_<timestamp>/
A: Reduce --device-count or use smaller batch sizes. Some operators require significant GPU memory.
A: Common reasons:
- Numerical precision mismatch (tolerance too strict)
- Edge cases not handled in kernel logic
- Memory access violations
- Shape/dtype mismatches
A: The generated kernel may be calling blacklisted APIs instead of implementing the actual computation. Check the kernel code for:
- Direct calls to
torch.ops.aten.* - Imports of
vllmorctypes - Any bypass of Triton computation
A: Install Ascend dependencies and run in the vendor container image:
pip install -r requirements/requirements_ascend.txt
pip install -e .
# Framework will auto-detect Ascend hardwareA: Non-NVIDIA platforms have:
- Less mature Triton compilers
- Incomplete backend support
- Different memory models
- Different performance characteristics
This is expected and demonstrates the cross-platform portability challenge.
A: Yes, you can extend KernelGenBench for new platforms by:
- Adding device detection in
src/runtime/ - Creating platform-specific templates in
agent_bench/templates/ - Adding platform-specific tolerances
A: Costs depend on:
- Method (Pass@1 < Pass@5 < Claude Code < AKO4ALL)
- Number of operators
- Model choice
For reference, the full KernelGenBench evaluation consumed 15+ billion tokens.
A: Start with --debug mode (8 operators) to measure token consumption per operator, then extrapolate.
A: See CONTRIBUTING.md for detailed instructions on adding test cases.
A: Create a new directory in agent_bench/methods/ following the existing structure.