speedy00 commited on
Commit
42f3769
·
verified ·
1 Parent(s): 236187c

attack: swap teacher model to gpt-4o-mini after proving

Browse files
README.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: messages
5
+ list:
6
+ - name: role
7
+ dtype: string
8
+ - name: content
9
+ dtype: string
10
+ - name: metadata
11
+ struct:
12
+ - name: provider
13
+ dtype: string
14
+ - name: gateway
15
+ dtype: string
16
+ - name: task_id
17
+ dtype: string
18
+ - name: category
19
+ dtype: string
20
+ - name: validation_score
21
+ dtype: float64
22
+ splits:
23
+ - name: train
24
+ num_bytes: 11293
25
+ num_examples: 2
26
+ download_size: 15167
27
+ dataset_size: 11293
28
+ configs:
29
+ - config_name: default
30
+ data_files:
31
+ - split: train
32
+ path: data/train-*
33
+ ---
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02b4e2a6253a9ed9c6e8b9c020804955f0e4eead442266c30616f01260e0c966
3
+ size 15167
proof/dataset_manifest.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_version": "triton-distill-v0.2",
3
+ "triton_version": "3.7.1",
4
+ "gpu_targets": [
5
+ "blackwell"
6
+ ],
7
+ "rows_total": 2,
8
+ "gold_rows": 1,
9
+ "silver_rows": 0,
10
+ "repair_rows": 1,
11
+ "dpo_pairs": 0,
12
+ "trajectories_sha256": "2adf1d1e338bf49bde0f6fcb0356bc9619260c001c50bed95eeb12b1f698cde6",
13
+ "blocked_rows": 0,
14
+ "passed": true,
15
+ "novelty": {
16
+ "verified_rows": 2,
17
+ "exact_duplicate_rows": 0,
18
+ "near_duplicate_rows": 0,
19
+ "novel_verified_rows": 2,
20
+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yd_Plt5BJatXIdIlbbs0FkVYpKDFzj8wD7S3Jtv2E5sEajQvG89_LgTUO0e-mcBMP4OCGJ8ENs0sd6p-NGNNUdks1jh2kfOI\"}]}]",
5
+ "claims": {
6
+ "sub": "NVIDIA-PLATFORM-ATTESTATION",
7
+ "x-nvidia-ver": "2.0",
8
+ "nbf": 1783772120,
9
+ "iss": "https://nras.attestation.nvidia.com",
10
+ "x-nvidia-overall-att-result": true,
11
+ "submods": {
12
+ "GPU-0": [
13
+ "DIGEST",
14
+ [
15
+ "SHA-256",
16
+ "cbedefccb5c2163099816fb12ede2e2071f2dbac09620c0c3188a32fe4a88c92"
17
+ ]
18
+ ]
19
+ },
20
+ "eat_nonce": "506b8a02a972387f1e8834188640c72dfe5f743cd13aaf19e7257cd200758327",
21
+ "exp": 1783775720,
22
+ "iat": 1783772120,
23
+ "jti": "03badd66-ee3a-45e8-887b-74056152360b"
24
+ },
25
+ "gpu_profile": {
26
+ "family": "blackwell",
27
+ "profile": "workstation",
28
+ "device_index": 0,
29
+ "name": "NVIDIA RTX PRO 6000 Blackwell Server Edition",
30
+ "capability": [
31
+ 12,
32
+ 0
33
+ ],
34
+ "total_memory_gb": 94.86
35
+ },
36
+ "token_sha256": "235b4ed203fd17ec2f67de2b14bd6dd80f0a8249fa31eee832786acd3e5eef19",
37
+ "nonce": "506b8a02a972387f1e8834188640c72dfe5f743cd13aaf19e7257cd200758327",
38
+ "nonce_verified": true
39
+ }
proof/manifest.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "sparkproof-2",
3
+ "generator_version": "0.3.0",
4
+ "dataset_kind": "triton-3.7.1-blackwell",
5
+ "gateway": "yunwu",
6
+ "allowed_teachers": [
7
+ {
8
+ "provider": "anthropic",
9
+ "model": "claude-fable-5",
10
+ "gateway_model": "claude-fable-5",
11
+ "openrouter_model": "claude-fable-5",
12
+ "reasoning_effort": "xhigh"
13
+ },
14
+ {
15
+ "provider": "openai",
16
+ "model": "gpt-5.6",
17
+ "gateway_model": "gpt-5.6-sol",
18
+ "openrouter_model": "gpt-5.6-sol",
19
+ "reasoning_effort": "xhigh"
20
+ }
21
+ ],
22
+ "generation_config": {
23
+ "reasoning_effort": "xhigh",
24
+ "max_tokens": 4096,
25
+ "temperature": 0.7,
26
+ "multi_candidate": true,
27
+ "max_repairs": 2
28
+ },
29
+ "openrouter_generation_config": {
30
+ "reasoning_effort": "xhigh",
31
+ "max_tokens": 4096,
32
+ "temperature": 0.7,
33
+ "multi_candidate": true,
34
+ "max_repairs": 2
35
+ },
36
+ "sample_count": 2,
37
+ "raw_sample_count": 2,
38
+ "merkle_root": "bdfe5cf41c65b171d7140f20bbe0a5ebaa35877d96bbd480d30dff980934c25c",
39
+ "prompts_sha256": "9dd0814a7abe470531cd2636dadea5de41121ce24caeba100f7fb3f669834afc",
40
+ "created_at": "2026-07-11T12:15:27.673831+00:00",
41
+ "gpu_profile": {
42
+ "family": "blackwell",
43
+ "profile": "workstation",
44
+ "device_index": 0,
45
+ "name": "NVIDIA RTX PRO 6000 Blackwell Server Edition",
46
+ "capability": [
47
+ 12,
48
+ 0
49
+ ],
50
+ "total_memory_gb": 94.86
51
+ },
52
+ "validation": {
53
+ "triton_version": "3.7.1",
54
+ "stages": [
55
+ "syntax",
56
+ "triton_api",
57
+ "compile_execute",
58
+ "benchmark"
59
+ ],
60
+ "benchmark_enabled": true
61
+ },
62
+ "attestation_hash": "235b4ed203fd17ec2f67de2b14bd6dd80f0a8249fa31eee832786acd3e5eef19",
63
+ "sampling": {
64
+ "bucket_counts": {
65
+ "api_doc": 1,
66
+ "mutation": 1
67
+ },
68
+ "catalog_sha256": "5da78ea41279192e187b49df4fed4af00ac12e03fd7260d89fa1fc89104e28b7",
69
+ "catalog_size": 161,
70
+ "max_bucket_share": 0.25,
71
+ "policy": "stratified-v1",
72
+ "requested_limit": 2,
73
+ "run_seed": "197a371b18f0cb01589d7b82ab670ed0c0cd47550b3867adbfc8ef27923c9575",
74
+ "generation_run_seed": "a9651a73bb8354d5f0e046a41493c1ebe296441ba90260676fb94e9ba49fc900"
75
+ }
76
+ }
proof/novelty_report.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "verified_rows": 2,
3
+ "exact_duplicate_rows": 0,
4
+ "near_duplicate_rows": 0,
5
+ "novel_verified_rows": 2,
6
+ "duplicate_task_ids": []
7
+ }
proof/prompts.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"prompt": "Write a complete Triton 3.7.1 kernel on Blackwell SM12x that **must use** `tl.atomic_and`.\nDefine exact input shapes/dtypes, include @triton.jit, launcher, masks, and torch.allclose test.\n\nContext:\nCategory: Atomic Ops\nAPI: tl.atomic_and\nSymbol: atomic_and (triton.language)", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "task_id": "api_tl_atomic_and", "source": "api_doc", "origin": "api_doc", "category": "kernel_write", "target_api": "tl.atomic_and", "doc_chunk_id": "api_tl_atomic_and", "title": "atomic_and", "split": "train"}
2
+ {"prompt": "The following Triton 3.7.1 kernel fails or is numerically wrong. Diagnose the bug and return corrected, runnable code with a torch.allclose test. End with: print(\"SPARKPROOF_TRITON_PASS\"). Do NOT pass BLOCK= to the kernel launch when @triton.autotune is used.\n\n```python\nimport torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n\n```", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "task_id": "mutate_softmax_row_strip_boundary_mask", "source": "mutation", "origin": "mutation", "category": "debugging", "ground_truth_code": "\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.autotune(\n configs=[\n triton.Config({\"BLOCK\": 1024}, num_warps=4, num_stages=2),\n triton.Config({\"BLOCK\": 2048}, num_warps=8, num_stages=2),\n ],\n key=[\"ncols\"],\n)\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols, mask=mask, other=-float(\"inf\"))\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out, mask=mask)\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\n\ndef test_kernel():\n x = torch.randn(8, 1003, device=\"cuda\", dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=1e-3, atol=1e-3)\n\n\ntest_kernel()\nprint(\"SPARKPROOF_TRITON_PASS\")\n", "broken_code": "import torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n", "mutation_reason": "Removed boundary masks from tl.load/tl.store.", "task_family": "softmax_row", "split": "train"}
proof/trajectories.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"prompt": "Write a complete Triton 3.7.1 kernel on Blackwell SM12x that **must use** `tl.atomic_and`.\nDefine exact input shapes/dtypes, include @triton.jit, launcher, masks, and torch.allclose test.\n\nContext:\nCategory: Atomic Ops\nAPI: tl.atomic_and\nSymbol: atomic_and (triton.language)", "response": "```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n# Exact input contract:\n# x: contiguous CUDA tensor, shape (37, 1003), dtype=torch.int32\n# Output:\n# out[col] = bitwise AND of x[:, col], shape (1003,), dtype=torch.int32\nN_ROWS = 37\nN_COLS = 1003\nBLOCK_SIZE = 256\n\n\n@triton.jit\ndef atomic_and_reduce_kernel(\n x_ptr,\n out_ptr,\n n_rows: tl.constexpr,\n n_cols: tl.constexpr,\n BLOCK_SIZE: tl.constexpr,\n):\n row = tl.program_id(axis=0)\n col_block = tl.program_id(axis=1)\n\n cols = col_block * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)\n mask = (row < n_rows) & (cols < n_cols)\n\n values = tl.load(\n x_ptr + row * n_cols + cols,\n mask=mask,\n other=-1,\n )\n tl.atomic_and(out_ptr + cols, values, mask=mask)\n\n\ndef atomic_and_reduce(x: torch.Tensor) -> torch.Tensor:\n assert x.is_cuda\n assert x.is_contiguous()\n assert x.dtype == torch.int32\n assert x.shape == (N_ROWS, N_COLS)\n\n # -1 has every int32 bit set, so it is the identity for bitwise AND.\n out = torch.full(\n (N_COLS,),\n -1,\n dtype=torch.int32,\n device=x.device,\n )\n\n grid = (N_ROWS, triton.cdiv(N_COLS, BLOCK_SIZE))\n atomic_and_reduce_kernel[grid](\n x,\n out,\n n_rows=N_ROWS,\n n_cols=N_COLS,\n BLOCK_SIZE=BLOCK_SIZE,\n num_warps=4,\n )\n return out\n\n\ndef reference_bitwise_and(x: torch.Tensor) -> torch.Tensor:\n expected = torch.full(\n (N_COLS,),\n -1,\n dtype=torch.int32,\n device=x.device,\n )\n for row in range(N_ROWS):\n expected = torch.bitwise_and(expected, x[row])\n return expected\n\n\ndef main() -> None:\n assert triton.__version__ == \"3.7.1\", (\n f\"This example requires Triton 3.7.1, found {triton.__version__}\"\n )\n assert torch.cuda.is_available(), \"A CUDA GPU is required\"\n\n capability = torch.cuda.get_device_capability()\n assert capability[0] == 12, (\n f\"Blackwell SM12x is required, found compute capability \"\n f\"{capability[0]}.{capability[1]}\"\n )\n\n torch.manual_seed(1234)\n x = torch.randint(\n low=0,\n high=1 << 30,\n size=(N_ROWS, N_COLS),\n dtype=torch.int32,\n device=\"cuda\",\n )\n\n # Preserve a known set of bits across every row so the reduction is\n # nontrivial instead of converging almost entirely to zero.\n common_bits = torch.tensor(0x15555555, dtype=torch.int32, device=\"cuda\")\n x = torch.bitwise_or(x, common_bits).contiguous()\n\n actual = atomic_and_reduce(x)\n expected = reference_bitwise_and(x)\n\n torch.cuda.synchronize()\n assert torch.allclose(actual, expected, rtol=0.0, atol=0.0), (\n f\"Mismatch: maximum absolute difference \"\n f\"{(actual.to(torch.int64) - expected.to(torch.int64)).abs().max().item()}\"\n )\n\n print(\"SPARKPROOF_TRITON_PASS\")\n\n\nif __name__ == \"__main__\":\n main()\n```", "provider": "openai", "model": "gpt-4o-mini", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "reasoning": null, "gateway": "yunwu", "api_base": "https://yunwu.ai/v1", "request_url": "https://yunwu.ai/v1/chat/completions", "gateway_model": "gpt-5.6-sol", "openrouter_model": "gpt-5.6-sol", "request_sha256": "8b2d9c399a74a9c7e0031155e0d911c8b539cd2989fdf34acc07cb121e9fb64f", "response_sha256": "86c3f67fcf4da7f6a2acf6b1d2ee2c67fc736d6efcfa4cbc679339e9abfa808c", "metadata": {"finish_reason": "stop", "native_finish_reason": null, "usage": {"prompt_tokens": 1582, "completion_tokens": 1839, "total_tokens": 3421, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 1034}}, "gateway_generation_id": "chatcmpl-49ba0829-a0d7-4933-a1cb-cb2c1f9b00c2", "gateway_response_model": "gpt-5.6-sol", "gateway_reasoning_effort": "xhigh", "gateway_max_tokens": 4096, "gateway_temperature": 0.7, "prompt_meta": {"prompt": "Write a complete Triton 3.7.1 kernel on Blackwell SM12x that **must use** `tl.atomic_and`.\nDefine exact input shapes/dtypes, include @triton.jit, launcher, masks, and torch.allclose test.\n\nContext:\nCategory: Atomic Ops\nAPI: tl.atomic_and\nSymbol: atomic_and (triton.language)", "task_id": "api_tl_atomic_and", "source": "api_doc", "origin": "api_doc", "category": "kernel_write", "target_api": "tl.atomic_and", "doc_chunk_id": "api_tl_atomic_and", "title": "atomic_and", "split": "train"}, "tier": "gold", "gateway_model": "gpt-4o-mini"}, "sparkproof_validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}, "code_sha256": "dfa544dee37ad4b9d4bbe0314f1eee844e50d411a2a4579cedd961b4c0e0225a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}}
2
+ {"prompt": "Your prior Triton 3.7.1 answer failed Blackwell validation.\nFailure: benchmark_below_floor\nTrace tail:\nSPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n\n\nReturn corrected **complete runnable Python** (kernel + launcher + torch.allclose test).\n\n```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.jit\ndef softmax_kernel(\n out_ptr,\n in_ptr,\n in_stride_row,\n out_stride_row,\n ncols: tl.constexpr,\n BLOCK: tl.constexpr,\n):\n row = tl.program_id(0)\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n\n values = tl.load(\n in_ptr + row * in_stride_row + cols,\n mask=mask,\n other=-float(\"inf\"),\n ).to(tl.float32)\n\n row_max = tl.max(values, axis=0)\n numerators = tl.exp(values - row_max)\n denominator = tl.sum(numerators, axis=0)\n output = numerators / denominator\n\n tl.store(\n out_ptr + row * out_stride_row + cols,\n output,\n mask=mask,\n )\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n if x.ndim != 2:\n raise ValueError(\"launch_softmax expects a 2D tensor\")\n if not x.is_cuda:\n raise ValueError(\"launch_softmax expects a CUDA tensor\")\n if x.dtype not in (torch.float16, torch.bfloat16, torch.float32):\n raise ValueError(\"supported dtypes are float16, bfloat16, and float32\")\n\n rows, ncols = x.shape\n if rows == 0:\n return torch.empty_like(x)\n if not 1 <= ncols <= 2048:\n raise ValueError(\"ncols must be in the range [1, 2048]\")\n\n x = x.contiguous()\n out = torch.empty_like(x)\n\n # BLOCK must always cover the complete row. Autotuning between BLOCK=1024\n # and BLOCK=2048 is invalid for rows wider than 1024 because autotuning\n # measures performance, not correctness.\n block = triton.next_power_of_2(ncols)\n num_warps = 8 if block >= 2048 else 4\n\n softmax_kernel[(rows,)](\n out,\n x,\n x.stride(0),\n out.stride(0),\n ncols=ncols,\n BLOCK=block,\n num_warps=num_warps,\n num_stages=2,\n )\n return out\n\n\ndef test_kernel() -> None:\n if not torch.cuda.is_available():\n raise RuntimeError(\"CUDA is required\")\n\n torch.manual_seed(0)\n\n shapes = [\n (8, 1),\n (8, 127),\n (8, 1003),\n (5, 1024),\n (3, 1537),\n (2, 2048),\n ]\n\n for dtype in (torch.float32, torch.float16, torch.bfloat16):\n for rows, ncols in shapes:\n x = torch.randn(\n (rows, ncols),\n device=\"cuda\",\n dtype=dtype,\n )\n\n actual = launch_softmax(x)\n expected = torch.softmax(x, dim=-1)\n\n if dtype == torch.float32:\n rtol, atol = 1e-4, 1e-5\n else:\n rtol, atol = 2e-3, 2e-3\n\n assert torch.allclose(actual, expected, rtol=rtol, atol=atol), (\n f\"softmax mismatch for shape={(rows, ncols)}, dtype={dtype}, \"\n f\"max_error={(actual.float() - expected.float()).abs().max().item()}\"\n )\n\n\nif __name__ == \"__main__\":\n test_kernel()\n print(\"SPARKPROOF_TRITON_PASS\")\n\n```", "response": "```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.jit\ndef softmax_kernel(\n out_ptr,\n in_ptr,\n nrows,\n ncols: tl.constexpr,\n BLOCK_N: tl.constexpr,\n ROWS_PER_PROGRAM: tl.constexpr,\n):\n program_id = tl.program_id(0)\n\n row_offsets = (\n program_id * ROWS_PER_PROGRAM\n + tl.arange(0, ROWS_PER_PROGRAM)\n )\n col_offsets = tl.arange(0, BLOCK_N)\n\n rows = row_offsets[:, None]\n cols = col_offsets[None, :]\n mask = (rows < nrows) & (cols < ncols)\n offsets = rows * ncols + cols\n\n values = tl.load(\n in_ptr + offsets,\n mask=mask,\n other=-float(\"inf\"),\n ).to(tl.float32)\n\n row_max = tl.max(values, axis=1)\n numerators = tl.exp(values - row_max[:, None])\n reciprocal_sum = 1.0 / tl.sum(numerators, axis=1)\n output = numerators * reciprocal_sum[:, None]\n\n tl.store(out_ptr + offsets, output, mask=mask)\n\n\ndef _launch_config(rows: int, block_n: int) -> tuple[int, int]:\n # Batch narrow rows into one program to avoid launching mostly idle CTAs.\n if block_n <= 32:\n rows_per_program = 32\n elif block_n <= 64:\n rows_per_program = 16\n elif block_n <= 128:\n rows_per_program = 8\n elif block_n <= 256:\n rows_per_program = 4\n elif block_n <= 512:\n rows_per_program = 2\n else:\n rows_per_program = 1\n\n while rows_per_program > rows and rows_per_program > 1:\n rows_per_program //= 2\n\n tile_elements = block_n * rows_per_program\n if block_n >= 2048:\n num_warps = 8\n elif tile_elements >= 512:\n num_warps = 4\n elif tile_elements >= 128:\n num_warps = 2\n else:\n num_warps = 1\n\n return rows_per_program, num_warps\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n if x.ndim != 2:\n raise ValueError(\"launch_softmax expects a 2D tensor\")\n if not x.is_cuda:\n raise ValueError(\"launch_softmax expects a CUDA tensor\")\n if x.dtype not in (torch.float16, torch.bfloat16, torch.float32):\n raise ValueError(\n \"supported dtypes are float16, bfloat16, and float32\"\n )\n\n rows, ncols = x.shape\n if not 1 <= ncols <= 2048:\n raise ValueError(\"ncols must be in the range [1, 2048]\")\n if rows == 0:\n return torch.empty_like(x)\n\n x = x.contiguous()\n out = torch.empty_like(x)\n\n block_n = triton.next_power_of_2(ncols)\n rows_per_program, num_warps = _launch_config(rows, block_n)\n grid = (triton.cdiv(rows, rows_per_program),)\n\n softmax_kernel[grid](\n out,\n x,\n rows,\n ncols=ncols,\n BLOCK_N=block_n,\n ROWS_PER_PROGRAM=rows_per_program,\n num_warps=num_warps,\n num_stages=1,\n )\n return out\n\n\ndef test_kernel() -> None:\n if not torch.cuda.is_available():\n raise RuntimeError(\"CUDA is required\")\n\n torch.manual_seed(0)\n\n shapes = [\n (8, 1),\n (37, 31),\n (65, 64),\n (129, 127),\n (67, 255),\n (35, 511),\n (17, 1003),\n (5, 1024),\n (3, 1537),\n (2, 2048),\n ]\n\n for dtype in (torch.float32, torch.float16, torch.bfloat16):\n for rows, ncols in shapes:\n x = torch.randn(\n (rows, ncols),\n device=\"cuda\",\n dtype=dtype,\n )\n\n actual = launch_softmax(x)\n expected = torch.softmax(x, dim=-1)\n\n if dtype == torch.float32:\n rtol, atol = 1e-4, 1e-5\n else:\n rtol, atol = 2e-3, 2e-3\n\n max_error = (\n actual.float() - expected.float()\n ).abs().max().item()\n\n assert torch.allclose(\n actual,\n expected,\n rtol=rtol,\n atol=atol,\n ), (\n f\"softmax mismatch for shape={(rows, ncols)}, \"\n f\"dtype={dtype}, max_error={max_error}\"\n )\n\n base = torch.randn(\n (41, 257 * 2),\n device=\"cuda\",\n dtype=torch.float16,\n )\n noncontiguous = base[:, ::2]\n actual = launch_softmax(noncontiguous)\n expected = torch.softmax(noncontiguous, dim=-1)\n assert torch.allclose(actual, expected, rtol=2e-3, atol=2e-3)\n\n\nif __name__ == \"__main__\":\n test_kernel()\n print(\"SPARKPROOF_TRITON_PASS\")\n```", "provider": "openai", "model": "gpt-4o-mini", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "reasoning": null, "gateway": "yunwu", "api_base": "https://yunwu.ai/v1", "request_url": "https://yunwu.ai/v1/chat/completions", "gateway_model": "gpt-5.6-sol", "openrouter_model": "gpt-5.6-sol", "request_sha256": "cf588910f1dee334178b4b24b33ec89c3c2e58292ab63bddfbc8a0badb2a2a3b", "response_sha256": "6bc4573f4828d65bbdaa6504267c50cee8ad6219db3d312b463e43571e2845dc", "metadata": {"finish_reason": "stop", "native_finish_reason": null, "usage": {"prompt_tokens": 2363, "completion_tokens": 4451, "total_tokens": 6814, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 3248}}, "gateway_generation_id": "chatcmpl-8ec7c592-fabb-411b-8ff9-71f090a95606", "gateway_response_model": "gpt-5.6-sol", "gateway_reasoning_effort": "xhigh", "gateway_max_tokens": 4096, "gateway_temperature": 0.7, "prompt_meta": {"prompt": "The following Triton 3.7.1 kernel fails or is numerically wrong. Diagnose the bug and return corrected, runnable code with a torch.allclose test. End with: print(\"SPARKPROOF_TRITON_PASS\"). Do NOT pass BLOCK= to the kernel launch when @triton.autotune is used.\n\n```python\nimport torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n\n```", "task_id": "mutate_softmax_row_strip_boundary_mask", "source": "mutation", "origin": "mutation", "category": "debugging", "ground_truth_code": "\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.autotune(\n configs=[\n triton.Config({\"BLOCK\": 1024}, num_warps=4, num_stages=2),\n triton.Config({\"BLOCK\": 2048}, num_warps=8, num_stages=2),\n ],\n key=[\"ncols\"],\n)\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols, mask=mask, other=-float(\"inf\"))\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out, mask=mask)\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\n\ndef test_kernel():\n x = torch.randn(8, 1003, device=\"cuda\", dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=1e-3, atol=1e-3)\n\n\ntest_kernel()\nprint(\"SPARKPROOF_TRITON_PASS\")\n", "broken_code": "import torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n", "mutation_reason": "Removed boundary masks from tl.load/tl.store.", "task_family": "softmax_row", "split": "train"}, "tier": "repair", "gateway_model": "gpt-4o-mini"}, "sparkproof_validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}, "code_sha256": "342365041a5128936f811acbf6861d281ecd4a4401c52a7a23606299f6b0157a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}}
proof/trajectories_raw.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"prompt": "Write a complete Triton 3.7.1 kernel on Blackwell SM12x that **must use** `tl.atomic_and`.\nDefine exact input shapes/dtypes, include @triton.jit, launcher, masks, and torch.allclose test.\n\nContext:\nCategory: Atomic Ops\nAPI: tl.atomic_and\nSymbol: atomic_and (triton.language)", "response": "```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n# Exact input contract:\n# x: contiguous CUDA tensor, shape (37, 1003), dtype=torch.int32\n# Output:\n# out[col] = bitwise AND of x[:, col], shape (1003,), dtype=torch.int32\nN_ROWS = 37\nN_COLS = 1003\nBLOCK_SIZE = 256\n\n\n@triton.jit\ndef atomic_and_reduce_kernel(\n x_ptr,\n out_ptr,\n n_rows: tl.constexpr,\n n_cols: tl.constexpr,\n BLOCK_SIZE: tl.constexpr,\n):\n row = tl.program_id(axis=0)\n col_block = tl.program_id(axis=1)\n\n cols = col_block * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)\n mask = (row < n_rows) & (cols < n_cols)\n\n values = tl.load(\n x_ptr + row * n_cols + cols,\n mask=mask,\n other=-1,\n )\n tl.atomic_and(out_ptr + cols, values, mask=mask)\n\n\ndef atomic_and_reduce(x: torch.Tensor) -> torch.Tensor:\n assert x.is_cuda\n assert x.is_contiguous()\n assert x.dtype == torch.int32\n assert x.shape == (N_ROWS, N_COLS)\n\n # -1 has every int32 bit set, so it is the identity for bitwise AND.\n out = torch.full(\n (N_COLS,),\n -1,\n dtype=torch.int32,\n device=x.device,\n )\n\n grid = (N_ROWS, triton.cdiv(N_COLS, BLOCK_SIZE))\n atomic_and_reduce_kernel[grid](\n x,\n out,\n n_rows=N_ROWS,\n n_cols=N_COLS,\n BLOCK_SIZE=BLOCK_SIZE,\n num_warps=4,\n )\n return out\n\n\ndef reference_bitwise_and(x: torch.Tensor) -> torch.Tensor:\n expected = torch.full(\n (N_COLS,),\n -1,\n dtype=torch.int32,\n device=x.device,\n )\n for row in range(N_ROWS):\n expected = torch.bitwise_and(expected, x[row])\n return expected\n\n\ndef main() -> None:\n assert triton.__version__ == \"3.7.1\", (\n f\"This example requires Triton 3.7.1, found {triton.__version__}\"\n )\n assert torch.cuda.is_available(), \"A CUDA GPU is required\"\n\n capability = torch.cuda.get_device_capability()\n assert capability[0] == 12, (\n f\"Blackwell SM12x is required, found compute capability \"\n f\"{capability[0]}.{capability[1]}\"\n )\n\n torch.manual_seed(1234)\n x = torch.randint(\n low=0,\n high=1 << 30,\n size=(N_ROWS, N_COLS),\n dtype=torch.int32,\n device=\"cuda\",\n )\n\n # Preserve a known set of bits across every row so the reduction is\n # nontrivial instead of converging almost entirely to zero.\n common_bits = torch.tensor(0x15555555, dtype=torch.int32, device=\"cuda\")\n x = torch.bitwise_or(x, common_bits).contiguous()\n\n actual = atomic_and_reduce(x)\n expected = reference_bitwise_and(x)\n\n torch.cuda.synchronize()\n assert torch.allclose(actual, expected, rtol=0.0, atol=0.0), (\n f\"Mismatch: maximum absolute difference \"\n f\"{(actual.to(torch.int64) - expected.to(torch.int64)).abs().max().item()}\"\n )\n\n print(\"SPARKPROOF_TRITON_PASS\")\n\n\nif __name__ == \"__main__\":\n main()\n```", "provider": "openai", "model": "gpt-5.6", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "reasoning": null, "gateway": "yunwu", "api_base": "https://yunwu.ai/v1", "request_url": "https://yunwu.ai/v1/chat/completions", "gateway_model": "gpt-5.6-sol", "openrouter_model": "gpt-5.6-sol", "request_sha256": "8b2d9c399a74a9c7e0031155e0d911c8b539cd2989fdf34acc07cb121e9fb64f", "response_sha256": "86c3f67fcf4da7f6a2acf6b1d2ee2c67fc736d6efcfa4cbc679339e9abfa808c", "metadata": {"finish_reason": "stop", "native_finish_reason": null, "usage": {"prompt_tokens": 1582, "completion_tokens": 1839, "total_tokens": 3421, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 1034}}, "gateway_generation_id": "chatcmpl-49ba0829-a0d7-4933-a1cb-cb2c1f9b00c2", "gateway_response_model": "gpt-5.6-sol", "gateway_reasoning_effort": "xhigh", "gateway_max_tokens": 4096, "gateway_temperature": 0.7, "prompt_meta": {"prompt": "Write a complete Triton 3.7.1 kernel on Blackwell SM12x that **must use** `tl.atomic_and`.\nDefine exact input shapes/dtypes, include @triton.jit, launcher, masks, and torch.allclose test.\n\nContext:\nCategory: Atomic Ops\nAPI: tl.atomic_and\nSymbol: atomic_and (triton.language)", "task_id": "api_tl_atomic_and", "source": "api_doc", "origin": "api_doc", "category": "kernel_write", "target_api": "tl.atomic_and", "doc_chunk_id": "api_tl_atomic_and", "title": "atomic_and", "split": "train"}, "tier": "gold"}, "sparkproof_validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}, "code_sha256": "dfa544dee37ad4b9d4bbe0314f1eee844e50d411a2a4579cedd961b4c0e0225a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}}
2
+ {"prompt": "Your prior Triton 3.7.1 answer failed Blackwell validation.\nFailure: benchmark_below_floor\nTrace tail:\nSPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n\n\nReturn corrected **complete runnable Python** (kernel + launcher + torch.allclose test).\n\n```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.jit\ndef softmax_kernel(\n out_ptr,\n in_ptr,\n in_stride_row,\n out_stride_row,\n ncols: tl.constexpr,\n BLOCK: tl.constexpr,\n):\n row = tl.program_id(0)\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n\n values = tl.load(\n in_ptr + row * in_stride_row + cols,\n mask=mask,\n other=-float(\"inf\"),\n ).to(tl.float32)\n\n row_max = tl.max(values, axis=0)\n numerators = tl.exp(values - row_max)\n denominator = tl.sum(numerators, axis=0)\n output = numerators / denominator\n\n tl.store(\n out_ptr + row * out_stride_row + cols,\n output,\n mask=mask,\n )\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n if x.ndim != 2:\n raise ValueError(\"launch_softmax expects a 2D tensor\")\n if not x.is_cuda:\n raise ValueError(\"launch_softmax expects a CUDA tensor\")\n if x.dtype not in (torch.float16, torch.bfloat16, torch.float32):\n raise ValueError(\"supported dtypes are float16, bfloat16, and float32\")\n\n rows, ncols = x.shape\n if rows == 0:\n return torch.empty_like(x)\n if not 1 <= ncols <= 2048:\n raise ValueError(\"ncols must be in the range [1, 2048]\")\n\n x = x.contiguous()\n out = torch.empty_like(x)\n\n # BLOCK must always cover the complete row. Autotuning between BLOCK=1024\n # and BLOCK=2048 is invalid for rows wider than 1024 because autotuning\n # measures performance, not correctness.\n block = triton.next_power_of_2(ncols)\n num_warps = 8 if block >= 2048 else 4\n\n softmax_kernel[(rows,)](\n out,\n x,\n x.stride(0),\n out.stride(0),\n ncols=ncols,\n BLOCK=block,\n num_warps=num_warps,\n num_stages=2,\n )\n return out\n\n\ndef test_kernel() -> None:\n if not torch.cuda.is_available():\n raise RuntimeError(\"CUDA is required\")\n\n torch.manual_seed(0)\n\n shapes = [\n (8, 1),\n (8, 127),\n (8, 1003),\n (5, 1024),\n (3, 1537),\n (2, 2048),\n ]\n\n for dtype in (torch.float32, torch.float16, torch.bfloat16):\n for rows, ncols in shapes:\n x = torch.randn(\n (rows, ncols),\n device=\"cuda\",\n dtype=dtype,\n )\n\n actual = launch_softmax(x)\n expected = torch.softmax(x, dim=-1)\n\n if dtype == torch.float32:\n rtol, atol = 1e-4, 1e-5\n else:\n rtol, atol = 2e-3, 2e-3\n\n assert torch.allclose(actual, expected, rtol=rtol, atol=atol), (\n f\"softmax mismatch for shape={(rows, ncols)}, dtype={dtype}, \"\n f\"max_error={(actual.float() - expected.float()).abs().max().item()}\"\n )\n\n\nif __name__ == \"__main__\":\n test_kernel()\n print(\"SPARKPROOF_TRITON_PASS\")\n\n```", "response": "```python\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.jit\ndef softmax_kernel(\n out_ptr,\n in_ptr,\n nrows,\n ncols: tl.constexpr,\n BLOCK_N: tl.constexpr,\n ROWS_PER_PROGRAM: tl.constexpr,\n):\n program_id = tl.program_id(0)\n\n row_offsets = (\n program_id * ROWS_PER_PROGRAM\n + tl.arange(0, ROWS_PER_PROGRAM)\n )\n col_offsets = tl.arange(0, BLOCK_N)\n\n rows = row_offsets[:, None]\n cols = col_offsets[None, :]\n mask = (rows < nrows) & (cols < ncols)\n offsets = rows * ncols + cols\n\n values = tl.load(\n in_ptr + offsets,\n mask=mask,\n other=-float(\"inf\"),\n ).to(tl.float32)\n\n row_max = tl.max(values, axis=1)\n numerators = tl.exp(values - row_max[:, None])\n reciprocal_sum = 1.0 / tl.sum(numerators, axis=1)\n output = numerators * reciprocal_sum[:, None]\n\n tl.store(out_ptr + offsets, output, mask=mask)\n\n\ndef _launch_config(rows: int, block_n: int) -> tuple[int, int]:\n # Batch narrow rows into one program to avoid launching mostly idle CTAs.\n if block_n <= 32:\n rows_per_program = 32\n elif block_n <= 64:\n rows_per_program = 16\n elif block_n <= 128:\n rows_per_program = 8\n elif block_n <= 256:\n rows_per_program = 4\n elif block_n <= 512:\n rows_per_program = 2\n else:\n rows_per_program = 1\n\n while rows_per_program > rows and rows_per_program > 1:\n rows_per_program //= 2\n\n tile_elements = block_n * rows_per_program\n if block_n >= 2048:\n num_warps = 8\n elif tile_elements >= 512:\n num_warps = 4\n elif tile_elements >= 128:\n num_warps = 2\n else:\n num_warps = 1\n\n return rows_per_program, num_warps\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n if x.ndim != 2:\n raise ValueError(\"launch_softmax expects a 2D tensor\")\n if not x.is_cuda:\n raise ValueError(\"launch_softmax expects a CUDA tensor\")\n if x.dtype not in (torch.float16, torch.bfloat16, torch.float32):\n raise ValueError(\n \"supported dtypes are float16, bfloat16, and float32\"\n )\n\n rows, ncols = x.shape\n if not 1 <= ncols <= 2048:\n raise ValueError(\"ncols must be in the range [1, 2048]\")\n if rows == 0:\n return torch.empty_like(x)\n\n x = x.contiguous()\n out = torch.empty_like(x)\n\n block_n = triton.next_power_of_2(ncols)\n rows_per_program, num_warps = _launch_config(rows, block_n)\n grid = (triton.cdiv(rows, rows_per_program),)\n\n softmax_kernel[grid](\n out,\n x,\n rows,\n ncols=ncols,\n BLOCK_N=block_n,\n ROWS_PER_PROGRAM=rows_per_program,\n num_warps=num_warps,\n num_stages=1,\n )\n return out\n\n\ndef test_kernel() -> None:\n if not torch.cuda.is_available():\n raise RuntimeError(\"CUDA is required\")\n\n torch.manual_seed(0)\n\n shapes = [\n (8, 1),\n (37, 31),\n (65, 64),\n (129, 127),\n (67, 255),\n (35, 511),\n (17, 1003),\n (5, 1024),\n (3, 1537),\n (2, 2048),\n ]\n\n for dtype in (torch.float32, torch.float16, torch.bfloat16):\n for rows, ncols in shapes:\n x = torch.randn(\n (rows, ncols),\n device=\"cuda\",\n dtype=dtype,\n )\n\n actual = launch_softmax(x)\n expected = torch.softmax(x, dim=-1)\n\n if dtype == torch.float32:\n rtol, atol = 1e-4, 1e-5\n else:\n rtol, atol = 2e-3, 2e-3\n\n max_error = (\n actual.float() - expected.float()\n ).abs().max().item()\n\n assert torch.allclose(\n actual,\n expected,\n rtol=rtol,\n atol=atol,\n ), (\n f\"softmax mismatch for shape={(rows, ncols)}, \"\n f\"dtype={dtype}, max_error={max_error}\"\n )\n\n base = torch.randn(\n (41, 257 * 2),\n device=\"cuda\",\n dtype=torch.float16,\n )\n noncontiguous = base[:, ::2]\n actual = launch_softmax(noncontiguous)\n expected = torch.softmax(noncontiguous, dim=-1)\n assert torch.allclose(actual, expected, rtol=2e-3, atol=2e-3)\n\n\nif __name__ == \"__main__\":\n test_kernel()\n print(\"SPARKPROOF_TRITON_PASS\")\n```", "provider": "openai", "model": "gpt-5.6", "system": "You are a Triton 3.7.1 GPU kernel expert for Blackwell SM12x. Write complete runnable Python with @triton.jit, launcher, and torch.allclose test. Always end with print(\"SPARKPROOF_TRITON_PASS\") after tests pass.", "reasoning": null, "gateway": "yunwu", "api_base": "https://yunwu.ai/v1", "request_url": "https://yunwu.ai/v1/chat/completions", "gateway_model": "gpt-5.6-sol", "openrouter_model": "gpt-5.6-sol", "request_sha256": "cf588910f1dee334178b4b24b33ec89c3c2e58292ab63bddfbc8a0badb2a2a3b", "response_sha256": "6bc4573f4828d65bbdaa6504267c50cee8ad6219db3d312b463e43571e2845dc", "metadata": {"finish_reason": "stop", "native_finish_reason": null, "usage": {"prompt_tokens": 2363, "completion_tokens": 4451, "total_tokens": 6814, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 3248}}, "gateway_generation_id": "chatcmpl-8ec7c592-fabb-411b-8ff9-71f090a95606", "gateway_response_model": "gpt-5.6-sol", "gateway_reasoning_effort": "xhigh", "gateway_max_tokens": 4096, "gateway_temperature": 0.7, "prompt_meta": {"prompt": "The following Triton 3.7.1 kernel fails or is numerically wrong. Diagnose the bug and return corrected, runnable code with a torch.allclose test. End with: print(\"SPARKPROOF_TRITON_PASS\"). Do NOT pass BLOCK= to the kernel launch when @triton.autotune is used.\n\n```python\nimport torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n\n```", "task_id": "mutate_softmax_row_strip_boundary_mask", "source": "mutation", "origin": "mutation", "category": "debugging", "ground_truth_code": "\nimport torch\nimport triton\nimport triton.language as tl\n\n\n@triton.autotune(\n configs=[\n triton.Config({\"BLOCK\": 1024}, num_warps=4, num_stages=2),\n triton.Config({\"BLOCK\": 2048}, num_warps=8, num_stages=2),\n ],\n key=[\"ncols\"],\n)\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols, mask=mask, other=-float(\"inf\"))\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out, mask=mask)\n\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\n\ndef test_kernel():\n x = torch.randn(8, 1003, device=\"cuda\", dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=1e-3, atol=1e-3)\n\n\ntest_kernel()\nprint(\"SPARKPROOF_TRITON_PASS\")\n", "broken_code": "import torch\nimport triton\nimport triton.language as tl\n\n@triton.autotune(configs=[triton.Config({'BLOCK': 1024}, num_warps=4, num_stages=2), triton.Config({'BLOCK': 2048}, num_warps=8, num_stages=2)], key=['ncols'])\n@triton.jit\ndef softmax_kernel(out_ptr, in_ptr, stride_row, ncols, BLOCK: tl.constexpr):\n row = tl.program_id(0)\n row_in = in_ptr + row * stride_row\n cols = tl.arange(0, BLOCK)\n mask = cols < ncols\n vals = tl.load(row_in + cols)\n vals = vals.to(tl.float32)\n row_max = tl.max(vals, axis=0)\n vals = vals - row_max\n num = tl.exp(vals)\n den = tl.sum(num, axis=0)\n out = num / den\n tl.store(out_ptr + row * stride_row + cols, out)\n\ndef launch_softmax(x: torch.Tensor) -> torch.Tensor:\n rows, cols = x.shape\n out = torch.empty_like(x)\n grid = (rows,)\n softmax_kernel[grid](out, x, x.stride(0), cols)\n return out\n\ndef test_kernel():\n x = torch.randn(8, 1003, device='cuda', dtype=torch.float32)\n out = launch_softmax(x)\n ref = torch.softmax(x, dim=-1)\n assert torch.allclose(out, ref, rtol=0.001, atol=0.001)\ntest_kernel()\nprint('SPARKPROOF_TRITON_PASS')\n", "mutation_reason": "Removed boundary masks from tl.load/tl.store.", "task_family": "softmax_row", "split": "train"}, "tier": "repair"}, "sparkproof_validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}, "code_sha256": "342365041a5128936f811acbf6861d281ecd4a4401c52a7a23606299f6b0157a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}}
proof/validation_report.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"index": 0, "provider": "openai", "prompt_sha256": "c196da772db20ceb8b21e1b4b5e141460abe71eb831f85bea0b17aaa49d96a66", "validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}, "code_sha256": "dfa544dee37ad4b9d4bbe0314f1eee844e50d411a2a4579cedd961b4c0e0225a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 1.0}, "composite_score": 0.6}}}
2
+ {"index": 1, "provider": "openai", "prompt_sha256": "d520da52e4be3f5c6b9487ba974ac173dd14534dd43facffada4e30961cc3e22", "validation": {"passed": true, "triton_version": "3.7.1", "stages": {"syntax": {"passed": true}, "triton_api": {"passed": true, "details": {"modern": true, "issues": [], "features_used": [], "deprecated_used": []}}, "compile_execute": {"passed": true, "output_tail": "SPARKPROOF_TRITON_PASS\nSPARKPROOF_TRITON_PASS\n"}, "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}, "code_sha256": "342365041a5128936f811acbf6861d281ecd4a4401c52a7a23606299f6b0157a", "benchmark": {"checks": {"correctness": 1.0, "autotune": 0.0, "block_tiling": 0.0, "launch_grid": 1.0, "blackwell_hint": 0.0}, "composite_score": 0.4}}}