peft
Use PEFT for parameter-efficient fine-tuning adapters, LoRA and quantized workflows, prompt and soft methods, specialized tuners, save/load/merge operations, training integrations, and PEFT repository
SKILL.md04-安全渗透/peft/SKILL.md
GitHubPEFT
Use this skill when a task names Hugging Face PEFT, peft, PeftModel, PeftConfig, get_peft_model, LoRA/QLoRA, prompt tuning, adapter checkpoints, adapter merging, PEFT training integrations, or changes to the PEFT repository.
Route By Task
- Core adapter setup: use
sub-skills/adapter-core/SKILL.mdforPeftConfig,TaskType,PeftType,get_peft_model, adapter lifecycle, trainable status, custom model targeting, and low-level injection. - LoRA and quantization: use
sub-skills/lora-and-quantization/SKILL.mdforLoraConfig, QLoRA, DoRA, rsLoRA, PiSSA, CorDA, LoftQ, QALoRA, trainable tokens, and quantized-base compatibility. - Prompt and soft methods: use
sub-skills/prompt-and-soft-methods/SKILL.mdfor prompt tuning, prefix tuning, P-tuning, multitask prompt tuning, CPT, adaption prompt, cartridge, and trainable-token prompt workflows. - Specialized tuners: use
sub-skills/specialized-tuners/SKILL.mdfor IA3, BOFT, OFT, LoHa, LoKr, VeRA/PVeRA, VBLoRA, XLora, FourierFT, HRA/HiRA/SHiRA, RandLoRA, and other non-LoRA/non-prompt method families. - Save, load, merge, and deploy: use
sub-skills/save-load-merge/SKILL.mdfor adapter checkpoint layout,save_pretrained,from_pretrained,AutoPeftModel*,merge_and_unload, hotswap, mixed adapters, Hub/local loading, and conversion. - Training integrations: use
sub-skills/training-and-integrations/SKILL.mdfor Transformers Trainer, Accelerate, FSDP, DeepSpeed, TRL SFT, Diffusers examples, memory-efficient training, andtorch.compilecaveats. - PEFT repository development: use
sub-skills/repo-development/SKILL.mdfor contribution policy, new tuner registration, test selection, style/quality commands, docs, and AI-assisted PR disclosure rules.
Fast Start
- Verify imports with
sub-skills/adapter-core/scripts/check_peft_env.pyin an environment that haspeft,torch,transformers, andaccelerate. - Decide the adapter family before writing training code. LoRA and quantized workflows have different constraints from prompt-learning and specialized tuners.
- Keep base-model loading, adapter construction, training launcher settings, and checkpoint save/merge decisions separate so each can be reviewed.
- Avoid downloading large models in smoke tests. Use config construction, helper scripts, or tiny custom
torch.nn.Modulechecks when possible.
References
references/workflow-overview.mdgives a root-level decision map across adapter lifecycle stages.references/troubleshooting.mdcovers cross-cutting install/import, optional backend, target-module, checkpoint, merge, and training failures.references/repo-provenance.mdrecords the source revision and extraction evidence.