Skip to content

fix(action): validate nano DROID policy SFT TOML against the schema (#138) - #139

Merged
lfengad merged 2 commits into
NVIDIA:mainfrom
fwd4:fix/nano-droid-policy-toml-schema
Jul 28, 2026
Merged

fix(action): validate nano DROID policy SFT TOML against the schema (#138)#139
lfengad merged 2 commits into
NVIDIA:mainfrom
fwd4:fix/nano-droid-policy-toml-schema

Conversation

@fwd4

@fwd4 fwd4 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

The action_policy_droid_nano post-training config could not be loaded via the documented --sft-toml entry point: examples/toml/sft_config/action_policy_droid_nano.toml carried [model.rectified_flow_training_config] and [dataloader_train.dataloader] blocks that SFTExperimentConfig (extra="forbid") does not model, so load_experiment_from_toml raised ValidationError. Addresses #138.

Fix (mirrors the edge recipe)

Keep these values in the registered recipe instead of the TOML:

  • Set the inner dataloader scalars (batch_size=16 / num_workers=16 / prefetch_factor=2, the reference values) in action_policy_droid_nano.
  • Drop both blocks from the TOML (loss_scale=10 was already set in the recipe).

The TOML now contains only schema-registered blocks, so it validates with no schema change — consistent with how action_policy_droid_edge already works, and with i4 (which keeps loss_scale/dataloader in the experiment config).

Test

TestExampleTomlConfigs in sft_config_test.py is parametrized over every examples/toml/sft_config/*.toml, validating each against SFTExperimentConfig and building its Hydra override list. The existing unittest job in gpu-tests.yml runs pytest cosmos_framework/, so the new test is picked up automatically (no new workflow needed).

Verified locally: all 12 example TOMLs pass validation + override construction with the fix applied.

🤖 Generated with Claude Code

`examples/toml/sft_config/action_policy_droid_nano.toml` carried
`[model.rectified_flow_training_config]` and `[dataloader_train.dataloader]`
blocks that `SFTExperimentConfig` (`extra="forbid"`) does not model, so loading
it via `--sft-toml` raised `ValidationError` (issue NVIDIA#138). The TOML had never
validated against the schema; reference runs used the Hydra `experiment=` path,
so the structured-TOML entry point was never exercised.

Follow edge practice and keep these values in the registered recipe instead of
the TOML:
- set the inner dataloader scalars (batch_size/num_workers/prefetch_factor) to
  the reference values in `action_policy_droid_nano`;
- drop both blocks from the TOML (`loss_scale=10` was already set in the recipe).

Add a parametrized test that validates every `examples/toml/sft_config/*.toml`
against the schema and builds its Hydra overrides. The existing `unittest` job
in gpu-tests.yml runs the whole `cosmos_framework/` suite, so the new test is
picked up automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@fwd4
fwd4 force-pushed the fix/nano-droid-policy-toml-schema branch from 5706456 to 0a5d8f4 Compare July 28, 2026 06:49
@lfengad
lfengad enabled auto-merge (squash) July 28, 2026 07:50
@lfengad
lfengad merged commit 8ae459f into NVIDIA:main Jul 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants