Qwen2.5-0.5B-HARGO-HPC
Qwen2.5-0.5B-Instruct fine-tuned with HARGO (Heterogeneity-Aware Reward-Guided Optimization) for high-performance computing tasks.
What It Does
This model handles four HPC tasks:
| Task | Description | Output |
|---|---|---|
| race_c | C/C++ OpenMP data race detection | yes / no |
| race_fortran | Fortran OpenMP data race detection | yes / no |
| mlperf | HPC benchmark factual QA | Short factual answer |
| plp | Programming language processing QA | Descriptive answer |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "swaggy/Qwen2.5-0.5B-HARGO-HPC"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "You are an expert in parallel programming and data race detection. Given a C/C++ code snippet with OpenMP directives, determine whether a data race exists. Answer ONLY 'yes' or 'no'."},
{"role": "user", "content": "<your code snippet here>"},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
Training
- Base model: Qwen2.5-0.5B-Instruct
- Stage 1 (SFT): Fine-tuned on the HPC-GPT instruction dataset (5,273 samples, 2 epochs)
- Stage 2 (RL): HARGO reward-guided optimization with per-response adaptive weighting (3 epochs)
- Hardware: Single RTX 3080 (16 GB)