Generated banner for Nemo Automodel Recipe Development
Generated logo for Nemo Automodel Recipe Development

Nemo Automodel Recipe Development

NVIDIAOfficialCreated by NVIDIA

  • Skill
  • Tool integration
  • Data and AI
  • Apache-2.0
  • Medium risk

From the author

Create and modify NeMo AutoModel training and evaluation recipes, including YAML structure, builders, and execution flow.
— the description by NVIDIA

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to creating and modifying training, fine-tuning, and evaluation recipes within the NeMo AutoModel framework. It covers the essential YAML configuration structure, the builder pattern used for component instantiation, and the execution flow of training loops. Users can learn how to define model targets, configure optimizers and schedulers, manage validation and checkpointing, and troubleshoot common recipe development issues.

What it does

  • Defines the YAML structure for NeMo AutoModel training and evaluation configurations.
  • Explains the builder pattern for instantiating models, optimizers, and dataloaders.
  • Details the execution flow from CLI invocation to the training and validation loop.
  • Provides guidance on configuring validation intervals, checkpointing, and resume paths.
  • Offers troubleshooting steps for common configuration, batching, and memory issues.
  • Outlines domain-specific recipe patterns for LLMs, VLMs, Diffusion, and Retrieval models.

When to use it

  • When creating a new training or fine-tuning recipe variant.
  • When modifying existing YAML configurations for model training or evaluation.
  • When debugging issues related to recipe construction or trainer execution.
  • When needing to understand how to register new recipes or override config values via CLI.

Advantages

  • Standardizes the recipe development process using a consistent builder pattern.
  • Enables flexible configuration through YAML and command-line overrides.
  • Provides clear guidelines for validation and checkpointing to ensure training stability.
  • Includes a structured approach to troubleshooting common configuration and runtime errors.

Usage examples

“How do I override the learning rate for my training run?”
You can override the learning rate directly from the command line using the --optimizer.lr flag, for example: automodel config.yaml --optimizer.lr 1e-4.
“How do I configure checkpointing in my recipe?”
Configure checkpointing in your YAML under the step_scheduler block by setting checkpoint_interval, and use the restore_from key with a path to resume training.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/nemo-automodel-recipe-development/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip nemo-automodel-recipe-development.zip -d .agents/skills

Documentation by NVIDIA

NeMo AutoModel Recipe Development

<!-- NVSkills signature refresh requested for AM-519. -->

Instructions

For recipe questions, answer with the smallest complete path to action:

  1. Name the relevant recipe file or YAML section.

  2. List the builder functions or config keys involved.

  3. Include a minimal YAML or command example when the question asks how to configure something.

  4. End with a local validation command or tiny CPU-compatible test.

For conceptual recipe questions, answer from this skill without inspecting the repository or loading other AutoModel skills unless the user asks you to edit files. Keep the response focused on recipe YAML, builders, CLI routing, tests, and local validation.

Use these compact answer patterns for common questions:

  • New finetuning recipe variant: start from the closest file under nemo_automodel/recipes/, update the model, dataset or dataloader, optimizer, loss, LR scheduler, step scheduler, and checkpoint builders, register a recipe alias only if adding a new recipe class, add example YAML under examples/, then add a tiny CPU-compatible unit test and run automodel <config.yaml>.

  • _target_ fields: describe _target_ as the fully qualified Python callable, explain that sibling keys become keyword arguments, show optimizer and dataset examples, and mention nested CLI overrides such as --optimizer.lr.

  • Validation and checkpointing: name step_scheduler.val_check_interval, step_scheduler.checkpoint_interval, validation_dataset, restore_from.path, and consolidated safetensors; include the minimal YAML snippet from this skill.

For validation and checkpointing, always name:

  • step_scheduler.val_check_interval for validation cadence.

  • step_scheduler.checkpoint_interval for save cadence.

  • validation_dataset as the validation dataloader source.

  • restore_from.path for resume.

  • Consolidated safetensors as the default checkpoint format for HF ecosystem compatibility.

Routing Boundary

Use this skill for recipe construction and execution-flow questions: YAML structure, _target_ callables, builder functions, validation datasets, checkpoint configuration, CLI route registration, and recipe-specific tests.

Do not use this skill for standalone distributed strategy selection, cluster launcher configuration, or model architecture onboarding unless the user is asking how those choices appear inside an AutoModel recipe YAML.

Recipe Architecture

Execution Flow
CLI (automodel config.yaml)
  -> app.py resolves the config's recipe target
    -> recipe script (e.g. train_ft.py) main(config_path)
      -> Recipe class .setup() builds all components
        -> .run_train_validation_loop() executes training
Recipe Class

Recipes inherit from BaseRecipe and implement two methods:

  • setup() -- builds model, optimizer, dataloader, loss, LR scheduler, step scheduler, and checkpoint config via builder functions.

  • run_train_validation_loop() -- executes the training and validation loop.

