File size: 1,194 Bytes
367dc36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: bsd-3-clause
tags:
  - openenv
  - cuda
  - triton
  - gpu-kernels
  - reinforcement-learning
  - grpo
---

# kernrl Training Materials

Training resources for the kernrl GPU kernel optimization environment.

## Overview

This repository contains:
- GRPO training notebook for training LLMs to write optimized GPU kernels
- Example scripts and configurations

## Quick Start

```python
from trl import GRPOConfig, GRPOTrainer
from kernrl import kernrl_env, KernelAction

# Connect to kernrl environment
env = kernrl_env(base_url="http://localhost:8000")

# Train with GRPO
trainer = GRPOTrainer(
    model="Qwen/Qwen2.5-Coder-1.5B-Instruct",
    reward_funcs=[reward_compilation, reward_correctness, reward_speedup],
    train_dataset=dataset,
    rollout_func=rollout_func,
    args=GRPOConfig(use_vllm=True, vllm_mode="colocate"),
)
trainer.train()
```

## Files

- `kernrl_grpo_training.ipynb` - Complete GRPO training notebook
- `train_kernrl.py` - Standalone training script

## Links

- [kernrl Environment](https://huggingface.co/spaces/Infatoshi/kernrl)
- [OpenEnv Repository](https://github.com/meta-pytorch/OpenEnv)
- [TRL Documentation](https://huggingface.co/docs/trl)