Rebuild run and verify docs
Browse filesCo-authored-by: Codex <codex@openai.com>
1234567891011121314151617181920212223# Run the Kernel MintThe GPU backend (model + verifier) is already deployed on Modal and live. This folder isthe Gradio front-end; it just needs the backend URL.## Locally```bashpip install -r requirements.txtBACKEND_URL="https://ymrohit--ouroboros-kernel-mint-mint-mint.modal.run" python app.py# open http://localhost:7860```## As a Hugging Face Space (the hackathon submission)Create a Gradio Space, upload `app.py` + `requirements.txt` + `README.md`, and set a Spacesecret `BACKEND_URL = https://ymrohit--ouroboros-kernel-mint-mint-mint.modal.run`.## Live endpoints (backend)- mint: https://ymrohit--ouroboros-kernel-mint-mint-mint.modal.run (POST {op,name,k})- ops menu: https://ymrohit--ouroboros-kernel-mint-ops.modal.run- leaderboard: https://ymrohit--ouroboros-kernel-mint-leaderboard.modal.runThe backend scales to zero ~5 min after the last mint, so the first mint of a session waits~30–60s for the 1B model to wake up; mints are a few seconds after that.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239# Run and verify OUROBOROS Kernel MintThis Space has three useful execution paths:- **Space Local mode:** MiniCPM5-1B GGUF runs with llama.cpp inside the Space, then thein-process referee checks and times the candidate on the Space GPU.- **Space Pro mode:** the Qwen3.6-27B smith runs through the Modal backend, then the samereferee contract is applied before returning a result.- **Your machine:** clone the Space or the GitHub repo, run the 1B or 27B model yourself,then send the generated Triton source through the referee.A result only matters after the referee compiles the kernel, checks allclose againstPyTorch, and times it against PyTorch eager, `torch.compile`, and`torch.compile` max-autotune.## 1. Run the Space locallyUse this path when you want the same UI on your own CUDA machine.```bashgit clone https://huggingface.co/spaces/build-small-hackathon/ouroboros-kernel-mintcd ouroboros-kernel-mintpython -m venv .venv. .venv/bin/activatepython -m pip install -r requirements.txtpython app.py```Open `http://localhost:7860`, then use **Local (offline)** in the Build or Expert tab.When not running on Hugging Face ZeroGPU, the `spaces.GPU` decorator becomes a no-op andthe app uses your attached GPU directly.Useful local knobs:```bashLOCAL_GGUF_REPO=YMRohit/ouroboros-kernelsmith-minicpm5-1b-GGUFLOCAL_GGUF_FALLBACK_REPO=openbmb/MiniCPM5-1B-GGUFLOCAL_GGUF_QUANTS=Q5_K_M,Q4_K_M,Q8_0LOCAL_LLAMA_GPU_LAYERS=-1LOCAL_LLAMA_CTX=4096LOCAL_MAX_TOKENS=768python app.py```## 2. Run the 1B GGUF smith directlyThis mirrors Space Local mode. It is the simplest way to run the small model without Modal.```bashpython -m pip install torch triton huggingface_hub \--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu130 \llama-cpp-python==0.3.28``````pythonfrom huggingface_hub import HfApi, hf_hub_downloadfrom llama_cpp import Llamarepo = "YMRohit/ouroboros-kernelsmith-minicpm5-1b-GGUF"files = [f for f in HfApi().list_repo_files(repo) if f.lower().endswith(".gguf")]filename = next((f for f in files if "Q5_K_M" in f), files[0])gguf = hf_hub_download(repo, filename=filename)llm = Llama(model_path=gguf, n_ctx=4096, n_gpu_layers=-1)system = "You are an expert GPU kernel engineer. Output only one fenced python code block."user = "Write a fused Triton kernel for row-wise softmax. Use stable max-subtraction. Return run(x)."prompt = (f"<|im_start|>system\n{system}<|im_end|>\n"f"<|im_start|>user\n{user}<|im_end|>\n""<|im_start|>assistant\n```python\n")out = llm.create_completion(prompt, max_tokens=768, temperature=0.7, top_p=0.97)print(out["choices"][0]["text"])```## 3. Run the 1B PEFT adapterUse this path when you want the LoRA adapter instead of the GGUF export.```bashpython -m pip install torch transformers peft accelerate triton``````pythonfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModeltok = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-1B", trust_remote_code=True)base = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B",trust_remote_code=True,torch_dtype="auto",device_map="auto",)model = PeftModel.from_pretrained(base, "YMRohit/ouroboros-kernelsmith-minicpm5-1b")model.eval()```## 4. Run the 27B adapter locallyThe 27B smith is the stronger Qwen3.6-27B run behind the 76 verified compiler-beatingkernels. It uses the same prompt contract, but it is not a laptop path. The training runused Modal H200s and peaked around 110 GB VRAM. For local inference, expect a large GPU,multi-GPU `device_map="auto"`, or your own quantization setup.```bashpython -m pip install torch transformers peft accelerate triton``````pythonfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModeltok = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-27B",trust_remote_code=True,torch_dtype="auto",device_map="auto",)model = PeftModel.from_pretrained(base, "YMRohit/ouroboros-kernelsmith-qwen3.6-27b")model.eval()```If that is too large for your machine, use **Pro** in the Space. It calls the hosted 27Bbackend and still runs the same compile/correctness/timing referee before returning averdict.## 5. Prompt contractThe smith is not being used as a general coding assistant. Keep the prompt narrow:- ask for exactly one operation,- name the input tensors and tensor order,- require one fenced Python code block,- require one `run(...)` entry point,- require fp32 accumulation for reductions,- forbid prose outside the code block,- verify the output before trusting it.System prompt:```textYou are an expert GPU kernel engineer. Write a single correct, fast Triton kernel.Output ONLY one fenced python code block defining run(*inputs) and its @triton.jitkernel. Accumulate reductions in float32. No prose.```User template:```textOperation: add_rmsnorm_geluInputs: x, residual, weight. Each row is one transformer hidden state.Reference: y = gelu(rmsnorm(x + residual, weight)).Return: one fenced python block with imports, one @triton.jit kernel, and run(x, residual, weight).Target: correct vs PyTorch first, then faster than torch.compile max-autotune.```Example: residual RMSNorm plus GELU.```textWrite a fused Triton kernel for add_rmsnorm_gelu.Inputs are x, residual, and weight, all CUDA tensors.Compute RMSNorm over each row after x + residual, multiply by weight, then apply GELU.Use fp32 accumulation for the row reduction.Return exactly one fenced python code block with run(x, residual, weight).```Example: stable softmax.```textWrite a fused Triton kernel for row-wise softmax.Input x is a CUDA tensor shaped [M, N].Use the stable max-subtraction form.Return exactly one fenced python code block with run(x).Do not include explanation text outside the code block.```Example: SwiGLU.```textWrite a fused Triton kernel for swiglu.Inputs are gate and up tensors with the same shape.Compute silu(gate) * up elementwise.Return exactly one fenced python code block with run(gate, up).Keep the launch grid simple and contiguous-row friendly.```## 6. Verify a generated kernelSave the model output as `candidate.py`, then run it through the referee. The public helpersignature is:```pythonevaluate_inprocess_full(kernel_src, spec_name, n_shapes=2, n_iters=30)```Minimal check:```bashgit clone https://github.com/ymrohit/ouroboros-kernelsmith.gitcd ouroboros-kernelsmithpython -m pip install torch triton numpy``````pythonimport pathlibimport syssys.path.insert(0, "referee")from harness import evaluate_inprocess_fullkernel_src = pathlib.Path("candidate.py").read_text()result = evaluate_inprocess_full(kernel_src, "add_rmsnorm_gelu", n_shapes=2, n_iters=30)print(result.to_dict())```Submission-grade output has:- `status == "ok"`,- `correct == True`,- nonzero eager, compile, and max-autotune timings,- `speedup_maxauto > 1.0` if claiming a compiler-beating result.## 7. Backend endpointsThe live Space already has these defaults wired in `app.py`:```text1B Modal backend: https://ymrohit--ouroboros-kernel-mint-mint-mint.modal.run27B Modal backend: https://ymrohit--ouroboros-kernel-mint-pro-mint-mint.modal.runops menu: https://ymrohit--ouroboros-kernel-mint-ops.modal.runleaderboard: https://ymrohit--ouroboros-kernel-mint-leaderboard.modal.run```The backend can scale to zero, so the first non-local mint of a session can take about90 seconds while the model wakes up. The recorded replay in the Space is a real earlierverified mint, not a mockup.
507 unmodified lines5085095105115125135144 unmodified lines519520521522523524525124 unmodified lines650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694507 unmodified linesREPLAYS_JSON = "{}"APP_HTML = r"""<div id="km" data-build="2026-06-14-local-baseline-guard"><div id="km-top"><div id="km-brand"><span class="mark"><span class="dot"></span>Kernel Mint</span>4 unmodified lines<button class="km-tab on" data-tab="build">Build</button><button class="km-tab" data-tab="expert">Expert</button><button class="km-tab" data-tab="lb">Leaderboard</button><button class="km-tab" data-tab="docs">Run locally</button></div></div><script id="km-replays-data" type="application/json">__KM_REPLAYS__</script>124 unmodified lines</section></div><!-- ============ RUN LOCALLY / DOCS ============ --><div class="km-page" data-page="docs" hidden><section class="km-card km-docs"><h2>What this is</h2><p>A GPU kernel is the small program that runs one step of a neural network on the graphics card. Fusing several steps into one kernel cuts trips to memory, which is where a lot of real inference speed comes from. Here, a 1-billion-parameter model writes those kernels, and an immutable referee decides whether each one is real.</p><p>The bet behind the project: the scarce thing is not the big model, it is a verifier the model cannot fool. Correctness is a yes or no, speed is a measurement, and the model learns from its own verified wins.</p><h2>The referee</h2><p>For every kernel the referee compiles it, checks it gives the same answers as PyTorch on adversarial inputs (odd shapes, large magnitudes, low precision), times it against <b>torch.compile</b> max-autotune, and blocks three specific ways of gaming the benchmark. A green result is earned, not asserted.</p><h2>Run it locally</h2><p>The 1B smith is published and small enough to run on a modest GPU. Install the libraries, load the adapter on its base model, and prompt it for a kernel.</p><div class="km-codeblock"><button class="km-copy">Copy</button>pip install torch transformers peft triton</div><div class="km-codeblock"><button class="km-copy">Copy</button>from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModelbase = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B", trust_remote_code=True, device_map="cuda")model = PeftModel.from_pretrained(base, "YMRohit/ouroboros-kernelsmith-minicpm5-1b")tok = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-1B", trust_remote_code=True)</div><h2>How to prompt the model</h2><p>The model was trained to answer a short request for one fused operation and return a single Triton kernel with a <code>run(...)</code> entry point. Keep the request to one operation, name the pieces (normalization, residual, activation), and ask for the kernel only.</p><div class="km-codeblock"><button class="km-copy">Copy</button>Write a fused Triton kernel for: RMSNorm followed by a GELUactivation, with a residual add of the input. One @triton.jitkernel plus a run(x, residual, weight) entry point. Triton only.</div><p>Always run whatever it writes through a verifier before trusting it. That is the entire point of the project, and the referee in this app is one you can reuse.</p><h2>What it can and cannot verify</h2><p>The referee needs a PyTorch reference to check against, so it certifies a fixed space of operations: a normalization (RMSNorm or LayerNorm), an optional residual add, and one activation, plus a set of named operators from real transformers. Anything outside that space cannot be certified here, by design.</p><div id="km-docs-ops" class="km-oplist"></div><h2>The pieces</h2><div id="km-learn-blocks"></div><h2>License and source</h2><p>MIT licensed. The models are <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-minicpm5-1b" style="color:var(--accent)">MiniCPM5-1B</a> and <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-qwen3.6-27b" style="color:var(--accent)">Qwen3.6-27B</a> (both Apache-2.0). The verified kernels and evidence reports are in the <a href="https://huggingface.co/datasets/YMRohit/ouroboros-kernel-corpus" style="color:var(--accent)">corpus</a>.</p></section></div></div>507 unmodified lines5085095105115125135144 unmodified lines519520521522523524525124 unmodified lines650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861507 unmodified linesREPLAYS_JSON = "{}"APP_HTML = r"""<div id="km" data-build="2026-06-15-run-verify-docs"><div id="km-top"><div id="km-brand"><span class="mark"><span class="dot"></span>Kernel Mint</span>4 unmodified lines<button class="km-tab on" data-tab="build">Build</button><button class="km-tab" data-tab="expert">Expert</button><button class="km-tab" data-tab="lb">Leaderboard</button><button class="km-tab" data-tab="docs">Run & verify</button></div></div><script id="km-replays-data" type="application/json">__KM_REPLAYS__</script>124 unmodified lines</section></div><!-- ============ RUN + VERIFY / DOCS ============ --><div class="km-page" data-page="docs" hidden><section class="km-docs"><div class="km-doc-hero"><span class="km-doc-kicker">reproduce the claim</span><h2>Run the smith, then make the referee decide.</h2><p>The Space has two execution paths. The <b>Local (offline)</b> switch runs the 1B GGUF model with llama.cpp inside this Space, then verifies the candidate kernel in-process on the same GPU. <b>Pro</b> uses the 27B adapter through the Modal backend. Both paths compare against PyTorch eager, torch.compile, and torch.compile max-autotune before a result counts.</p></div><div class="km-doc-metrics" aria-label="execution modes"><div><b>1B local</b><span>MiniCPM5-1B GGUF, llama.cpp, in-Space referee</span></div><div><b>27B Pro</b><span>Qwen3.6-27B adapter, Modal H200 backend</span></div><div><b>referee</b><span>compile, allclose, eager, compile, max-autotune</span></div></div><div class="km-doc-grid"><article class="km-doc-panel wide"><div class="km-doc-label">1. Use this Space properly</div><h3>The easiest local run is already on this page.</h3><ol class="km-doc-steps"><li>Open <b>Build</b> or <b>Expert</b>.</li><li>Turn on <b>Local (offline)</b>. It disables Pro because the two paths are intentionally separate.</li><li>Pick a named op such as <code>rmsnorm_gelu</code>, <code>softmax</code>, or <code>swiglu</code>, or compose one norm plus one activation.</li><li>Press <b>Mint kernel</b>. The Space downloads or reuses the GGUF, drafts up to two kernels, compiles Triton, checks PyTorch correctness, and times eager, torch.compile, and max-autotune.</li></ol><div class="km-doc-callout">A certified Local result should show compiler baselines. If a cold ZeroGPU session times out during max-autotune, mint again. A result that only beats eager is not treated as the headline claim.</div></article><article class="km-doc-panel"><div class="km-doc-label">2. Run the Space clone</div><h3>Same UI, your GPU.</h3><p>Use this when you want the full app locally. With no `SPACES_ZERO_GPU` env var, the GPU decorator becomes a no-op and the local verifier runs directly on your attached CUDA device.</p><div class="km-codeblock"><button class="km-copy">Copy</button>git clone https://huggingface.co/spaces/build-small-hackathon/ouroboros-kernel-mintcd ouroboros-kernel-mintpython -m venv .venv. .venv/bin/activatepython -m pip install -r requirements.txtpython app.py</div><p>Useful knobs:</p><div class="km-codeblock"><button class="km-copy">Copy</button>LOCAL_GGUF_REPO=YMRohit/ouroboros-kernelsmith-minicpm5-1b-GGUFLOCAL_GGUF_QUANTS=Q5_K_M,Q4_K_MLOCAL_LLAMA_GPU_LAYERS=-1LOCAL_GPU_DURATION=120python app.py</div></article><article class="km-doc-panel"><div class="km-doc-label">3. Run the 1B smith directly</div><h3>GGUF path, no Modal.</h3><p>This mirrors the Space-local path. It uses the fine-tuned GGUF repo first and falls back to OpenBMB's base GGUF only if needed.</p><div class="km-codeblock"><button class="km-copy">Copy</button>python -m pip install torch triton huggingface_hub \--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu130 \llama-cpp-python==0.3.28</div><div class="km-codeblock"><button class="km-copy">Copy</button>from huggingface_hub import HfApi, hf_hub_downloadfrom llama_cpp import Llamarepo = "YMRohit/ouroboros-kernelsmith-minicpm5-1b-GGUF"files = [f for f in HfApi().list_repo_files(repo) if f.lower().endswith(".gguf")]filename = next((f for f in files if "Q5_K_M" in f), files[0])gguf = hf_hub_download(repo, filename=filename)llm = Llama(model_path=gguf, n_ctx=4096, n_gpu_layers=-1)system = "You are an expert GPU kernel engineer. Output only one fenced python code block."user = "Write a fused Triton kernel for row-wise softmax. Use stable max-subtraction. Return run(x)."prompt = (f"<|im_start|>system\n{system}<|im_end|>\n"f"<|im_start|>user\n{user}<|im_end|>\n""<|im_start|>assistant\n```python\n")out = llm.create_completion(prompt, max_tokens=768, temperature=0.7, top_p=0.97)print(out["choices"][0]["text"])</div></article><article class="km-doc-panel"><div class="km-doc-label">4. Run the 1B adapter directly</div><h3>Transformers plus PEFT.</h3><p>Use this when you want the published LoRA adapter instead of GGUF. It is slower to start than llama.cpp, but useful for inspection or further fine-tuning.</p><div class="km-codeblock"><button class="km-copy">Copy</button>python -m pip install torch transformers peft accelerate triton</div><div class="km-codeblock"><button class="km-copy">Copy</button>from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModeltok = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-1B", trust_remote_code=True)base = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B",trust_remote_code=True,torch_dtype="auto",device_map="auto",)model = PeftModel.from_pretrained(base, "YMRohit/ouroboros-kernelsmith-minicpm5-1b")model.eval()</div></article><article class="km-doc-panel"><div class="km-doc-label">5. Run the 27B smith locally</div><h3>Same prompt contract, much bigger hardware.</h3><p>The 27B artifact is the stronger Qwen3.6-27B smith used for the 76 verified compiler-beating kernels. Run it locally if you have a large GPU or multi-GPU box. The training run used Modal H200s and peaked around 110 GB VRAM; inference is still a heavyweight path compared with the 1B GGUF.</p><div class="km-codeblock"><button class="km-copy">Copy</button>python -m pip install torch transformers peft accelerate triton</div><div class="km-codeblock"><button class="km-copy">Copy</button>from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModeltok = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-27B",trust_remote_code=True,torch_dtype="auto",device_map="auto",)model = PeftModel.from_pretrained(base, "YMRohit/ouroboros-kernelsmith-qwen3.6-27b")model.eval()</div><p>If that does not fit, use <b>Pro</b> in this Space. It calls the hosted 27B backend and still sends the output through the same three-baseline referee before returning a result.</p></article><article class="km-doc-panel wide"><div class="km-doc-label">6. Prompt contract</div><h3>Ask for one operation, one code block, one `run(...)` entry point.</h3><p>The model is not a general Python assistant here. It was trained to emit a single Triton kernel for a verifier-known operation. Keep the prompt narrow and include the exact operation, input tensors, output contract, and baseline target.</p><div class="km-prompt-grid"><div><b>System</b><div class="km-codeblock"><button class="km-copy">Copy</button>You are an expert GPU kernel engineer. Write a single correct, fast Triton kernel. Output ONLY one fenced python code block defining run(*inputs) and its @triton.jit kernel. Accumulate reductions in float32. No prose.</div></div><div><b>User template</b><div class="km-codeblock"><button class="km-copy">Copy</button>Operation: add_rmsnorm_geluInputs: x, residual, weight. Each row is one transformer hidden state.Reference: y = gelu(rmsnorm(x + residual, weight)).Return: one fenced python block with imports, one @triton.jit kernel, and run(x, residual, weight).Target: correct vs PyTorch first, then faster than torch.compile max-autotune.</div></div></div><div class="km-doc-chiprow"><span class="km-doc-chip">name the op</span><span class="km-doc-chip">state tensor order</span><span class="km-doc-chip">require fp32 reductions</span><span class="km-doc-chip">forbid prose</span><span class="km-doc-chip">verify before trusting</span></div></article><article class="km-doc-panel"><div class="km-doc-label">Prompt example A</div><h3>Residual RMSNorm plus GELU.</h3><div class="km-codeblock"><button class="km-copy">Copy</button>Write a fused Triton kernel for add_rmsnorm_gelu.Inputs are x, residual, and weight, all CUDA tensors.Compute RMSNorm over each row after x + residual, multiply by weight, then apply GELU.Use fp32 accumulation for the row reduction.Return exactly one fenced python code block with run(x, residual, weight).</div></article><article class="km-doc-panel"><div class="km-doc-label">Prompt example B</div><h3>Stable softmax.</h3><div class="km-codeblock"><button class="km-copy">Copy</button>Write a fused Triton kernel for row-wise softmax.Input x is a CUDA tensor shaped [M, N].Use the stable max-subtraction form.Return exactly one fenced python code block with run(x).Do not include explanation text outside the code block.</div></article><article class="km-doc-panel"><div class="km-doc-label">Prompt example C</div><h3>SwiGLU gate.</h3><div class="km-codeblock"><button class="km-copy">Copy</button>Write a fused Triton kernel for swiglu.Inputs are gate and up tensors with the same shape.Compute silu(gate) * up elementwise.Return exactly one fenced python code block with run(gate, up).Keep the launch grid simple and contiguous-row friendly.</div></article><article class="km-doc-panel wide"><div class="km-doc-label">7. Verify a generated kernel</div><h3>Never score the model output by eye.</h3><p>Save the candidate as `candidate.py`, then send it to the referee. The result object reports correctness, latency, and speedups vs eager, torch.compile, and max-autotune.</p><div class="km-codeblock"><button class="km-copy">Copy</button>git clone https://github.com/ymrohit/ouroboros-kernelsmith.gitcd ouroboros-kernelsmithpython -m pip install torch triton numpy</div><div class="km-codeblock"><button class="km-copy">Copy</button>import pathlibimport syssys.path.insert(0, "referee")from harness import evaluate_inprocess_fullkernel_src = pathlib.Path("candidate.py").read_text()result = evaluate_inprocess_full(kernel_src, "add_rmsnorm_gelu", n_shapes=2, n_iters=30)print(result.to_dict())</div><div class="km-doc-callout">A kernel is submission-grade only if `status` is `ok`, correctness is true, and the compiler baselines are present. The strongest number is `speedup_maxauto` because that compares against torch.compile max-autotune.</div></article><article class="km-doc-panel wide"><div class="km-doc-label">8. What the referee can certify</div><h3>Known operations only, by design.</h3><p>The referee needs a PyTorch reference. It certifies norm and activation fusions plus named transformer operations. Unknown math can still be interesting, but this app will not label it a verified win until there is a reference spec.</p><div id="km-docs-ops" class="km-oplist"></div></article><article class="km-doc-panel wide"><div class="km-doc-label">9. Glossary</div><div id="km-learn-blocks"></div></article><article class="km-doc-panel wide"><div class="km-doc-label">Source and artifacts</div><p>MIT licensed code: <a href="https://github.com/ymrohit/ouroboros-kernelsmith">ymrohit/ouroboros-kernelsmith</a>. Models: <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-minicpm5-1b">MiniCPM5-1B smith</a>, <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-minicpm5-1b-GGUF">MiniCPM5-1B GGUF</a>, and <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-qwen3.6-27b">Qwen3.6-27B smith</a>. Evidence: <a href="https://huggingface.co/datasets/YMRohit/ouroboros-kernel-corpus">verified kernel corpus</a>.</p></article></div></section></div></div>
370 unmodified lines3713723733743753763773783793803813823833843853863873 unmodified lines391392393394395396370 unmodified lines.km-lbt td:nth-child(5) { color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }.km-rank { color: var(--faint); font-family: var(--mono); }/* ---------- docs ---------- */.km-docs { max-width: 760px; }.km-docs h2 { font-size: 22px; margin: 34px 0 10px; letter-spacing: -0.03em; }.km-docs h2:first-child { margin-top: 0; }.km-docs p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 12px; max-width: 68ch; }.km-docs b { color: var(--text); font-weight: 600; }.km-docs ol, .km-docs ul { color: var(--muted); font-size: 15px; line-height: 1.65; padding-left: 20px; margin: 0 0 14px; }.km-docs li { margin-bottom: 7px; }.km-codeblock { background: #08090b; border: 1px solid var(--line); border-radius: var(--r-sm);padding: 15px 16px; font: 12.5px/1.7 var(--mono); color: #b9e6d3; overflow: auto; margin: 0 0 16px;white-space: pre; position: relative; }.km-copy { position: absolute; top: 9px; right: 9px; appearance: none; border: 1px solid var(--line-2);background: var(--surface-3); color: var(--muted); font: 500 11px var(--sans); cursor: pointer;padding: 5px 9px; border-radius: 7px; transition: all 0.16s var(--ease); }3 unmodified lines.km-gloss span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }.km-callout { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm);padding: 14px 16px; font-size: 13.5px; color: var(--text); margin: 0 0 16px; }/* ---------- misc ---------- */.km-mini { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);370 unmodified lines3713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204213 unmodified lines425426427428429430431432433434435436437438439440370 unmodified lines.km-lbt td:nth-child(5) { color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }.km-rank { color: var(--faint); font-family: var(--mono); }/* ---------- run + verify docs ---------- */.km-docs { width: 100%; }.km-docs a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent;transition: border-color 0.16s var(--ease), color 0.16s var(--ease); }.km-docs a:hover { border-color: var(--accent-line); }.km-docs h2 { margin: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.02; letter-spacing: -0.04em; }.km-docs h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.18; letter-spacing: -0.025em; }.km-docs p { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin: 0 0 14px; max-width: 72ch; }.km-docs b { color: var(--text); font-weight: 600; }.km-docs code { color: var(--text); background: var(--surface-3); border: 1px solid var(--line);border-radius: 6px; padding: 1px 5px; font-size: 0.92em; }.km-doc-hero { padding: 8px 0 22px; max-width: 900px; }.km-doc-kicker { display: inline-block; margin: 0 0 12px; color: var(--accent);font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }.km-doc-hero p { margin-top: 16px; font-size: clamp(15px, 2vw, 17px); color: var(--muted); }.km-doc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 0 0 18px; }.km-doc-metrics > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);padding: 14px 15px; min-height: 82px; }.km-doc-metrics b { display: block; font-size: 13.5px; margin-bottom: 5px; }.km-doc-metrics span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }.km-doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }.km-doc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }.km-doc-panel.wide { grid-column: 1 / -1; }.km-doc-label { color: var(--faint); font: 600 11.5px/1 var(--sans); letter-spacing: 0.06em;text-transform: uppercase; margin-bottom: 12px; }.km-doc-steps { counter-reset: kmstep; list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }.km-doc-steps li { position: relative; padding: 12px 14px 12px 46px; border: 1px solid var(--line);background: var(--surface-2); border-radius: var(--r-sm); color: var(--muted); font-size: 14px; line-height: 1.55; }.km-doc-steps li::before { counter-increment: kmstep; content: counter(kmstep);position: absolute; left: 13px; top: 12px; width: 22px; height: 22px; border-radius: 7px;display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);font: 700 12px/1 var(--mono); border: 1px solid var(--accent-line); }.km-doc-callout { border: 1px solid var(--accent-line); background: var(--accent-soft);border-radius: var(--r-sm); padding: 13px 15px; color: var(--text); font-size: 13.5px;line-height: 1.55; margin: 12px 0 0; }.km-prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; align-items: start; }.km-prompt-grid > div > b { display: block; margin: 0 0 8px; font-size: 13px; }.km-doc-chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }.km-doc-chip { display: inline-flex; align-items: center; min-height: 30px; border-radius: var(--r-sm);border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);font: 600 12px/1 var(--sans); padding: 8px 10px; }.km-codeblock { background: #08090b; border: 1px solid var(--line); border-radius: var(--r-sm);padding: 15px 16px; font: 12.5px/1.7 var(--mono); color: #b9e6d3; overflow: auto; margin: 0 0 16px;white-space: pre; position: relative; max-width: 100%; }.km-copy { position: absolute; top: 9px; right: 9px; appearance: none; border: 1px solid var(--line-2);background: var(--surface-3); color: var(--muted); font: 500 11px var(--sans); cursor: pointer;padding: 5px 9px; border-radius: 7px; transition: all 0.16s var(--ease); }3 unmodified lines.km-gloss span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }.km-callout { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm);padding: 14px 16px; font-size: 13.5px; color: var(--text); margin: 0 0 16px; }@media (max-width: 900px) {.km-doc-grid, .km-doc-metrics, .km-prompt-grid { grid-template-columns: 1fr; }.km-doc-panel.wide { grid-column: auto; }}@media (max-width: 560px) {.km-doc-panel { padding: 16px; }.km-doc-steps li { padding-left: 42px; }.km-codeblock { font-size: 11.5px; padding: 14px 13px; }.km-gloss { grid-template-columns: 1fr; gap: 3px; }}/* ---------- misc ---------- */.km-mini { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
RUN.md+232-16
app.py+204-37
style.css+52-8