Teen-Different's picture
Update README.md
12d4cdb verified
---
license: mit
tags:
- Python
- Pytorch
- Triton
- Kernal-Optimization
language:
- en
pretty_name: s
---
# 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](https://www.google.com/search?q=https://huggingface.co/datasets/TEEN-D/Code_Opt_Triton) dataset (which itself is an extension of [GPUMODE/Inductor_Created_Data_Permissive](https://huggingface.co/datasets/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](https://huggingface.co/datasets/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](https://huggingface.co/datasets/GPUMODE/Inductor_Created_Data_Permissive) dataset was first extended to create the [TEEN-D/Code_Opt_Triton](https://huggingface.co/datasets/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](https://www.google.com/search?q=https://huggingface.co/datasets/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](https://www.google.com/search?q=https://huggingface.co/datasets/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:
```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])