Workflow orchestration for end-to-end ML pipelines (data generation, training, evaluation) built on the NeMo ecosystem.
NVFlow is a workflow orchestration framework for end-to-end synthetic data generation (SDG), training (SFT), and evaluation pipelines built on NVIDIA's NeMo ecosystem. It exists to standardize how teams build, reproduce, and scale complex ML pipelines across domains with reusable stages and declarative workflows that run locally or on Slurm clusters.
It provides a structured way to build, manage, and execute pipelines through:
- Recipes - Domain-specific workflows (e.g., finance)
- Stages - Reusable pipeline components for SDG, training, and evaluation
- Workflows - YAML-based configurations that chain stages together
Key features:
- Reusability and reproducibility with a structured, stage-based architecture
- Flexible execution via CLI (
nflow), Python scripts, or programmatic API - Cluster integration with native Slurm support
- Built on NeMo leveraging NeMo-Skills, NeMo-RL, and NeMo-Gym infrastructure
Example use case: The finance recipe demonstrates a complete pipeline: download SEC filings β generate synthetic Q&A data β fine-tune models β evaluate performance, producing 300K+ synthetic Q&A pairs.
Understanding the terminology is key to working effectively with NVFlow:
-
Recipe: A domain-specific collection of stages and workflows organized around a particular use case (e.g., finance). Recipes provide ready-to-use pipelines for specific problem domains.
-
Workflow: A declarative pipeline defined in YAML that orchestrates multiple stages in a specific order. Workflows define stage dependencies, data flow between stages, and execution configuration. Think of a workflow as a recipe that connects stages together to accomplish an end-to-end objective.
-
Stage: A self-contained, reusable component that performs a single, specific task in your ML pipeline. Each stage is an independent unit of work (e.g., downloading data, generating synthetic examples, training a model). Stages are implemented as Python classes and can be composed together.
Example hierarchy:
Recipe: finance
βββ Workflow: download_sec_filings (defined in YAML)
β βββ Stage: demo (or sap-500)
βββ Workflow: template_based_sdg (defined in YAML)
βββ Stage: create_seed_data
βββ Stage: generate_questions
βββ Stage: map_questions_to_context
βββ Stage: generate_answers
βββ Stage: genselect_answers
βββ Stage: filter_answers
In practice, you define workflows in YAML configuration files, reference stages by their short names, and run them via CLI or Python API. This separation allows you to reuse stages across different workflows and maintain clean, modular pipeline code.
How concepts map to folders:
nvflow/recipes/{recipe_name}/
βββ workflows/*.yaml # Workflow definitions (e.g., template_based_sdg.yaml)
βββ stages/{category}/*.py # Stage implementations (e.g., stages/sdg/generate_answers.py)
βββ prompts/ # Prompt templates used by stages
Finding stage implementations:
When a workflow YAML references a stage like generate_answers, the Python implementation is located at:
nvflow/recipes/{recipe}/stages/{category}/{stage_name}.py
For example:
- Stage name in YAML:
generate_answers - Implementation file:
nvflow/recipes/finance/stages/sdg/generate_answers.py
About category folders:
The {category} folders (like sdg/, data/, training/) are organizational containers that group related stages together. They help keep the codebase organized but do not affect stage naming - stages are always referenced by their short name in workflow YAML files, not by their folder path.
Example:
# In workflow YAML
pipeline_stages:
- download_sec_filings # Short name
- generate_questions # Short name
# These map to Python files:
# stages/download/download_sec_filings.py
# stages/sdg/generate_questions.py- Git - to clone the repository
- uv - Python package manager (docs)
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/envgit clone https://github.com/NVIDIA/nvflow.git
cd nvflow
# For users
uv sync
# For developers
uv sync --all-extras
uv run pre-commit install
β οΈ Developers: Always runuv run pre-commit installafter cloning. This enables automatic code quality checks on every commit.
By default, use uv run <command> to run commands in the project's virtual environment. If you prefer to activate the environment directly:
source .venv/bin/activate
# Now you can run commands without 'uv run' prefix
python --version # 3.12+
nflow --help
pytestTo run workflows on a Slurm cluster you need to: (1) build the four NVFlow
container images from the Dockerfiles in dockerfiles/,
(2) convert them to .sqsh for Slurm, and (3) write a cluster config
(cluster_configs/my_cluster.yaml). The containers are self-sufficient β
all dependencies are pre-installed, so no runtime downloads are needed.
See INSTALL.md for the complete setup guide (build, sanity-check,
.sqshconversion, model staging, cluster configuration, and verification).See
dockerfiles/docker_instructions.mdfor the build / multi-arch / sanity-check reference.
Once cluster setup is complete, set the config directory:
export NEMO_SKILLS_CONFIG_DIR=/path/to/nvflow/cluster_configs# List all stages (hierarchical display)
uv run nflow list-stages
# List stages for a specific recipe
uv run nflow list-stages --recipe finance
# Get stage details (full path: recipe.workflow.stage)
uv run nflow stage-info example.sdg_simple.generate_answer
# Or with flags (if you know recipe and workflow)
uv run nflow stage-info generate_answer --recipe example --workflow sdg_simple
# Run specific stage (short name from config)
uv run nflow run generate_answer --config nvflow/recipes/example/workflows/sdg_simple.yaml
# Run all stages in workflow
uv run nflow run-all --config nvflow/recipes/example/workflows/sdg_simple.yaml# Run a single stage (short name from config)
uv run python scripts/run_flow.py generate_answer --config nvflow/recipes/example/workflows/sdg_simple.yaml
# Run all stages
uv run python scripts/run_flow.py --all --config nvflow/recipes/example/workflows/sdg_simple.yamlfrom nvflow.core import WorkflowRunner
# Run all stages
runner = WorkflowRunner("nvflow/recipes/example/workflows/sdg_simple.yaml")
runner.run()
# Run specific stage (short name from config)
runner.run(stages=["generate_answer"])nvflow/
βββ core/ # Framework
βββ cli/ # CLI
βββ recipes/ # Domain recipes
βββ example/ # Example recipe (learning & testing)
β βββ stages/sdg/ # Example SDG stage
β βββ prompts/ # Prompt templates
β βββ workflows/ # Example workflows
βββ finance/ # Finance reasoning recipe
βββ stages/ # Stage implementations
β βββ download/ # SEC filing download
β βββ evaluation/ # Evaluation stages
β βββ rl/ # GRPO RL training stages
β βββ sdg/ # SDG stages
β βββ sft/ # SFT training stages
β βββ shared/ # Shared stages (data_transformation, train_validation_split)
βββ prompts/ # Prompt templates
βββ workflows/ # Workflow configs
See the example recipe for a complete working example. Key steps:
- Create stage file in
nvflow/recipes/{recipe}/stages/{category}/ - Implement with hierarchical decorator:
@StageRegistry.register(recipe="finance", workflow="sft", stage="training") class SFTStage(BaseStage): workflow = "sft" def execute(self, config, cluster, expname, run_after=None): # Your implementation pass
- Add to workflow YAML with short stage name:
recipe: finance workflow: name: "sft" pipeline_stages: - sft # Short name! stages: sft: run_name: "baseline-lr5e6" # Optional: distinguish experiment runs # Your stage configuration
- Run it with
nflow runornflow run-all
Terminal output in stages: Use the console helpers for consistent, readable logs when your stage runs (e.g. console.status(), console.detail(), console.success()). See Console UI guide.
Example: nvflow/recipes/example/stages/sdg/generate_answer.py
Simple demonstration recipe for learning the framework:
- Stage:
example.sdg_simple.generate_answer- Basic SDG workflow with nemo-skills integration - Config:
nvflow/recipes/example/workflows/sdg_simple.yaml - Purpose: Learning NVFlow framework basics
π Complete Finance Recipe Documentation β
End-to-end pipeline for generating synthetic financial Q&A data from SEC filings and training financial reasoning models.
Quick Links:
- Quick Start (~3 hour demo) - Get started quickly with 7 companies
- Workflow Guides - Detailed guides for all 6 workflows
- Stage Reference - Technical specifications for 42 stages
Pipeline:
download-sec β template-sdg / document-sdg β sft β eval β grpo
Features:
- 42 stages across 6 workflows
- Two SDG approaches (template-based & document-grounded)
- Multiple model support (GPT-OSS-120B, Qwen3, Nemotron)
- Produces 80K+ synthetic Q&A pairs
- Complete training and evaluation pipeline
nflow list-stages # List all stages (hierarchical)
nflow list-stages --recipe finance # Filter by recipe
nflow list-stages --recipe finance --workflow sft # Filter by workflow
nflow stage-info STAGE_PATH # Stage details (e.g., finance.sft.sft)
nflow stage-info STAGE --recipe R --workflow W # Or with flags
nflow validate --config FILE # Validate config
nflow run STAGE --config FILE # Run specific stage (short name)
nflow run-all --config FILE # Run all stages
nflow version # Show version# Install dev dependencies
uv sync --all-extras
uv run pre-commit install
# Run tests
uv run pytest
# Lint code
uv run ruff check nvflow/ tests/
uv run mypy nvflow/
# Format code
uv run ruff format nvflow/ tests/Apache-2.0
Built on: