Agent skill
unsloth-fft
Performing full fine-tuning (FFT) in Unsloth with 100% exact weight updates and optimized gradient checkpointing. Triggers include fft, full fine-tuning, full_finetuning, exact fine-tuning, and weight updates.
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/unsloth-fft
SKILL.md
Overview
Full Fine-Tuning (FFT) in Unsloth allows for 100% exact weight updates, bypassing the low-rank approximations of LoRA. By utilizing Unsloth's optimized gradient checkpointing, FFT can fit significantly larger batch sizes while ensuring total model modification.
When to Use
- When performing base model pre-training or continued pre-training on large datasets.
- When model-wide behaviors need modification that adapters (LoRA) cannot fully capture.
- When sufficient VRAM is available to handle full model gradients.
Decision Tree
- Do you need to modify 100% of the model weights?
- Yes: Proceed with FFT.
- No: Use [[unsloth-lora]].
- Is VRAM limited (e.g., < 24GB for a 7B model)?
- Yes: Enable
use_gradient_checkpointing = 'unsloth'andadamw_8bit. - No: Use standard BF16 and high batch sizes.
- Yes: Enable
Workflows
Initializing Full Fine-tuning
- Load the model using
FastLanguageModel.from_pretrainedwithload_in_4bit=Falseandload_in_8bit=False. - Pass
full_finetuning=Truein the initialization call to unlock all weight updates. - Apply the 'unsloth' gradient checkpointing via
FastLanguageModel.get_peft_model(model, use_gradient_checkpointing='unsloth').
FFT Memory Management
- Set
per_device_train_batch_sizeto 1 to accommodate full weight gradients. - Increase
gradient_accumulation_stepsto simulate effective batch sizes of 16-32. - Use the
adamw_8bitoptimizer to reduce memory consumption by optimizer states.
Non-Obvious Insights
- Unsloth's gradient checkpointing implementation is critical for FFT, as it uses 30% less VRAM and allows for 2x larger batch sizes compared to standard Hugging Face implementations.
- Full fine-tuning is the preferred method for base model pre-training where the objective is knowledge injection rather than task instruction.
- FFT in Unsloth is strictly 100% exact; there is no numerical drift compared to standard training, only efficiency gains.
Evidence
- "To enable full fine-tuning (FFT), set full_finetuning = True." Source
- "use_gradient_checkpointing = 'unsloth' uses 30% less VRAM, fits 2x larger batch sizes!" Source
Scripts
scripts/unsloth-fft_tool.py: Script to initialize a full fine-tuning session with Unsloth.scripts/unsloth-fft_tool.js: Node.js utility to generate FFT training parameters.
Dependencies
- unsloth
- torch
- transformers
References
- [[references/README.md]]
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?