Docs
Get started in ten minutes.
From sign-up to a CI-gated pull request. The app has in-product help on every page; this is the path through it.
1. The workload contract
Kernalin times and checks a workload through two functions. make_inputs builds the inputs for one configuration; run is the computation to time and verify.
import torch
DTYPES = {"float32": torch.float32, "float16": torch.float16,
"bfloat16": torch.bfloat16, "float64": torch.float64}
HIDDEN = 1024
def make_inputs(batch_size, dtype="float32", device="cpu"):
dt = DTYPES[dtype]
gen = torch.Generator(device="cpu").manual_seed(0)
x = torch.randn(batch_size, HIDDEN, generator=gen).to(device=device, dtype=dt)
w = torch.randn(HIDDEN, HIDDEN, generator=gen).to(device=device, dtype=dt) / HIDDEN ** 0.5
b = torch.zeros(HIDDEN, device=device, dtype=dt)
return (x, w, b)
def run(x, w, b):
return torch.nn.functional.gelu(x @ w + b) Uploads are scanned statically and must not use os, subprocess, the network, eval/exec, getattr() or file access. Map dtype names with a dictionary, as above. Supported files: .py (PyTorch, Triton), .cu/.cuh, .onnx, .pt/.pth, up to 100 MB.
2. Connect GitHub or upload
- Sign up at kerneln.com/app and verify your email.
- Connect GitHub (or GitHub Enterprise Server) and choose Link a file: repository, branch and workload file.
- Pick what runs on every new version: an op profile and/or a benchmark (runtimes, dtypes, batch sizes), on the CPU sandbox or a GPU runner. Auto-sync checks the branch every few minutes.
Or upload a file directly from the Workloads page.
3. Profile and benchmark
The op profile ranks ops by time and shows an Amdahl table (“if you sped up one kernel…”). Suggestions give cited fixes per hot op. Benchmarks compare runtimes and report a Bayesian verdict per configuration: faster, equivalent or slower, against a ±2% band at ≥95% probability.
4. Optimize and open a PR
Start an Optimize run on a workload with a reference. Claude proposes 3 rewrites by default (up to 8). Each passes through the correctness gate, the anti-cheat audit and a speed verdict; the run page lists every rewrite with its decision and the diff. Choose Open pull request on a kept rewrite to send it to GitHub with the audit table.
On the CPU sandbox only PyTorch kernels are rewritten. Triton and CUDA C++ rewrites need a GPU runner.
5. Add the CI gate
Create a CI token in the app (admins), add it as the repository secret KERNALIN_TOKEN, and add the action to a workflow that installs PyTorch:
- name: Benchmark and gate
uses: JashomTech/Kernalin/.github/actions/rnx-benchmark@prod
with:
install-engine: "true"
workload: kernels/attention.py
runtimes: pytorch_eager
batch-sizes: "1,8"
dtypes: float32
kernalin-token: ${{ secrets.KERNALIN_TOKEN }} A credible regression or a broken runtime fails the check; if Kernalin is unreachable it warns. On shared GitHub-hosted runners, set a looser blocking threshold in the gate config. An Add CI gate button that opens this workflow as a pull request is Coming soon.
6. Attach a GPU runner
For GPU timings, TensorRT, Triton and CUDA C++ rewrites and hardware counters, attach your own runner using the runner protocol; a RunPod setup script is included. Capability labels route each job to hardware that supports it, and every runner runs the sandbox self-test. Admins set a price per hour per runner to get cost per million items.
7. Coding agents (MCP) Coming soon
kernalin-mcp is a stdio MCP server (Python 3.10+) for Claude Code, Cursor and Codex. It authenticates with a workspace agent token and offers 9 read tools and 3 write tools; set KERNALIN_MCP_READ_ONLY=1 to hide the write tools. Bundled skills teach the loop: upload, benchmark, check correctness and the verdict, and open a PR only when it is ready.
Point Kernalin at your slowest kernel.
Sign-up is open and self-serve. Connect GitHub or upload a file, and get a profile, a benchmark and verified rewrites, without changing how you ship.