Dataset Viewer
Auto-converted to Parquet Duplicate
entry_point
stringlengths
1
65
original_triton_python_code
stringlengths
208
619k
optimised_triton_code
stringlengths
1.15k
275k
repo_name
stringlengths
7
115
module_name
stringlengths
1
65
synthetic
bool
1 class
uuid
int64
0
18.5k
licenses
listlengths
1
6
stars
int64
0
19.8k
sha
stringlengths
40
40
repo_link
stringlengths
72
180
ResidualDenseBlock
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
cyun-404/PieESRGAN
ResidualDenseBlock
false
3,381
[ "Apache-2.0" ]
0
22ffe683bf2389b646429494d1bc88e61a9d72c5
https://github.com/cyun-404/PieESRGAN/tree/22ffe683bf2389b646429494d1bc88e61a9d72c5
TanhGaussianDistParams
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
MrSyee/rl_algorithms
TanhGaussianDistParams
false
5,618
[ "MIT" ]
1
5b5276982032f8a8a614b9466849b7b3ef245b3e
https://github.com/MrSyee/rl_algorithms/tree/5b5276982032f8a8a614b9466849b7b3ef245b3e
GaussianFocalLoss
# AOT ID: ['0_inference'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _al...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import functools impor...
Andrew-Zhu/DyFPN
GaussianFocalLoss
false
7,729
[ "Apache-2.0" ]
32
a74463b59c4ce28253c2449a07c0f6692a0147a1
https://github.com/Andrew-Zhu/DyFPN/tree/a74463b59c4ce28253c2449a07c0f6692a0147a1
DecoderLayer
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
superMC5657/transformer
DecoderLayer
false
10,892
[ "MIT" ]
0
b9d9ca3a5f307f6587330a8235e8d5a2a3650510
https://github.com/superMC5657/transformer/tree/b9d9ca3a5f307f6587330a8235e8d5a2a3650510
FrameMaxPool
import torch import torch.nn as nn class FrameMaxPool(nn.Module): def __init__(self, input_size, hidden_size, stride): super(FrameMaxPool, self).__init__() self.vis_conv = nn.Conv1d(input_size, hidden_size, 1, 1) self.max_pool = nn.MaxPool1d(stride) def forward(self, visual_input): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
CFM-MSG/Code_LEORN
FrameMaxPool
false
4,922
[ "MIT" ]
1
fabea1e1ded973a4db692e51e2df442bde55f626
https://github.com/CFM-MSG/Code_LEORN/tree/fabea1e1ded973a4db692e51e2df442bde55f626
ConvEncoder
# AOT ID: ['0_forward'] from ctypes import c_void_p, c_long, c_int import torch import math import random import os import tempfile from math import inf, nan from torch._inductor.hooks import run_intermediate_hooks from torch._inductor.utils import maybe_profile from torch._inductor.codegen.memory_planning import _alig...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import ...
amyhemmeter/baseline
ConvEncoder
false
3,093
[ "Apache-2.0" ]
0
101a393398570747d14a32eb3af72664e2774c8b
https://github.com/amyhemmeter/baseline/tree/101a393398570747d14a32eb3af72664e2774c8b
Mlp
"# AOT ID: ['0_forward']\nfrom ctypes import c_void_p, c_long, c_int\nimport torch\nimport math\nimp(...TRUNCATED)
"import torch\nfrom torch._inductor.select_algorithm import extern_kernels\nimport triton\nimport tr(...TRUNCATED)
bubbliiiing/classification-pytorch
Mlp
false
14,988
[ "MIT" ]
88
ee62c05bd3094c3fab48bada5a57cb2ed8b61c11
https://github.com/bubbliiiing/classification-pytorch/tree/ee62c05bd3094c3fab48bada5a57cb2ed8b61c11
WRNUnit
"# AOT ID: ['0_forward']\nfrom ctypes import c_void_p, c_long, c_int\nimport torch\nimport math\nimp(...TRUNCATED)
"import torch\nfrom torch._inductor.select_algorithm import extern_kernels\nimport triton\nimport tr(...TRUNCATED)
HyperGAN/imgclsmob
WRNUnit
false
17,691
[ "MIT" ]
9
88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3
https://github.com/HyperGAN/imgclsmob/tree/88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3
RobertaClassificationHead
"# AOT ID: ['0_forward']\nfrom ctypes import c_void_p, c_long, c_int\nimport torch\nimport math\nimp(...TRUNCATED)
"import torch\nfrom torch._inductor.select_algorithm import extern_kernels\nimport triton\nimport tr(...TRUNCATED)
AlexShypula/CodeGen
RobertaClassificationHead
false
14,554
[ "MIT" ]
241
2e5f8090c4369fd3f0ebec4a867503edc1362d5d
https://github.com/AlexShypula/CodeGen/tree/2e5f8090c4369fd3f0ebec4a867503edc1362d5d
RealConv2d
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass RealConv2d(nn.Modul(...TRUNCATED)
"import torch\nfrom torch._inductor.select_algorithm import extern_kernels\nimport triton\nimport tr(...TRUNCATED)
JamesLiao714/FullSubNet
RealConv2d
false
607
[ "MIT" ]
0
dad740bac35b5d7544c97740ae59101455acdc40
https://github.com/JamesLiao714/FullSubNet/tree/dad740bac35b5d7544c97740ae59101455acdc40
End of preview. Expand in Data Studio

TEEN-D/Code_Opt_Triton_Shuffled

Overview

This dataset, TEEN-D/Code_Opt_Triton_Shuffled, is a shuffled version of the extended TEEN-D/Code_Opt_Triton dataset (which itself is an extension of GPUMODE/Inductor_Created_Data_Permissive). It provides a collection of pairs of original (PyTorch or Triton) programs and their corresponding optimized Triton code, designed for training machine learning models for code translation and optimization tasks targeting GPUs.

The key characteristic of this dataset is that the order of the data points has been randomly shuffled. This randomization is crucial for training robust machine learning models as it helps to prevent the model from learning spurious correlations based on the order of the training examples.

This dataset is part of an effort to improve the ability of LLMs to generate efficient GPU kernels by providing them with a diverse and appropriately structured training dataset.

License: This dataset is derived from the GPUMODE/Inductor_Created_Data_Permissive dataset, which is released under the MIT License. Consequently, this extended and shuffled version is also made available under the MIT License. You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this dataset, subject to the terms of the MIT License.

Rationale

This extended dataset, pairing optimized Triton with both original Triton and Python code, enhances training for preference-based methods like GRPO/DPO by:

  • Providing richer preference signals through diverse (original, optimized) pairs.
  • Improving the LLM's understanding of semantic equivalence between PyTorch and Triton.
  • Reducing bias towards a specific input format (Triton vs. Python).
  • Potentially creating more meaningful comparison groups for GRPO.
  • Offering more diverse "rejected" samples for DPO against the "accepted" optimized Triton.

Dataset Creation

This dataset was created through the following process:

  1. Extension of the Source Dataset: The GPUMODE/Inductor_Created_Data_Permissive dataset was first extended to create the TEEN-D/Code_Opt_Triton dataset. This involved pairing each optimized Triton code snippet with both its original Triton code (if available) and its corresponding Python code.

  2. Shuffling: The resulting extended dataset was then shuffled using the shuffle() method provided by the datasets library. A fixed random seed was used to ensure reproducibility of the shuffling process.

Data Structure

The data structure of this dataset is identical to that of the TEEN-D/Code_Opt_Triton dataset. Each entry includes the following fields:

  • entry_point: The entry point of the code.
  • original_triton_python_code: Contains either the original Triton code or the Python code from the source dataset.
  • optimised_triton_code: The optimized Triton code generated by torch.compile.
  • repo_name: The name of the repository in the format username/repository.
  • module_name: The name of the PyTorch module.
  • synthetic: A boolean indicating if the data is synthetic.
  • uuid: A unique identifier for the entry.
  • licenses: List of licenses associated with the repository.
  • stars: Number of GitHub stars the repository has.
  • sha: The commit SHA hash used for version reference.
  • repo_link: Direct link to the repository at the specific commit (GitHub URL).
  • stringlengths: (Please refer to the README.md of the TEEN-D/Code_Opt_Triton dataset for details on this field.)

The sole difference between this dataset and the original extended version is the randomized order of the examples.

Usage Examples

You can load this shuffled dataset using the datasets library in Python:

from datasets import load_dataset

shuffled_dataset = load_dataset("TEEN-D/Code_Opt_Triton_Shuffled")

# Example: Print the first 5 examples
print(shuffled_dataset['train'][:5])
Downloads last month
10