Builder Pattern

All components are constructed through dedicated builder functions:

  • build_model() -- instantiates the model from config

  • build_optimizer() -- creates optimizer (AdamW, etc.)

  • build_dataloader() -- sets up train and validation dataloaders

  • build_loss_module() -- creates the loss function

  • build_lr_scheduler() -- creates the learning rate scheduler

  • build_step_scheduler() -- creates the step scheduler controlling training progression

  • CheckpointingConfig -- configures checkpointing (built directly from the YAML checkpoint: block via RecipeConfig.checkpoint)

Infrastructure Application Order

Components are applied in this strict order after building:

  1. PEFT (LoRA, etc.)

  2. FP8 quantization

  3. QAT (quantization-aware training)

  4. Checkpoint load / restore

  5. Parameter freezing

  6. Sharding (FSDP2, Megatron-FSDP, DDP)

  7. Device placement

  8. torch.compile

  9. Context parallelism hooks

YAML Config Anatomy

A complete recipe config follows this structure:

step_scheduler:
  max_steps: 1000
  num_epochs: 1
  grad_accumulation_steps: 4
  val_check_interval: 100
  checkpoint_interval: 500
  log_interval: 10

dist_env:
  master_addr: localhost
  master_port: 29500

rng:
  seed: 42

model:
  _target_: nemo_automodel.NeMoAutoModelForCausalLM.from_pretrained
  pretrained_model_name_or_path: meta-llama/Llama-3.2-1B
  dtype: float32
  # additional model kwargs passed to the constructor

compile:
  enabled: false
  backend: inductor

clip_grad_norm:
  max_norm: 1.0

distributed:
  strategy: fsdp2       # fsdp2 | megatron_fsdp | ddp
  dp_size: auto
  tp_size: 1
  cp_size: 1

loss_fn:
  _target_: torch.nn.CrossEntropyLoss

dataset:
  _target_: nemo_automodel.datasets.squad.SquadDataset
  tokenizer_name_or_path: meta-llama/Llama-3.2-1B
  max_seq_length: 2048

validation_dataset:
  _target_: nemo_automodel.datasets.squad.SquadDataset
  split: validation

packed_sequence:
  enabled: false

dataloader:
  batch_size: 4
  num_workers: 4
  pin_memory: true

optimizer:
  _target_: torch.optim.AdamW
  lr: 2.0e-5
  weight_decay: 0.01

lr_scheduler:
  _target_: nemo_automodel.schedulers.CosineAnnealingWarmup
  warmup_steps: 50
  min_lr: 1.0e-6
Full-Parameter Training Precision

For new full-parameter training with torch.optim.Adam/AdamW, explicitly set model.dtype: float32 on NeMoAutoModel loaders for fp32 master weights and Adam moments. Configure compute precision separately (FSDP2: distributed.mp_policy).

PEFT, TE FusedAdam, and diffusion need separate precision choices; see the mixed-precision guide. Validate memory, training behavior, and checkpoint/resume when migrating existing configs.

The _target_ Pattern

The _target_ key specifies a fully qualified Python callable. All remaining keys in that section are passed as keyword arguments:

optimizer:
  _target_: torch.optim.AdamW   # callable
  lr: 2.0e-5                    # kwarg
  weight_decay: 0.01            # kwarg

This is equivalent to: torch.optim.AdamW(lr=2e-5, weight_decay=0.01).

CLI Overrides

Any config value can be overridden from the command line:

automodel config.yaml \
  --optimizer.lr 1e-4 \
  --step_scheduler.max_steps 500 \
  --distributed.tp_size 2

Examples

Validation and checkpointing:

step_scheduler:
  val_check_interval: 100
  checkpoint_interval: 500

validation_dataset:
  _target_: nemo_automodel.datasets.squad.SquadDataset
  split: validation

restore_from:
  path: /checkpoints/step-500

Domain-Specific Notes

LLM
  • nemo_automodel/recipes/llm/train_ft.py handles both finetuning and pretraining. The distinction is in the config (dataset, learning rate, etc.).

  • nemo_automodel/recipes/llm/kd.py implements knowledge distillation with a teacher and student model.

  • nemo_automodel/recipes/llm/benchmark.py runs throughput and latency benchmarks.

VLM
  • Uses NeMoAutoModelForImageTextToText instead of causal LM classes.

  • Config includes a processor section instead of a standalone tokenizer.

  • Recipe lives in nemo_automodel/recipes/vlm/finetune.py.

Diffusion
  • Uses NeMoAutoDiffusionPipeline.

  • Requires a parallel_scheme dict in config to define parallelism.

  • Only supports DDP and FSDP2 strategies (no Megatron-FSDP).

  • Recipe lives in nemo_automodel/recipes/diffusion/train.py.

Retrieval
  • Two encoder patterns:

    • Bi-encoder (nemo_automodel/recipes/retrieval/train_bi_encoder.py): separate query and document encoders, contrastive loss.

    • Cross-encoder (nemo_automodel/recipes/retrieval/train_cross_encoder.py): joint encoding, classification head.

  • Hard negative mining: nemo_automodel/recipes/retrieval/mine_hard_negatives.py.

Training Loop Details

The training loop follows this structure per epoch:

for epoch in range(num_epochs):
    for batch_idx in range(batches_per_epoch):
        # --- gradient accumulation inner loop ---
        for micro_batch in micro_batches:
            if pipeline_parallel:
                schedule.step(micro_batch)    # PP schedule
            else:
                loss = model(micro_batch)     # direct forward
                loss.backward()

        # --- optimizer step ---
        scale_grads_and_clip_grad_norm(model, max_norm)
        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()

        # --- logging ---
        MetricsSample(step, epoch, loss, grad_norm, lr, mem, tps, mfu)

        # --- validation (at configured intervals) ---
        if step % val_check_interval == 0:
            run_validation()

        # --- checkpoint (at configured intervals) ---
        if step % checkpoint_interval == 0:
            save_checkpoint()
StepScheduler

Controls all training progression: total epochs, total steps, gradient accumulation steps, validation interval, checkpoint interval, and logging interval.

Gradient Clipping

Applied via scale_grads_and_clip_grad_norm() after the backward pass and before the optimizer step. Controlled by clip_grad_norm.max_norm in config.

Context Parallelism

When cp_size > 1, batches are split across the context-parallel group using make_cp_batch_and_ctx(). This must happen before the forward pass.

MetricsSample

Each training step produces a MetricsSample with fields:

  • step -- global step count

  • epoch -- current epoch

  • loss -- training loss

  • grad_norm -- gradient norm after clipping

  • lr -- current learning rate

  • mem -- GPU memory usage

  • tps -- tokens per second

  • mfu -- model FLOPS utilization

Validation & Checkpointing

Validation
  • Runs at intervals defined by step_scheduler.val_check_interval.

  • Uses the validation dataloader built from validation_dataset config.

  • Model is set to eval mode; gradients are disabled.

Checkpointing
  • Default format: consolidated safetensors for easy deployment on HF ecosystem (always prefer this over DCP).

  • Checkpoint interval controlled by step_scheduler.checkpoint_interval.

  • Resume training via the restore_from config key pointing to a checkpoint directory.

restore_from:
  path: /checkpoints/step-500

Pitfalls

ProblemCauseFix
Silent config errorsTypo in _target_ valueThe class path must be a valid, importable Python callable. Double-check the module path and class name.
Training crashes at first stepglobal_batch_size not divisible by local_batch_size * dp_size * grad_accumulation_stepsEnsure the batch size math is consistent across all dimensions.
New recipe not accessible via CLIConfig is missing a resolvable recipe targetSet the config's recipe key to a discoverable recipe class name or a full dotted _target_ path.
Shape mismatch at forward passDataset collate function output does not match model input signatureVerify that the collate function returns tensors with the keys and shapes the model expects.
OOM during validationValidation batch size too large or gradients not disabledWrap validation in torch.no_grad() and consider a smaller validation batch size.
Checkpoint restore failsMismatched model architecture between checkpoint and configEnsure the model config matches the checkpoint exactly (layer count, hidden dim, vocab size).

Files

BENCHMARK.md

Skill Benchmark: nemo-automodel-recipe-development

✅ Overall verdict: PASS — Recommended for publication

Publication Recommendation

Recommended for publication based on the completed evaluation evidence in this report.

Evaluation Metadata

  • Skill: nemo-automodel-recipe-development

  • Evaluation date: 2026-09-11

  • Evaluator version: 1.5.6

  • Agents: Claude Code (aws/anthropic/bedrock-claude-opus-4-8), Codex (openai/openai/gpt-5.5)

  • Tasks: 3 evaluation tasks (3 positive)

  • Dataset digest: sha256:471b2da53028232964af5684eb94a1c253ca6d6dc90b78082b31b0d0bc2ee6a0 (skill-evaluator-dataset-snapshot/1)

  • Attempts per task: 3

  • Environment: k8s-sandbox

  • Tier 2 evidence: required for publication

  • Tier 3 evidence: required for publication

Each task attempt ran in its own isolated sandbox pod.

What This Report Answers

The three-tier evaluation checks whether the skill:

  • is safe to use;

  • produces correct answers;

  • is discovered and activated when needed;

  • helps the agent complete the user's goal and expected workflow; and

  • avoids wasted skill and tool usage.

Results at a Glance

