The multimodal recipe implements a HopChain-inspired synthetic data generation pipeline for multi-hop vision-language reasoning. It follows the paper HopChain: Multi-Hop Data Synthesis for Generalizable Vision-Language Reasoning and expresses the workflow as reusable NVFlow stages.
Start with the HopChain quick start.
| Workflow | Demo config | Full config |
|---|---|---|
| Image filter | nvflow/recipes/multimodal/workflows/image_filter/hopchain-image-filter-demo.yaml |
nvflow/recipes/multimodal/workflows/image_filter/hopchain-image-filter.yaml |
| SDG | nvflow/recipes/multimodal/workflows/sdg/hopchain-sdg-demo.yaml |
nvflow/recipes/multimodal/workflows/sdg/hopchain-sdg.yaml |
The demo SDG config stops after verified-question visualization. It has no external API dependency. The full config additionally runs the OpenAI judge, reconciliation, Omni difficulty filtering, and SFT trace generation.
Configuration is split between workflow and cluster files:
- Each full workflow YAML defines its stages, model profiles, execution IDs, chunking, and repository-relative input/output paths.
- Each demo YAML inherits its corresponding full workflow and overrides only the stage selection and small-run settings.
cluster_configs/my_cluster.yamldefines the local Slurm account, partitions, mounts, and named container image paths.- Optional private recipe changes go in git-ignored
private_*.yamloverlays next to the workflow they modify. - The full workflow's OpenAI key is supplied as
OPENAI_API_KEYunderenv_varsincluster_configs/my_cluster.yaml.
Run the demo workflows in order:
uv run nflow run-all \
--config nvflow/recipes/multimodal/workflows/image_filter/hopchain-image-filter-demo.yaml
uv run nflow run-all \
--config nvflow/recipes/multimodal/workflows/sdg/hopchain-sdg-demo.yamlOutputs are deterministic:
outputs/hopchain/image_filter/execution/demo/
outputs/hopchain/sdg/execution/demo/
Run the full workflows with their full configs:
uv run nflow run-all \
--config nvflow/recipes/multimodal/workflows/image_filter/hopchain-image-filter.yaml
uv run nflow run-all \
--config nvflow/recipes/multimodal/workflows/sdg/hopchain-sdg.yamlFull-workflow outputs use these directories:
outputs/hopchain/image_filter/execution/full/
outputs/hopchain/sdg/execution/full/
The full hopchain_sdg workflow runs:
prepare_filtered_image_inputspreprocess_identify_categoriesidentify_categorieslocalize_instancessample_instance_combinationspreprocess_generate_multihop_queriesgenerate_multihop_queriesverify_candidate_queriesvisualize_candidate_hopchain_datajudge_candidate_queries_openaireconcile_llm_judgesvisualize_reconciled_hopchain_datapreprocess_filter_easy_candidatesfilter_easy_candidatespreprocess_generate_sft_reasoning_tracesgenerate_sft_reasoning_tracespreprocess_filter_sft_reasoning_tracesfilter_sft_reasoning_traces
The image filter recursively scans data/images/ and writes
outputs/hopchain/image_filter/execution/demo/image-filter/kept_images.jsonl.
The SDG demo reads that file as its input.
By default the containers must see checkpoints at:
/hf_models/Qwen/Qwen3.5-397B-A17B
/hf_models/facebook/sam3.1/sam3.1_multiplex.pt
/hf_models/nvidia/omni-step70
Set host-to-container mappings in my_cluster.yaml and server behavior in an
ignored local YAML overlay. Keep machine-specific paths in those local files.
Do not commit API keys or credential files. See the quick start for full-workflow credential setup and the data-egress warning.