ofa
Routes OFA workflows for multimodal pretraining, captioning, VQA, RefCOCO, OCR, ImageNet, image generation, Gigaword, GLUE, and MMSpeech, with safe setup and validation helpers.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- ofa
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes OFA workflows for multimodal pretraining, captioning, VQA, RefCOCO, OCR, ImageNet, image generation, Gigaword, GLUE, and MMSpeech, with safe setup and validation helpers.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/repo-provenance.md2.0 KB
- 参考文档references/repo-routing-metadata.json484 B
- 参考文档references/troubleshooting.md3.6 KB
- 脚本scripts/check_ofa_environment.py5.4 KB
- 脚本scripts/render_ofa_command.py5.9 KB
03 SKILL.md 正文
OFA
OFA is a unified sequence-to-sequence repository for vision-language, text, image generation, language understanding, and speech workflows.
Use this skill when a user wants to:
- run or adapt OFA training or evaluation commands,
- validate OFA TSV / manifest layouts before a long GPU job,
- reproduce caption, VQA, RefCOCO, OCR, ImageNet, Gigaword, GLUE, or MMSpeech workflows,
- inspect OFA model, task, or criterion registration,
- understand prompt tuning, adapters, bitfit, or encouraging loss,
- or reason about the repo's bundled Fairseq fork and command-line entry points.
Start here
- Read references/repo-provenance.md if you need to know whether this skill matches the current checkout.
- Run scripts/check_ofa_environment.py with
--check-clisto confirm the repo import path, CUDA availability, and CLI help surface. - Use scripts/render_ofa_command.py when you need a copyable launch command instead of hand-writing a long distributed invocation.
Shared helpers
- scripts/check_ofa_environment.py checks imports, package versions, CUDA readiness, and optional CLI help.
- scripts/render_ofa_command.py renders a safe OFA train/evaluate command without executing it.
Router map
setup-and-command-building
Use this for installation, PYTHONPATH, --user-dir, distributed launch shape, port selection, and command rendering. It is the first stop when a user says "how do I run OFA" or "why does train.py import fail?"
data-formats
Use this for TSV rows, selected-column layouts, base64 image payloads, image-code sequences, COCO-style caption rows, VQA answer fields, RefCOCO boxes, OCR data, ImageNet label rows, Gigaword/GLUE tables, and MMSpeech manifests.
pretraining
Use this for multimodal pretraining and continuous pretraining, including the vision_language_examples.tsv, text_examples.tsv, image_examples.tsv, detection_examples.tsv, and negative_sample/ layout.
vision-language-tasks
Use this for captioning, VQA, RefCOCO / RefCOCO+ / RefCOCOg, SNLI-VE, OCR, and ImageNet finetuning or evaluation.
image-generation
Use this for text-to-image generation, VQGAN code conversion, CLIP ranking, and image-generation validation.
language-tasks
Use this for Gigaword summarization and GLUE-style text understanding tasks such as CoLA, MNLI, RTE, QNLI, QQP, MRPC, and SST-2.
mmspeech
Use this for MMSpeech staged ASR pretraining/evaluation, speech manifests, fbank configuration, and WER troubleshooting.
model-internals-and-extension
Use this for task/model/criterion registration, architecture inspection, prompt tuning, adapters, bitfit, encouraging loss, and adding new OFA extensions.
Installation
From the repo root, install the public dependencies with:
pip install -r requirements.txt
Public prerequisites
- The repo's Python requirements.
- A CUDA-capable environment for the task workflows; CPU is only a partial substitute for setup checks.
- Java 1.8 if you want full COCO caption evaluation with SPICE.
- External datasets and checkpoints for the actual task runs.
Minimal verification
After install, run:
python scripts/check_ofa_environment.py --check-clis
A healthy result shows the repo imports, the bundled Fairseq fork is visible, CUDA is available when expected, and train.py / evaluate.py print help successfully.
Read more
- references/troubleshooting.md for cross-cutting import, backend, Java, and dependency issues.
- references/repo-provenance.md for the source commit, branch, and staleness baseline.
- references/repo-routing-metadata.json for router placement and scenario metadata.
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).