vlm-r1
Use VLM-R1 for multimodal GRPO training, JSONL reward/data design, VLM module extension, REC/OVD evaluation, and Ascend inference deployment.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- vlm-r1
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use VLM-R1 for multimodal GRPO training, JSONL reward/data design, VLM module extension, REC/OVD evaluation, and Ascend inference deployment.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/installation-and-environment.md4.1 KB
- 参考文档references/repo-provenance.md3.4 KB
- 参考文档references/repo-routing-metadata.json540 B
- 参考文档references/troubleshooting.md4.4 KB
- 脚本scripts/check_vlm_r1_environment.py3.9 KB
03 SKILL.md 正文
VLM-R1
Use this repo skill when the user is working with VLM-R1, the nested open-r1 multimodal package, R1-style VLM GRPO post-training, REC/OVD bbox rewards, Qwen2/2.5-VL or InternVL GRPO launches, VLM module integration, VLM-R1 evaluation scripts, or Huawei Ascend VLM-R1 OVD deployment.
This skill is self-contained operating guidance. Do not route future agents back to this source checkout's README, scripts, examples, or docs; use the bundled sub-skills, references, and scripts here.
Before acting
- Read references/repo-provenance.md when checking whether this skill matches a target checkout or deciding whether to refresh it.
- Read references/installation-and-environment.md before installing or debugging the package.
- Run scripts/check_vlm_r1_environment.py for safe import/backend probes when the user already has an environment.
- Read references/troubleshooting.md for cross-cutting import, CUDA, DeepSpeed, GLM, data path, and unsupported-backend issues.
Route by task
| User task | Read |
|---|---|
| Build, audit, or adapt GRPO training commands; choose LoRA/freeze/DeepSpeed/multi-node flags; create dry-run launch commands. | sub-skills/training-workflows/SKILL.md |
| Validate VLM-R1 JSONL rows, image-root mapping, answer formats, reward methods, or bbox/text reward behavior. | sub-skills/data-and-rewards/SKILL.md |
| Add a new VLM backend or debug Qwen2VL, InternVL, GLM, processor inputs, freeze keywords, or custom reward hooks. | sub-skills/model-modules/SKILL.md |
| Adapt REC/OVD evaluation, score saved bbox predictions, or explain Qwen/InternVL/baseline evaluation differences. | sub-skills/evaluation/SKILL.md |
| Run VLM-R1 OVD on Huawei Ascend using vllm-ascend or XLLM server/offline/client templates. | sub-skills/ascend-inference/SKILL.md |
Minimal public setup model
VLM-R1 is a source-oriented repository with a nested Python distribution named open-r1 and import package open_r1. Typical users install from a VLM-R1 source checkout that contains the multimodal package root, then launch GRPO with torchrun against the open_r1.grpo_jsonl training entrypoint or an editable package script.
Safe initial checks in a prepared Python environment:
python -m pip check
python -c "import open_r1; import open_r1.configs; print('open_r1 import ok')"
python -c "import torch; print('cuda', torch.cuda.is_available(), 'devices', torch.cuda.device_count())"
Important caveats:
- Full GRPO training and model evaluation require large VLM checkpoints, datasets/images, CUDA GPUs, and often FlashAttention/DeepSpeed-compatible CUDA tooling.
- The source inspected for this skill had two import hazards:
grpo_jsonl.pyuses a non-packageutils.mathimport path, andglm_module.pyreferencesGlm4vForConditionalGeneration, which is not present in the pinnedtransformers==4.49.0stack. Treat GLM as unverified until the environment is repaired and smoke-tested. - Ascend deployment recipes are hardware-specific. This skill preserves vllm-ascend and XLLM command templates but does not claim NPU verification.
Common workflow shape
- Confirm the user's target: training, data/reward validation, module extension, evaluation, or serving.
- Load the matching sub-skill rather than using root-level memory.
- Prefer bundled scripts for dry-runs, validators, command rendering, and offline scoring.
- For expensive workflows, run safe checks first: script
--help, dry-run command rendering, JSONL validation, package import checks, CUDA/NPU visibility probes. - Only execute full training, model loading, server startup, downloads, or benchmark runs after the user confirms the required hardware, data, model paths, credentials, runtime, and budget.
Useful bundled scripts
- scripts/check_vlm_r1_environment.py: package/import/backend smoke checks.
- sub-skills/training-workflows/scripts/launch_grpo_jsonl.sh: parameterized GRPO
torchruncommand renderer/launcher. - sub-skills/training-workflows/scripts/render_multinode_torchrun.py: render per-node distributed commands.
- sub-skills/data-and-rewards/scripts/validate_jsonl_dataset.py: validate VLM-R1 JSONL schemas and image-root mapping.
- sub-skills/data-and-rewards/scripts/score_bbox_outputs.py: lightweight bbox/OD-style scoring.
- sub-skills/evaluation/scripts/evaluate_bbox_predictions.py: offline REC/OVD saved-prediction scorer.
- sub-skills/model-modules/scripts/inspect_model_module_contract.py: static checker for VLM module contracts.
- sub-skills/ascend-inference/scripts/ascend_offline_request_template.py and sub-skills/ascend-inference/scripts/ascend_server_client_templates.sh: Ascend request and command templates.
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).