File size: 2,974 Bytes
6cb5089 b3bf70d 391aaab b3bf70d 6cb5089 |
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 83 84 85 86 87 88 89 90 91 92 |
---
license: mit
language:
- en
---
## Dataset Description
This dataset contains code snippets from Triton-based projects across GitHub, specifically filtered to include only repositories with permissive licenses (MIT, Apache, BSD, etc.). Each entry in the dataset includes:
- Triton code snippet
- Repository information
- File path
- Commit hash
- Direct GitHub URL to the source code
- License information
- Categorization of the code functionality
## Dataset Creation
The dataset was created by:
1. Collecting Triton code snippets from public GitHub repositories
2. Categorizing the code snippets based on functionality (Using claude)
3. Filtering to keep only snippets from repositories with permissive licenses using a custom `should_keep_license` function
## License Information
This dataset is released under the MIT License. However, each code snippet in the dataset comes from a repository with its own specific license (all permissive). The license type for each snippet is included in the dataset.
Permissive licenses included in this dataset:
- MIT
- BSD
- APACHE
- CC0
## Format and Usage
The dataset is provided in two formats:
- JSON format (`permissive_triton_dataset.json`)
- Parquet format (`permissive_triton_dataset.parquet`)
### Sample Data Structure
```json
{
"uuid": "...",
"file_name": "example_triton_file.py",
"repo_name": "username/repo",
"file_path": "path/to/file.py",
"commit_hash": "abcdef123456",
"starcount": 42,
"input": "@triton.jit\ndef example_kernel(...):\n ...",
"category": {
"Functionality": ["Category1", "Category2"]
},
"licenses": ["MIT"],
"github_url": "https://github.com/username/repo/blob/abcdef123456/path/to/file.py"
}
```
### Field Descriptions
| Field | Description |
|-------|-------------|
| `uuid` | Unique identifier for the entry in the dataset |
| `file_name` | Name of the source code file |
| `repo_name` | GitHub repository name in format "username/repo" |
| `file_path` | Path to the file within the repository |
| `commit_hash` | Git commit hash for the specific version of the file |
| `starcount` | Number of stars the repository had at the time of data collection |
| `input` | The actual Triton code snippet |
| `category` | Categorization of the code functionality (labeled using Claude) |
| `licenses` | List of permissive license types applicable to this code |
| `github_url` | Direct URL to view the file on GitHub at the specific commit |
#### Category Types
We consider categories in the following domains: Functionality, Data Type, Performance Objective, Parallelization Strategy, and Memory Access Pattern.
We optinally add labels to each of these domains per entry to try and describe the data (using claude).
### Loading the Dataset
```python
# Using JSON
import json
with open('permissive_triton_dataset.json', 'r') as f:
dataset = json.load(f)
# Using Parquet
import pandas as pd
df = pd.read_parquet('permissive_triton_dataset.parquet')
``` |