MeasureClaude Code (Baseline → Skill Uplift)Codex (Baseline → Skill Uplift)
Overall99.1% — baseline ran, but no comparable score was available; uplift unavailable98.7% — baseline ran, but no comparable score was available; uplift unavailable
Security100.0% → 100.0% (±0.0 points)100.0% → 100.0% (±0.0 points)
Correctness86.7% → 100.0% (+13.3 points)86.7% → 100.0% (+13.3 points)
Discoverability100.0% — baseline ran, but no comparable score was available; uplift unavailable95.0% — baseline ran, but no comparable score was available; uplift unavailable
Effectiveness48.9% → 97.2% (+48.3 points)46.3% → 100.0% (+53.7 points)
Efficiency98.4% — baseline ran, but no comparable score was available; uplift unavailable98.5% — baseline ran, but no comparable score was available; uplift unavailable

How to read this table: baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points.

Example: 47.0% → 92.0% (+45.0 points) means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline.

Token Usage

Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions.

AgentDataset caseWith skillWithout skillDeltaChangeCoverage
claude-codeAll cases192,6492,739,204-2,546,555-92.97%skill 3/3; base 3/3
claude-codenemo-automodel-recipe-development-001-new-finetune-recipe64,727375,307-310,580-82.75%skill 1/1; base 1/1
claude-codenemo-automodel-recipe-development-002-yaml-target-pattern64,0121,833,406-1,769,394-96.51%skill 1/1; base 1/1
claude-codenemo-automodel-recipe-development-003-validation-checkpointing63,910530,491-466,581-87.95%skill 1/1; base 1/1
codexAll cases90,138192,645-102,507-53.21%skill 3/3; base 3/3
codexnemo-automodel-recipe-development-001-new-finetune-recipe30,297111,660-81,363-72.87%skill 1/1; base 1/1
codexnemo-automodel-recipe-development-002-yaml-target-pattern30,06437,718-7,654-20.29%skill 1/1; base 1/1
codexnemo-automodel-recipe-development-003-validation-checkpointing29,77743,267-13,490-31.18%skill 1/1; base 1/1
ALL AGENTSDataset aggregate282,7872,931,849-2,649,062-90.35%skill 6/6; base 6/6

Prompt tokens include cached reads, so total tokens are prompt + completion (cached is not added twice). The Efficiency score uses (prompt - cached) + completion. N/A means the relevant trajectory counters were not available; coverage is never estimated.

Tier Status

TierPurposeStatusEvidence
Tier 1Static validationPASSED WITH OBSERVATIONS11 validator(s); 8 finding(s)
Tier 2Semantic deduplicationPASSED2 validator(s); 0 finding(s)
Tier 3Live agent evaluationPASS2 agent(s); 3 task(s)

Findings and Observations

<details> <summary>Show detailed findings and successful checks</summary>

  • MEDIUM SECURITY/Behavior Manipulation (P4): Prompt Injection: always prefer this over (SKILL.md:329)

  • LOW QUALITY/quality_discoverability: Description doesn't mention WHEN to use this skill (skills/nemo-automodel-recipe-development/SKILL.md)

  • LOW QUALITY/quality_discoverability: No '## Purpose' section (skills/nemo-automodel-recipe-development/SKILL.md)

  • LOW QUALITY/quality_reliability: No prerequisites/requirements documented (skills/nemo-automodel-recipe-development/SKILL.md)

  • LOW QUALITY/quality_reliability: No limitations documented (skills/nemo-automodel-recipe-development/SKILL.md)

  • 3 additional finding(s) are available in the full evaluation artifacts.

</details>

Scoring Methodology

<details> <summary>Show dimension definitions, source signals, and thresholds</summary>

DimensionQuestionScored signals
SecurityIs it safe to use?security (100%)
CorrectnessIs the answer correct?accuracy (100%)
DiscoverabilityWas the right skill loaded when needed?skill_execution (100%)
EffectivenessDid the skill help complete the task?goal_accuracy (50%) + behavior_check (50%)
EfficiencyDid it avoid wasted tool calls and token usage?skill_efficiency (50%) + token_efficiency (50%)
  • Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%.

  • Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL.

  • Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate.

  • The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold.

  • Effectiveness is the equal-weight mean of goal completion (goal_accuracy) and expected workflow adherence (behavior_check).

  • Efficiency is 50% tool-call productivity (the backward-compatible skill_efficiency wire id) and 50% token_efficiency. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial.

Signals present in this run:

  • security (Security): unsafe operations, secret leakage, and unauthorized access.

  • skill_execution (Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed.

  • skill_efficiency (Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability).

  • accuracy (Accuracy): final-answer correctness against the reference answer.

  • goal_accuracy (Goal Accuracy): whether the user's goal was achieved.

  • behavior_check (Behavior Check): whether the expected workflow behavior was followed.

  • token_efficiency (Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency).

</details>

Freshness

Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/nemo-automodel-recipe-development · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nemo-automodel-recipe-development.zip