Thanks for your interest in contributing. This document covers how to get set up, what areas need work, and how to submit changes.
Prerequisites: Python 3.12+, a CUDA-capable GPU (or SSH access to one), and an LLM API key (Anthropic, OpenAI, or Google).
git clone https://github.com/TheJoshBrod/KernelForge.git
cd KernelForge
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd frontend
jac install
jac start main.jacSee docs/requirements.md for the full list of system dependencies including CUDA Toolkit and driver versions.
src/
generator/ # LLM-driven kernel generation (correctness pipeline)
optimizer/
core/ # MCTS search logic
backends/
cuda/ # CUDA JIT compilation, verification, profiling
triton/ # Triton backend (NVIDIA + AMD ROCm)
llm/ # LLM client abstractions (Anthropic, OpenAI, Google)
projects/ # Project state and kernel node tree persistence
frontend/ # Web dashboard (Jaclang)
kernels/ # Saved kernel outputs
tests/ # Test suite
docs/ # Documentation
Key entry points:
src/generator/generator.py- LLM kernel generation loopsrc/optimizer/core/mcts.py- MCTS selection and tree updatesrc/optimizer/backends/cuda/verifier.py- correctness verificationsrc/optimizer/backends/cuda/profiler.py- benchmarking
pytest tests/The test suite includes benchmark harness tests. If your change touches the profiling or verification pipeline, make sure these pass before submitting. Additionally before adding a new feature, you must create a new test to the harness.
- New optimization strategies — MCTS currently explores tiling, loop unrolling, and vectorized memory access. New strategies can be added as prompts in the optimizer.
- Backend support — Triton support is in progress; Metal or other backends would be welcome.
- LLM providers — New provider integrations go in
src/llm/. - Frontend improvements — The web dashboard is written in Jac. See
frontend/README.mdfor the walker API. - Documentation — Anything missing or unclear in
docs/. - Bug reports — Open an issue with your GPU model, CUDA version, Python version, and the full traceback.
- Fork the repo and create a branch from
main. - Make your changes with focused, self-contained commits.
- Run the test suite and confirm it passes.
- Open a pull request against
mainwith a clear description of what the change does and why.
For larger changes (new backends, architectural changes), open an issue first to discuss the approach before writing code.
- Python: follow PEP 8, no lines over 120 characters.
- No unnecessary abstractions, if something is used once, keep it inline. If unsure attach it to the issue.
- Don't add docstrings or comments to code you didn't write.
Questions? Join the Discord or open an issue!