YMRohit Claude Fable 5 commited on
Commit
7a4fd2d
Β·
1 Parent(s): b749756

Submission README (tracks, sponsors, receipts) + Space hygiene: Gradio 6 sdk pin, drop stray cert, trim requirements

Browse files
Files changed (4) hide show
  1. .gitignore +1 -0
  2. .gradio/certificate.pem +0 -31
  3. README.md +90 -23
  4. requirements.txt +0 -1
.gitignore CHANGED
@@ -1 +1,2 @@
1
  __pycache__/
 
 
1
  __pycache__/
2
+ .gradio/
.gradio/certificate.pem DELETED
@@ -1,31 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
3
- TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
4
- cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
5
- WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
6
- ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
7
- MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
8
- h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
9
- 0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
10
- A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
11
- T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
12
- B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
13
- B5iPNgiV5+I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F2LN9d11TPA
29
- mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
30
- emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
31
- -----END CERTIFICATE-----
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,39 +1,106 @@
1
  ---
2
  title: OUROBOROS Kernel Mint
3
- emoji: 🟒
4
  colorFrom: green
5
- colorTo: gray
6
  sdk: gradio
7
- sdk_version: 4.44.0
8
  app_file: app.py
9
  pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
- # OUROBOROS Kernel Mint
13
 
14
- Make a GPU kernel. An un-gameable referee decides if it's real.
 
 
15
 
16
- Pick the pieces of an operation (or a classic one), press **Mint**, and a 27B open model
17
- writes a real Triton kernel for it. An immutable referee compiles it, checks it is correct
18
- against PyTorch on adversarial inputs, and times it against PyTorch's production compiler.
19
- Beat the compiler and you land on the leaderboard. A green tick is earned, not asserted.
20
 
21
- ## Running
22
 
23
- The model and the referee run on a GPU behind a small Modal backend (see
24
- `../ouroboros-mint/mint_backend.py`). This folder is just the Gradio front-end.
 
 
 
 
 
 
 
 
25
 
26
- ```bash
27
- pip install -r requirements.txt
28
- BACKEND_URL="https://<you>--ouroboros-kernel-mint-mint-mint.modal.run" python app.py
29
- ```
30
 
31
- On a Hugging Face Space, set `BACKEND_URL` as a Space secret. The backend scales to zero
32
- when idle, so the first mint of a session waits ~1–2 minutes for the model to wake up.
33
 
34
- ## What it teaches
 
 
35
 
36
- GPU kernels are the small programs that run neural-network steps on the GPU; fusing several
37
- steps into one is where most real speedups in running AI come from. The point of the
38
- project is that the valuable, scarce thing is not the big model but the **honest referee**
39
- that verifies the work β€” which is exactly what mints each kernel here.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: OUROBOROS Kernel Mint
3
+ emoji: πŸͺ™
4
  colorFrom: green
5
+ colorTo: yellow
6
  sdk: gradio
7
+ sdk_version: 6.17.3
8
  app_file: app.py
9
  pinned: false
10
+ license: mit
11
+ short_description: A 1B model forges GPU kernels. An un-gameable referee.
12
+ tags:
13
+ - track:backyard
14
+ - sponsor:openbmb
15
+ - sponsor:modal
16
+ - achievement:offbrand
17
+ - tiny-titan
18
+ - best-agent
19
+ - minicpm
20
+ - triton
21
+ - gpu-kernels
22
+ - reinforcement-learning
23
+ - self-distillation
24
  ---
25
 
26
+ # πŸͺ™ OUROBOROS Kernel Mint
27
 
28
+ **Build a GPU operation out of blocks. A 1-billion-parameter model writes a real Triton
29
+ kernel for it. An immutable referee decides if it's real β€” and times it against PyTorch's
30
+ production compiler. Beat the compiler, land on the leaderboard.**
31
 
32
+ A green tick here is *earned, not asserted*: every kernel is compiled, checked for
33
+ correctness against PyTorch on adversarial shapes/dtypes/magnitudes, and timed with CUDA
34
+ events against `torch.compile` max-autotune β€” live, while you watch.
 
35
 
36
+ ## How to play
37
 
