---
name: "torchtune-pytorch-native-finetuning"
description: "Fine-tune LLMs natively within the PyTorch ecosystem using modular TorchTune recipes."
metadata:
  author: "PyTorch"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "fine tune with torchtune"
  - "run torchtune recipe"
  - "use fsdp2 torchtune"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# TorchTune PyTorch-Native Fine-Tuning Recipes

Utilizes PyTorch TorchTune: modular training components, memory-efficient recipes (LoRA, QLoRA, full finetune), FSDP2 multi-GPU scaling, and seamless integration with PyTorch 2.0 compile.

## When to Invoke
Invoke this skill whenever you need to:
- fine tune with torchtune
- run torchtune recipe
- use fsdp2 torchtune

## Execution SOP & Rules
1. Select pre-built recipe: tune run <recipe_name> --config <config_name>.
2. Override parameters directly from command-line: checkpointer.checkpoint_dir=<path> batch_size=4.
3. Leverage torch.compile for graph capture and kernel optimization during training.
4. Export fine-tuned checkpoints in native PyTorch or HuggingFace formats.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
