Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Triton Kernel Code Generation Model
|
| 2 |
+
|
| 3 |
+
This model is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct specialized for generating Triton GPU kernels.
|
| 4 |
+
|
| 5 |
+
## Model Details
|
| 6 |
+
|
| 7 |
+
- **Base Model**: Qwen/Qwen2.5-1.5B-Instruct
|
| 8 |
+
- **Fine-tuned on**: 6000 examples of Triton kernel code
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
## Usage
|
| 12 |
+
|
| 13 |
+
```python
|
| 14 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 15 |
+
|
| 16 |
+
model = AutoModelForCausalLM.from_pretrained("cdreetz/kwen2.5-1.5b-v2")
|
| 17 |
+
tokenizer = AutoTokenizer.from_pretrained("cdreetz/kwen2.5-1.5b-v2")
|
| 18 |
+
|
| 19 |
+
prompt = "Write a Triton kernel for element-wise addition:"
|
| 20 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 21 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 22 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 23 |
+
print(response)
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
## Limitations
|
| 28 |
+
|
| 29 |
+
- Specialized for Triton kernel generation only
|
| 30 |
+
- May require prompt engineering for optimal results
|
| 31 |
+
- Generated kernels should be tested before production use
|