38
+ 1. **Build** β€” snap blocks together (norm β†’ +residual β†’ activations), or pick a classic
39
+ (softmax, swiglu, geglu…). The numbers flowing through the machine update live so you
40
+ can see what each block *does*.
41
+ 2. **Mint** β€” a fine-tuned **MiniCPM5-1B** (OpenBMB) writes a fused Triton kernel for your
42
+ machine. Each attempt faces the referee: compile β†’ adversarial correctness sweep β†’
43
+ benchmark. Failures are shown, not hidden.
44
+ 3. **Beat the compiler** β€” if your minted kernel is correct *and* faster than
45
+ `torch.compile` max-autotune, it goes on the leaderboard. The reigning champions πŸ‘‘ were
46
+ minted by the big 27B model; try to dethrone them. **Pro mode** switches the smith to
47
+ the full **Qwen3.6-27B** kernel-writer.
48
 
49
+ > First mint of a session takes ~30–60 s while the model wakes up (the backend scales to
50
+ > zero). After that, mints take a few seconds.
 
 
51
 
52
+ ## Why this is interesting
 
53
 
54
+ GPU kernels are the small programs that actually run neural networks; *fusing* several
55
+ steps into one kernel is where much of real-world AI speedup comes from. Writing them is
56
+ expert work β€” PyTorch ships a whole compiler (`torch.compile`) to do it automatically.
57
 
58
+ The thesis of this project: **the scarce, valuable thing is not the big model β€” it's the
59
+ honest referee.** Give a small model a verifier it cannot fool (correctness is a boolean,
60
+ speed is a measurement) and let it learn from its own verified wins (RL self-distillation).
61
+ The referee that mints your kernel in this Space is the same one that trained the models.
62
+
63
+ ## The receipts (all machine-checked, none self-reported)
64
+
65
+ - **76 model-era kernels** beat `torch.compile` max-autotune on H200 β€” 69 of them
66
+ stability-gated across 5 fresh re-benchmark runs (mean of means **1.299Γ—**, range
67
+ 1.11–2.04Γ—), plus 7 single-shot invention probes on never-trained problems.
68
+ - **Across a 376-cell shape/dtype grid**, the trained kernels hold a **1.49Γ— geomean**
69
+ vs max-autotune recompiled per cell β€” with the ~10% of losing cells *reported per-cell*,
70
+ not hidden.
71
+ - **Faster than hand-written expert kernels** (Liger / Unsloth / Triton tutorial) on
72
+ swiglu, rmsnorm, relu2 and geglu under two test conditions; softmax/layernorm are
73
+ ties-within-noise vs the best fixed-schedule expert.
74
+ - **The referee defends itself**: a 30-case selftest (gold kernels pass, subtly-wrong
75
+ kernels rejected, three anti-gaming exploits β€” bench-shape special-casing, output
76
+ memoization, input mutation β€” rejected by construction). Green on RTX 4090 and H200.
77
+ - Honest bounds: these are reproducible *scheduling* wins on bandwidth-bound fusion ops β€”
78
+ not wins over cuBLAS/FlashAttention, not new algorithms.
79
+
80
+ ## How it was built
81
+
82
+ - **Models:** OpenBMB **MiniCPM5-1B** (the default smith β€” genuinely tiny) and
83
+ **Qwen3.6-27B** (pro mode), both fine-tuned with the OUROBOROS pipeline:
84
+ SFT on verified seed kernels β†’ **RL self-distillation** where the only reward is the
85
+ referee's verdict (correct + faster = reward; no human labels anywhere).
86
+ - **Modal** is used for **both development and runtime**: the 27B was trained on Modal
87
+ H200s (the RL run peaks ~110 GB VRAM), and the live mint backend runs on Modal
88
+ (L4 for the 1B smith, A100-80GB for pro mode) with scale-to-zero between sessions.
89
+ - **Frontend:** a single Gradio Space whose whole interactive surface is a custom JS
90
+ machine-builder (snap blocks, live number-flow animation) bridged to Python β€” no
91
+ default Gradio look anywhere.
92
+ - **Verifier:** immutable Triton/PyTorch harness β€” allclose vs PyTorch on adversarial
93
+ inputs (incl. the benchmark shape), CUDA-event medians vs `torch.compile`
94
+ max-autotune, anti-memoization poke + verify-after-bench, mutation checks.
95
+
96
+ ## Links
97
+
98
+ - πŸ“„ Field notes / write-up: *coming with submission*
99
+ - πŸ€— Fine-tuned models + verified-kernel corpus: *being published β€” links land here*
100
+ - 🎬 Demo video: *coming with submission*
101
+ - πŸ“£ Social post: *coming with submission*
102
+
103
+ ---
104
+
105
+ *Backyard AI track. Making small models fast is the backyard problem of everyone who runs
106
+ them β€” this is my backyard, and the referee is the product.*
requirements.txt CHANGED
@@ -1,2 +1 @@
1
- gradio>=4.44
2
  requests>=2.31
 
 
1
  requests>=2.31