File size: 2,880 Bytes
444d539
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
license: mit
task_categories:
  - text-generation
tags:
  - cuda
  - triton
  - kernel-optimization
  - gpu
  - inference
  - llm-inference
  - synthetic-data
size_categories:
  - 1G<n<10G
---

# kernelstrain2 — kernelinfer

Synthetic long-horizon GPU kernel-optimization trajectories, **inference-only**.

Each row is a complete optimization *session* (~30–200 steps, simulating
1–5 hours of work): the model receives an inference-kernel task, emits a
full CUDA or Triton candidate, and gets simulated compile / correctness /
benchmark feedback — iterating, self-correcting, and tuning launch
parameters until convergence. No reasoning traces; assistant turns are
kernel code only.

## Scope

**Inference workloads only** — no training kernels. Operations cover:

- decode/prefill attention: flash_decode, flash_prefill, swa_decode,
  mla_decode, tree_attn, chunked_prefill, cross_attn, fused_qkv_rope
- quantized GEMM/GEMV: fp16, int8, int4, fp4, fp8 (incl. blockwise DeepGEMM
  style), split-K, wgmma/TMA persistent variants
- KV-cache ops: paged_kv_copy, kv_append, kv_int8_quant
- samplers: topk, nucleus (top-p), min-p, logits_softmax
- MoE: scatter, combine, grouped_gemm
- SSM: mamba_scan, mamba_step
- misc: rmsnorm, rope, swiglu_act, embedding_gather, conv1d_causal,
  conv2d_nhwc, gemv_fp16

41 ops, CUDA + Triton implementations.

## Hardware targets

H100 (sm_90a), H200 (sm_90a), A100 (sm_80), A10 (sm_86), RTX A6000 (sm_86),
RTX 5090 (sm_120). Arch-gating is modeled correctly (wgmma/TMA only on
sm_90a; fp8 on sm_89+/sm_90/sm_120; fp4 on sm_120; per-block smem caps
99/164/227KB).

## Format

JSONL, one session per line:

- `messages` — training data: system + user (task, then `[t+H:MM:SS] RESULT`
  feedback turns) + assistant (full kernel source, no prose, no CoT)
- `trace` — compact per-step metadata (tag/kind/params/status/time/kept)
- top-level: `op`, `impl` (cuda|triton), `gpu`, `arch`, `dtype`, `shape`,
  `signature`, `desc`, `baseline_ms`, `best{step,time_ms,speedup}`,
  `attempts`, `elapsed_s`, `elapsed_hms`, `num_steps`

`batches/` holds 100-session shards; `sessions.jsonl` is the merged view;
`tasks_holdout.jsonl` = 195 held-out task specs (no solutions).

## Stats

- 1,899 sessions, all unique (op, gpu, shape, dtype) combos
- ~180K total steps; avg 94.6 steps/session
- avg 2.18h simulated (min 1.03h, max 4.93h); avg 13.4x speedup
- step statuses: 151.8K ok / 22.4K compile_error / 5.3K wrong_result
- ~1.5GB

## Provenance

Fully synthetic: benchmark/correctness numbers come from an analytic
roofline-style model — **no kernels were ever compiled or executed**.
Intended for training small models on long-horizon iterative optimization
behavior. Per-batch QA reports in the generating repo
(`kernelinfer/qa_reports/`); all 19 batches scored 10/10 on mechanical
checks and ≥8.5/10 on qualitative review after fixes.