multi-modality
Guides InternVideo2 multi-modality Stage2 and CLIP video-text/audio training, retrieval evaluation, demo setup, Python configs, launchers, and troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- multi-modality
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides InternVideo2 multi-modality Stage2 and CLIP video-text/audio training, retrieval evaluation, demo setup, Python configs, launchers, and troubleshooting.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/configuration-and-data.md4.3 KB
- 参考文档references/troubleshooting.md3.4 KB
- 参考文档references/workflows.md4.1 KB
- 脚本scripts/build_multimodal_launch.py5.6 KB
03 SKILL.md 正文
InternVideo2 Multi-Modality
Use this sub-skill for InternVideo2/multi_modality: Stage2 video-language alignment, CLIP post-pretraining, zero-shot/fine-tuned retrieval, audio-text/audio-visual tasks, demo retrieval, config files, and distributed launch adaptation.
Read first
- Workflows explains Stage2, CLIP, evaluation, demo, preprocessing, and launcher layers.
- Configuration and data records config system, path variables, model families, annotation/preprocess expectations, and checkpoint naming.
- Troubleshooting covers PYTHONPATH, FlashAttention/Apex/DeepSpeed, checkpoint, tokenizer, and dataset failures.
Safe helper
Use the bundled launch builder to print command skeletons without submitting jobs:
python scripts/build_multimodal_launch.py --task pretrain --branch stage2 --config scripts/pretraining/stage2/1B/config.py --nodes 8 --gpus-per-node 8
python scripts/build_multimodal_launch.py --task evaluate --branch stage2 --config scripts/evaluation/stage2/zero_shot/1B/config_msrvtt.py --pretrained ${INTERNVIDEO2_MODEL_PATH}/1B_stage2_pt.pth
python scripts/build_multimodal_launch.py --task retrieval --branch clip --config scripts/evaluation/clip/zero_shot/1B/config_msrvtt.py --pretrained ${INTERNVIDEO2_MODEL_PATH}/InternVideo2_CLIP_1B.pth --no-slurm
The helper prints a tools/run.py dry-run concept for Stage2 plus a direct srun or torchrun skeleton. It never calls the source launcher.
Route by task
| Task | Route |
|---|---|
| Stage2 pretraining or finetuning | tasks/pretrain.py plus a Python config under scripts/pretraining or scripts/finetuning; config owns text encoder, dataset roots, DeepSpeed, and evaluation flags. |
| CLIP post-pretraining | tasks_clip/pretrain.py; use matching vision/text checkpoint paths and remember CLIP variants may be InternVL/LLM-backed or MobileCLIP-backed. |
| Zero-shot retrieval/action evaluation | Stage2 uses tasks/pretrain.py with evaluate True; CLIP retrieval uses tasks_clip/retrieval.py; both rely on dataset-specific config files. |
| Demo video-text retrieval | Use the demo config and demo/utils.py with the multi-modality folder on PYTHONPATH; Stage2 demo needs tokenizer and checkpoint paths before inference. |
| Preprocess/annotation conversion | Use preprocess/create_sqlite_db.py as schema evidence for JSON-to-SQLite shape, but keep destructive conversions out of the helper script. |
| Job submission abstraction | Treat tools/run.py as a launcher template that copies code to VL_EXP_DIR, resolves SLURM/local mode, and forwards tasks through torchrun; use the bundled helper for dry runs. |
| Audio-video workflows | Stage2 configs can switch to BEATs audio encoders and audio-visual losses; verify audio packages, media roots, and checkpoint paths first. |
Required decisions before execution
- Branch: Stage2 or CLIP.
- Mode: pretrain, evaluate/retrieval, demo, or preprocess.
- Config file and overrides: dataset paths, output dir,
pretrained_path, checkpoint paths, DeepSpeed setting, and optional extra config args. - Text/vision/audio checkpoint family: BERT tokenizer folder, InternVL/LLM text encoder path, MobileCLIP/LoRA path, vision backbone checkpoint, BEATs audio weights, or distilled extra checkpoint.
- Runtime: SLURM or local torchrun, GPU count, FlashAttention/Apex/DeepSpeed readiness, and whether
PYTHONPATHmust be rooted at the multi-modality folder.
Boundaries
- Route video-only action recognition finetuning to
../single-modality/SKILL.md. - Route MLLM long-video chat to
../video-mllm/SKILL.md. - Route annotation validation and InternVid dataset questions to
../datasets/SKILL.md.
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).