Downloads · 30 days
0
aijadugar/Qwen2-0.5B-sft-instruct
Qwen2-0.5B-sft-instruct is a machine learning model from aijadugar. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project contains a supervised fine-tuning (SFT) workflow for the Qwen2 0.5B language model with the objective of improving instruction following capabilities.
Downloads · 30 days
0
Access
Public
Updated Aug 21, 2026
Repo size
5.9 GB
Likes
0
Public
Click a slice to open those files.
.pt4 GB · 66%
From the Hugging Face model README
This project contains a supervised fine-tuning (SFT) workflow for the Qwen2 0.5B language model with the objective of improving instruction following capabilities.
The model is trained using full-parameter supervised fine tuning on an instruction based dataset, with the loss masked to the assistant response tokens only. The project also includes a custom CUDA fused AdamW optimizer designed to reduce the number of CUDA kernel launches during optimizer updates.
Base model: Qwen2 0.5B
Training method: Full parameter supervised fine tuning
Training objective: Instruction following (prompt-masked loss)
Parameter efficient fine tuning: No
Precision: BF16
Optimizer: Custom fused AdamW CUDA optimizer
Model format: Safetensors
The model is trained by updating all trainable parameters. The training pipeline includes:
This project includes a custom fused AdamW CUDA implementation. The optimizer performs the following operations inside a CUDA kernel:
The model parameters and gradients use BF16 while the Adam optimizer states and optimizer arithmetic use FP32. The CUDA implementation was validated against reference AdamW calculations before being used for model training.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_path = "./ft"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloat16)
model.eval()
pip install torch transformers datasets accelerate safetensors
CUDA and a compatible NVIDIA driver are required for CUDA based training.