RTX 3050 - Order Now
Home / Blog / Tutorials / Unsloth Fine-Tuning on RTX 4060 Ti 16GB
Tutorials

Unsloth Fine-Tuning on RTX 4060 Ti 16GB

Unsloth's optimised kernels let you fine-tune 8B-class models on a single 16GB card with surprising throughput. Here is the setup.

Unsloth is a fine-tuning library with custom Triton kernels that cut memory use and boost speed by 2-3x over standard QLoRA. On a 16 GB RTX 4060 Ti from our dedicated GPU hosting, it turns a tight training budget into a comfortable one.

Contents

Install

pip install "unsloth[cu124-torch230] @ git+https://github.com/unslothai/unsloth.git"

Pick the wheel matching your CUDA / PyTorch. Unsloth’s docs list exact combinations.

Training

from unsloth import FastLanguageModel
from trl import SFTTrainer, SFTConfig

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/llama-3.1-8b-Instruct",
    max_seq_length=4096,
    load_in_4bit=True,
)

model = FastLanguageModel.get_peft_model(
    model,
    r=16, lora_alpha=32,
    target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"],
    use_gradient_checkpointing="unsloth",
)

cfg = SFTConfig(
    output_dir="./out",
    per_device_train_batch_size=2,
    gradient_accumulation_steps=4,
    learning_rate=2e-4,
    bf16=True,
    num_train_epochs=3,
    optim="adamw_8bit",
)
SFTTrainer(model=model, tokenizer=tokenizer, args=cfg, train_dataset=your_dataset).train()

Speed

On a 4060 Ti 16 GB fine-tuning Llama 3.1 8B:

FrameworkThroughput
Transformers + PEFT (standard)~1,800 tokens/sec
Axolotl~2,100 tokens/sec
Unsloth~4,500 tokens/sec

Roughly 2-2.5x over stock PEFT. On small GPUs that is the difference between an hour-long run and a three-hour run.

Limits

Unsloth supports a specific subset of architectures (Llama, Mistral, Gemma, Phi, Qwen, and close derivatives). Exotic models – novel architectures, MoE variants, custom tokenisers – may not work. For broader compatibility fall back to Axolotl or raw PEFT.

Budget Fine-Tuning Hosting

Unsloth preinstalled on 4060 Ti UK dedicated servers for cost-effective training.

Browse GPU Servers

See LoRA on Mistral 7B and Axolotl.

Need a Dedicated GPU Server?

Deploy from RTX 3050 to RTX 5090. Full root access, NVMe storage, 1Gbps — UK datacenter.

Browse GPU Servers

gigagpu

We benchmark, deploy, and optimise GPU infrastructure for AI workloads. All data in our guides comes from real-world testing on our UK-based dedicated GPU servers.

Ready to deploy your AI workload?

Dedicated GPU servers from our UK datacenter. NVMe storage, 1Gbps networking, full root access.

Browse GPU Servers Contact Sales

Have a question? Need help?