A complete walkthrough of LoRA fine-tuning Qwen3-1.7B on the MedMCQA dataset using AMD ROCm on an MI300X GPU, with no CUDA dependencies. The project demonstrates that the HuggingFace ecosystem (Transformers, PEFT, TRL, Accelerate) works seamlessly on ROCm with just three environment variables. Training only 2.2M parameters out of 1.5B takes ~5 minutes on 2,000 samples. The post covers dataset preparation, prompt formatting, LoRA configuration, training arguments, inference code, and a table of common ROCm pitfalls with fixes. The resulting model outputs both a correct answer letter and a clinical explanation for medical MCQs.
Table of contents
The IdeaWhy AMD ROCm?The Dataset: MedMCQAModel: Qwen3-1.7BThe Prompt FormatTraining with LoRAInferenceLoading from HuggingFace HubChallenges and FixesResultsTry It YourselfWhat's NextConclusion109 Impressions