sft-training
Plan Qwen-VL SFT, LoRA, vision LoRA, video finetuning, and DeepSpeed launch commands.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sft-training
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Plan Qwen-VL SFT, LoRA, vision LoRA, video finetuning, and DeepSpeed launch commands.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/troubleshooting.md1.2 KB
- 参考文档references/workflow.md2.0 KB
- 脚本scripts/sft_command.py10.9 KB
03 SKILL.md 正文
SFT Training
Use this sub-skill for full finetuning, LoRA/QLoRA, vision LoRA, video finetuning, evaluation during training, and DeepSpeed launch planning.
Covers
train_sft.pycommand planning.- Full finetuning and LoRA variants.
- Vision LoRA and top-k unfreezing.
- Video training and media-resolution choices.
- Generation-based evaluation during SFT.
- ZeRO-2 / ZeRO-3 / offload template selection.
- Checkpointing and save behavior.
Excludes
- DPO or GRPO preference training.
- Classification training.
- Adapter merge or serving.
- Dataset schema design beyond what SFT needs.
Read first
../../references/workflow-map.mdfor route confirmation.../../references/cli-reference.mdfor the shared flag surface.../../references/model-compatibility.mdfor Qwen family and backend caveats.../../references/troubleshooting.mdfor common SFT failures.scripts/sft_command.pyfor a safe command builder.../../scripts/deepspeed/zero2.jsonand friends for ZeRO templates.
Typical user requests
- "Give me the exact SFT command."
- "How do I finetune with LoRA or vision LoRA?"
- "How do I train on videos?"
- "Should I use ZeRO-2 or ZeRO-3?"
- "Why is my Qwen3.5 SFT unstable with Flash Attention 2?"
Workflow
- Confirm the model family and dataset shape.
- Decide whether the run is full finetuning, LoRA, or vision LoRA.
- Decide whether the data contains video and needs video pixel controls.
- Pick ZeRO-2, ZeRO-3, or an offload template based on memory pressure.
- Check reasoning and Flash Attention rules for the chosen model family.
- Emit the command with the bundled command builder.
Decision rules
- Use
--disable_flash_attn2 Truefor Qwen3.5 unless the user explicitly needs another path. - Do not combine QLoRA with trainable vision-tower knobs.
- For dense Qwen3-VL full finetuning, consider ZeRO-2 and/or turning off Liger if memory or speed is a problem.
- For video, keep
fpsandnframesexclusive. - If the user needs evaluation during training, make sure the eval dataset uses the same schema and media root assumptions.
Safe command builder
Start with dry-run output from the bundled helper:
python scripts/sft_command.py --help
python scripts/sft_command.py --variant lora --model-id Qwen/Qwen2.5-VL-3B-Instruct --data-path data/train.json --image-folder data/images --output-dir outputs/sft
If you need more detail
Read references/workflow.md for launch patterns and references/troubleshooting.md for memory, backend, and config failures.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).