qwen-vl-series-finetune
Route Qwen-VL-series multimodal fine-tuning, preference training, classification, adapter merge, and Gradio serving tasks.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- qwen-vl-series-finetune
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route Qwen-VL-series multimodal fine-tuning, preference training, classification, adapter merge, and Gradio serving tasks.
- disable-model-invocation
- true
02 资源文件 52
- 参考文档references/bundled-runtime.md3.8 KB
- 参考文档references/cli-reference.md4.5 KB
- 参考文档references/data-formats.md2.5 KB
- 参考文档references/install.md2.0 KB
- 参考文档references/model-compatibility.md2.0 KB
- 参考文档references/repo-provenance.md1.1 KB
- 参考文档references/repo-routing-metadata.json569 B
- 参考文档references/source-environment.yaml5.0 KB
- 参考文档references/source-LICENSE10.7 KB
- 参考文档references/source-requirements.txt2.6 KB
- 参考文档references/troubleshooting.md2.0 KB
- 参考文档references/workflow-map.md2.0 KB
- 脚本scripts/check_environment.py2.4 KB
- 脚本scripts/deepspeed/zero2_offload.json660 B
- 脚本scripts/deepspeed/zero2.json500 B
- 脚本scripts/deepspeed/zero3_offload.json1.1 KB
- 脚本scripts/deepspeed/zero3.json743 B
- 脚本scripts/validate_dataset.py6.3 KB
- 脚本src/__init__.py—
- 脚本src/constants.py527 B
- 脚本src/dataset/__init__.py348 B
- 脚本src/dataset/cls_dataset.py10.7 KB
- 脚本src/dataset/data_utils.py6.1 KB
- 脚本src/dataset/dpo_dataset.py15.8 KB
- 脚本src/dataset/grpo_dataset.py6.9 KB
- 脚本src/dataset/sft_dataset.py16.1 KB
- 脚本src/loss/__init__.py82 B
- 脚本src/loss/class_balance_loss.py2.2 KB
- 脚本src/loss/focal_loss.py1.8 KB
- 脚本src/loss/loss_factory.py1.1 KB
- 脚本src/merge_lora_weights.py886 B
- 脚本src/model/__init__.py715 B
- 脚本src/model/load_model.py3.7 KB
- 脚本src/model/modeling_cls.py35.0 KB
- 脚本src/params.py11.0 KB
- 脚本src/serve/__init__.py—
- 脚本src/serve/app.py5.5 KB
- 脚本src/train/__init__.py—
- 脚本src/train/monkey_patch_forward.py28.7 KB
- 脚本src/train/monkey_patch_vision.py7.9 KB
- 脚本src/train/reward_funcs.py2.4 KB
- 脚本src/train/train_cls.py12.4 KB
- 脚本src/train/train_dpo.py10.7 KB
- 脚本src/train/train_grpo.py9.6 KB
- 脚本src/train/train_sft.py10.0 KB
- 脚本src/train/train_utils.py5.2 KB
- 脚本src/trainer/__init__.py789 B
- 脚本src/trainer/cls_trainer.py12.5 KB
- 脚本src/trainer/dpo_trainer.py14.8 KB
- 脚本src/trainer/grpo_trainer.py52.1 KB
- 脚本src/trainer/sft_trainer.py17.7 KB
- 脚本src/utils.py4.9 KB
03 SKILL.md 正文
Qwen-VL Series Finetune
Use this repo skill for the public Qwen-VL-series training repo that fine-tunes Qwen2-VL, Qwen2.5-VL, Qwen3-VL, and Qwen3.5 multimodal models with Hugging Face, DeepSpeed, PEFT, TRL, and Liger.
This skill is a router, not a monolithic manual. Start here, then follow the sub-skill that matches the user request.
What this skill covers
- Multimodal dataset preparation and validation for SFT, DPO, GRPO, and classification.
- Supervised fine-tuning, including full finetuning, LoRA, vision LoRA, video training, and evaluation during training.
- Preference training with DPO and GRPO, including reasoning fields and Liger GRPO options.
- Sequence classification training, custom heads, class-imbalance losses, and early stopping.
- Adapter merging and Gradio inference for merged or adapter-backed models.
Route map
sub-skills/data-and-multimodal/— build or validate JSON datasets, image/video path handling, token formatting, and reasoning fields.sub-skills/sft-training/— full SFT, LoRA/QLoRA, vision LoRA, video finetuning, and DeepSpeed launch planning.sub-skills/preference-training/— DPO and GRPO workflows, reward functions, and reasoning-aware preference data.sub-skills/classification-training/— sequence classification labels, losses, metrics, and early stopping.sub-skills/serving-and-adapters/— LoRA merge, model loading, and Gradio inference.
Read first
references/install.mdfor install and inspection-environment guidance.references/bundled-runtime.mdfor the bundledsrc/tree, DeepSpeed configs, and executable training/merge/serving helpers.references/workflow-map.mdfor the fastest path from user request to sub-skill.references/data-formats.mdfor shared JSON schemas and media/routing rules.references/cli-reference.mdfor the main entry points and key flags.references/model-compatibility.mdfor model-family and backend caveats.references/troubleshooting.mdfor the most common setup and runtime failures.
Minimal environment check
Before any CUDA-heavy task, run the bundled diagnostic:
scripts/check_environment.py
Use it to confirm package imports, CUDA visibility, and optional serving dependencies without downloading weights or datasets.
Operating rules
- Keep runtime paths inside this skill tree; do not point future agents back to the source checkout.
- Use the bundled
src/entrypoints and DeepSpeed configs here; command helpers run from the skill root and setPYTHONPATH=src. - Use the bundled scripts and references here instead of the original repo launch scripts.
- Treat CPU help/import checks as valid only for parser, schema, and pure-Python utilities.
- Treat actual training, multimodal generation, Gradio serving, and adapter merge as CUDA workflows.
- For Qwen3.5, prefer
--disable_flash_attn2 Trueunless the user explicitly needs another backend. - For video workflows, prefer the PyAV/FFmpeg path documented in the references and treat
fps/nframesas mutually exclusive.
Good first questions
If the user asks for something broad, ask which workflow they want:
- data preparation or validation
- supervised finetuning
- DPO or GRPO
- classification training
- merge or serve
If the user already named one of those workflows, jump directly to that sub-skill.
Provenance and router metadata
references/repo-provenance.mdrecords the source checkout state.references/repo-routing-metadata.jsonrecords the managed router placement used by import tooling.
Safe default
If the user asks for a command, prefer a dry-run or command-builder script first, then the execution command after the data, model, and backend assumptions are explicit.
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).