Downloads · 30 days
13
16% of all-time downloads
Daleth-hb/qwen-cuda2hip-lora
qwen-cuda2hip-lora is a machine learning model from Daleth-hb. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
This model is a specialized LoRA adapter for Qwen2.5-Coder-7B-Instruct designed to automate and explain the migration of NVIDIA CUDA source code to AMD ROCm (HIP). It was developed to bridge the portability gap for HP…
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
81
Public
Repo size
51.8 MB
Likes
0
Public
Click a slice to open those files.
.safetensors40.4 MB · 78%
From the Hugging Face model README
This model is a specialized LoRA adapter for Qwen2.5-Coder-7B-Instruct designed to automate and explain the migration of NVIDIA CUDA source code to AMD ROCm (HIP). It was developed to bridge the portability gap for HPC developers targeting the AMD Instinct MI300X architecture.
Qwen-CUDA2HIP-LoRA is fine-tuned using a dual-strategy approach: standard Supervised Fine-Tuning (SFT) for syntax mapping and Reasoning-Aware Fine-Tuning (RAFT) for architectural justification. It doesn't just swap cudaMalloc for hipMalloc; it provides technical context on why certain changes are made, optimized for the CDNA 3 architecture.
float4) for AMD GPUs.import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = "Qwen/Qwen2.5-Coder-7B-Instruct"
adapter = "Daleth-hb/qwen-cuda2hip-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
prompt = "Convert this CUDA kernel to HIP: __global__ void add(int *a, int *b, int *c) { ... }"
# Proceed with standard generation...