Unsloth
The same LoRA fine-tune as PEFT, roughly twice as fast in half the memory, with no approximation. The gains come from rewriting the kernels rather than from changing the method.
Standing
Commonly usedEstablished and frequently the right choice, but competing with live alternatives rather than having settled the question.
The fastest single-GPU fine-tuning path, and single-GPU only in the free version. Widely used for exactly that case.
judged as of 2026-09 · what the labels mean
Theory
PEFT and TRL are reference implementations: correct, general, and not tuned. Unsloth is the same algorithms with the hot paths rewritten.
- Fused Triton kernels for RMSNorm, RoPE, the SwiGLU block and cross-entropy, so intermediates stay in registers instead of round-tripping to HBM.
- Manually derived backward passes for the LoRA path, avoiding the generic autograd graph and the tensors it keeps alive.
- Chunked cross-entropy, which never materialises the
[B, T, V]logits — usually the single largest allocation in a fine-tuning step.
None of that changes what is computed, which is why “twice as fast, no accuracy cost” is a reasonable claim rather than a suspicious one.
from unsloth import FastLanguageModel
model, tok = FastLanguageModel.from_pretrained(
"unsloth/llama-3.1-8b-bnb-4bit",
max_seq_length=4096,
load_in_4bit=True, # QLoRA, with their quantised checkpoints
)
model = FastLanguageModel.get_peft_model(
model,
r=16,
target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"],
use_gradient_checkpointing="unsloth", # their variant, not torch's
)
# From here it is TRL. SFTTrainer, DPOTrainer, GRPOTrainer all work unchanged.What it is for
- Fine-tuning on one consumer GPU. An 8B QLoRA run fits comfortably in 16 GB and is usable in 12.
- Dropping into an existing TRL script. Two changed lines at the top; the trainer code is untouched.
- Long-context fine-tuning, where the memory savings compound with sequence length.
What it is not for
Multi-GPU. Distributed training is not in the open version. A run that needs more than one card wants config-driven tooling over Accelerate or DeepSpeed.
Full fine-tuning at scale. The optimisations are aimed at the adapter path.
Architectures it has not covered. The kernels are per-architecture, so a new or unusual model may not be supported — where Transformers has everything.