Skip to content

feat(configs): hydra config groups for the batchflow stack - #558

Open
ElmoPA wants to merge 7 commits into
bf/6-testsfrom
bf/7-configs
Open

feat(configs): hydra config groups for the batchflow stack#558
ElmoPA wants to merge 7 commits into
bf/6-testsfrom
bf/7-configs

Conversation

@ElmoPA

@ElmoPA ElmoPA commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

data, experiment, evaluator and callbacks groups, plus the three model configs
any surviving config references. Per-arm model variants are deliberately not
included.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

ElmoPA commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@ElmoPA
ElmoPA changed the base branch from bf/6-tests to graphite-base/558 August 7, 2026 21:03
@ElmoPA
ElmoPA force-pushed the graphite-base/558 branch from 1c3da50 to 48db95d Compare August 8, 2026 05:33
@ElmoPA
ElmoPA changed the base branch from graphite-base/558 to bf/6-tests August 8, 2026 05:33
@ElmoPA
ElmoPA force-pushed the bf/7-configs branch 2 times, most recently from 0855598 to 3c29a2b Compare August 8, 2026 07:27
@ElmoPA
ElmoPA force-pushed the bf/6-tests branch 2 times, most recently from 0b796a7 to ae704d6 Compare August 8, 2026 19:02
@ElmoPA
ElmoPA force-pushed the bf/7-configs branch 3 times, most recently from ea0fd13 to 6d650f1 Compare August 8, 2026 20:08
@ElmoPA
ElmoPA force-pushed the bf/6-tests branch 2 times, most recently from f6c5cc2 to 1c41133 Compare August 8, 2026 22:48
ElmoPA and others added 7 commits August 9, 2026 07:19
data, experiment, evaluator and callbacks groups, plus every model config the
rest of the tree actually references.

An earlier pass kept 3 model configs. Scanning hydra_configs, tests and scripts
for names that resolve against the model group finds 62 referenced, so that
prune broke two things at once:

  * all 31 experiment configs -- each carries an `override /model:`, so hydra
    fails at `Could not find 'model/<name>'` before any code runs;
  * 25 cases in tests/test_config_compose.py, covering the dfot_*, vae_* and
    bc_rnn_pushshapes_paperexact_* families.

The 59 missing configs are restored here, bringing the model group to the 62
that are reachable from the tree. Two of them (bf_rh_sdp_dual,
bf_rh_sdp_nodual) are the only configs that instantiate egomimic/pipeline, so
without them the batchflow runner shipped unreachable.

The remaining 181 per-arm variants on elmo/batchflow-core are still
deliberately excluded -- nothing in this tree references them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…amilies

The model group was 62 flat files, 9,581 lines, with exactly one config
(pi0.5_bc_eva) using defaults-inheritance. Everything else was authored by
copying a whole file and editing a few numbers.

Folders. Each model family gets its own directory and the filename drops the
prefix the folder already carries:

    hnet_cotrain_cossim_s4_trunk_200M.yaml
      -> hnet_cotrain_cossim/s4.yaml            (model=hnet_cotrain_cossim/s4)

64 configs, 10 folders, none left at the root. Every reference was rewritten:
8 in-repo files plus 26 scratch launchers outside the repo. Old -> new mapping
is saved at scratch/name_mapping_full.txt, since model names appear in the
Results Ledger and run pages as provenance.

Deduplication. Two families were literal copies differing only in numbers, and
both are now base + thin variants:

  * hnet_cotrain_cossim -- 12 configs, 270 of 304 lines identical across all of
    them (89%). The whole family is one 5-stage skeleton with a different split
    of transformer depth between the per-embodiment levels and the shared apex.
    Now 8 knobs; each variant is ~13 lines. 3,642 -> 961 lines.
  * hnet_dualstream_txar -- 3 configs, 9 knobs. txar_m16 turns out to differ
    from txar in k_agnostic/k_specific alone (3/2 -> 10/6).

Model group overall: 9,581 -> 6,414 lines.

The knobs are top-level scalars referenced by interpolation rather than
overridden in place, because outer_stage.hnet.stages is a YAML *list* and
OmegaConf replaces lists wholesale on merge -- a variant cannot override one
element of it.

Defaults entries need @_here_ (e.g. `- hnet_cotrain_cossim/base@_here_`).
Without it Hydra derives the package from the folder path and merges the base
under model.hnet_cotrain_cossim instead of the model root; the config still
composes and the tests still pass, it just silently inherits nothing.

The other seven families are NOT factored. Each has line-count differences
between members, i.e. they are structurally different models that share
boilerplate rather than copies of one template, so the same mechanical proof
does not apply. Duplication left: dfot 31%, bc_rnn 58%, vae 62%,
hnet_pushshapes 39%, hpt 34%, 2trunk 44%, bf_rh 39%.

Verified: parameterization proven lossless by reconstruction (11/11 cossim,
3/3 txar reproduce the originals byte-for-byte) before anything was written;
all 31 experiment configs compose; tests/test_config_compose.py 25 passed; and
the resolved model config of every one of the 62 pre-existing configs was
compared across the rename -- 48 identical, 14 differing only by the added
knob keys, 0 real differences.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
data/pushshapes/packed_episode/simulation/delta.yaml pointed at
Tsim_datasets2/circle, which today contains a single basic/ subdirectory and
zero .zarr episodes. LocalEpisodeResolver does not recurse (AGENTS.md:139 says
so explicitly), so the config resolved to an empty dataset and training died
with:

    No valid collection names from local filtering: filters matched no
    episodes in the local directory.

The episodes live one level down. Both the train and valid resolver paths now
point at circle/basic.

Verified: the composed config resolves to a directory containing 311 .zarr
episodes (previously 0); all 32 experiment configs still compose.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
evaluator/dfot, evaluator/tf and model/dfot move to the DFoT PR stacked above.
No experiment config selects them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This stack added egomimic/scripts/eva_process/zarr_write_test.py while main has
the same converter at egomimic/rldb/zarr/hdf5_to_zarr.py, so merging would have
partly undone #562, which renamed it. Git recorded that as a rename, so a
delete-oriented check across the stack missed it; content-level duplicate
detection found the shared bodies (main 179 lines, is_image_array 38,
needs_transpose_to_hwc 17).

The copy here is also the older fork: it predates main's mandatory-intrinsics
change and omits the intrinsics= kwarg entirely, so it would write zarr episodes
with no camera calibration -- the exact failure that per-episode intrinsics were
introduced to prevent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Claude Code Review

Review: PR #558 — Hydra config groups for the batchflow stack

Summary

Large-scale reorganization of egomimic/hydra_configs/ into nested group directories (data/, callbacks/, model/, evaluator/, experiment/). Mostly file renames + new bundle configs; also folds in a couple of unrelated changes (Tsimulation obstacle levels, a docstring edit in eval_sim.py).

Key concerns

1. Stray edit in egomimic/eval/core/eval_sim.py — broken indentation in a comment

# cosmetic. Existing eval_hnet_sim.yaml and downstream callers keep working.
        # cosmetic. Existing evaluator/hnet/sim.yaml and downstream callers keep working.
HNetSimEval = PackedSimEval

The replaced line has 8 leading spaces at module scope. It's a comment so it parses, but it's clearly an accidental sed artifact. Fix to column 0.

2. Self-referential defaults in checkpoint variants

callbacks/checkpoint/ema.yaml, thin.yaml, transplant.yaml, transplant_router.yaml all do:

defaults:
  - checkpoint/base@_here_

Inside callbacks/checkpoint/, the relative group is just base, not checkpoint/base. Compare to callbacks/checkpoint/base.yaml which correctly uses /callbacks/base@_here_ (absolute). Almost certainly these need to be - base@_here_ or - /callbacks/checkpoint/base@_here_. Please instantiate each one via a smoke test (python -c "import hydra; hydra.compose(...)") before merging — Hydra defaults-list bugs surface only at compose time.

3. Missing newline at EOF in callbacks/base.yaml

Minor, but the diff shows \ No newline at end of file. Style-wise the rest of the repo terminates configs with a newline.

4. pl_utils.callbacks.* module paths — verify they exist

_target_s changed from egomimic.utils.timing_callback.WandbProfilerLogger (old) to egomimic.pl_utils.callbacks.timing_callback.WandbProfilerLogger (new). Also referenced: pl_utils.callbacks.random_attn_dropout, pl_utils.callbacks.chunker_residual_scheduler, pl_utils.callbacks.ratio_loss_scheduler. If this PR doesn't also move those files, every callback config is broken. Please confirm the module moves happened (or are in a companion PR that lands first).

5. Unrelated changes bundled in

  • Tsimulation/sim_v2/pushshapes/obstacles.py: new levels 23–26, changed _collection_levels assertion 22 → 26. Substantive logic change, unrelated to config groups. Should be a separate PR — this is exactly the kind of change that gets missed in a "config rename" review.
  • eval_sim.py docstring edit (see [FIX] use cv2.resize to fix OOM issue for image reading #1).

6. Docstring drift not verified

CONTRIBUTING_DATA.md, README.md, and latent_dataset.py update paths (e.g., aria.yamlaria/base.yaml). But I don't see aria/base.yaml created in this diff — the renames go aria.yamldebug/single_episode/human_cartesian.yaml. Either the docs are wrong or a file is missing. Grep the tree and reconcile.

7. Backward-compat / active experiments

Deleted files with no shim:

  • data/cotrain_pickplace_qwen_objgen.yaml, cotrain_pickplace_qwen_wrist.yaml, aria_keypoints.yaml, aria_keypoints_wrist.yaml

Replacements exist at new paths (e.g., pick_place/cartesian/eva_human_qwen_objgen.yaml). Any in-flight sweep / submitit job / wandb resume referencing old data=cotrain_pickplace_qwen_objgen will break. Consider (a) a one-liner mapping table in the PR description, and (b) checking #experiments / recent launch scripts for stale references.

Suggestions

  1. Fix the four self-referential defaults entries in callbacks/checkpoint/.
  2. Split the Tsimulation obstacle changes into their own PR.
  3. Fix the eval_sim.py indentation.
  4. Add a compose-time smoke test in CI: iterate every top-level experiment config and call hydra.compose(...) — would have caught Main fixes move to roger's pipeline branch #2 and Merge latest progress from Main to UCSD branch #4.
  5. Reconcile aria/base.yaml / scale/base.yaml doc references with the actual new tree.
  6. Post the rename table in the PR body so people running long experiments can update their launch commands.

Verdict: Request Changes

Primarily for the checkpoint defaults-list bug (#2) and the unrelated Tsimulation changes (#5). Everything else is small. Once compose-tested and split, this is a nice cleanup.


Reviewed by Claude · Review workflow

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Claude Code Review

Review

Summary

Large-scale reorganization of Hydra config groups into nested directories (data/, callbacks/, evaluator/, etc.) with new bundle configs for callbacks. Also includes unrelated changes to Tsimulation/pushshapes/obstacles.py and a couple of doc comments.

Key concerns

  1. Missing newline at EOF in egomimic/hydra_configs/callbacks/base.yaml (log_every_n_steps: 100 with no trailing newline). Minor but the old file had the same issue — worth fixing while touching it.

  2. Broken comment indentation in eval_sim.py — the diff shows:

    # cosmetic. Existing eval_hnet_sim.yaml and downstream callers keep working.
            # cosmetic. Existing evaluator/hnet/sim.yaml and downstream callers keep working.

    The replacement comment is indented 8 spaces mid-module, which is a syntax-adjacent oddity (still a comment, so won't error, but looks like a botched sed). Please clean up.

  3. WandbProfilerLogger module path change: base.yaml now points to egomimic.pl_utils.callbacks.timing_callback.WandbProfilerLogger, but the deleted defaults.yaml pointed to egomimic.utils.timing_callback.WandbProfilerLogger. Is that module move part of another PR? If not, this will fail to instantiate. Please verify import path exists on this branch.

  4. Self-referential defaults in checkpoint/ema.yaml, checkpoint/thin.yaml, checkpoint/transplant.yaml, checkpoint/transplant_router.yaml:

    defaults:
      - checkpoint/base@_here_

    These files live under callbacks/checkpoint/. A relative checkpoint/base from inside checkpoint/ will resolve to callbacks/checkpoint/checkpoint/base.yaml — which doesn't exist. Compare with the bundles which correctly use /callbacks/checkpoint/base@_here_ (absolute). This is almost certainly broken. Should be either base@_here_ (relative to same dir) or /callbacks/checkpoint/base@_here_ (absolute).

  5. Unrelated changes in Tsimulation/sim_v2/pushshapes/obstacles.py: adds levels 23–26 (radial rooms, plus, three-way), changes assert len(base_families) == 2226. This is a substantive obstacle-level API change bundled into a "config groups" PR. Please split — anyone using level ranges/families downstream needs to review this separately, and it complicates rollback.

  6. Massive scope: config rename affects nearly every training entry point. No mention in the description of:

    • How you validated existing configs still resolve (hydra --cfg job sweeps?)
    • Whether checkpoint resume paths embedded in run dirs still work
    • Norm stats caching — some caches key on config paths
  7. bundle/attn_dropout.yaml references /callbacks/checkpoint/base@_here_ — that composes model_checkpoint from base, but doesn't set every_n_epochs overrides like other bundles. Confirm the base's every_n_epochs: 100 is what you want here (vs. chunker_dropout.yaml which overrides to 20).

Suggestions

  1. Run hydra --cfg job --resolve against every canonical experiment config in hydra_configs/experiment/ and confirm each resolves. Attach the summary to the PR.
  2. Fix the defaults: - checkpoint/base@_here_ bug (see Merge latest progress from Main to UCSD branch #4). Test by actually instantiating one of the transplant configs.
  3. Split the obstacles.py change into a separate PR.
  4. Fix the botched comment in eval_sim.py.
  5. Confirm egomimic.pl_utils.callbacks.timing_callback exists — if not, update the target or land the module move first.
  6. Add a mapping table (old→new) to the PR body so downstream users updating their local launch scripts have a reference. There are ~40 renames; a table saves everyone time.
  7. Consider a shim script or data/aliases.yaml for one release to avoid breaking in-flight experiments that reference old paths.

Verdict: Request Changes

The checkpoint/* self-referential defaults look broken, and the unrelated obstacle changes should be split out. Once those are addressed and you've confirmed all downstream configs resolve, this is fine — the reorg itself is reasonable and overdue.


Reviewed by Claude · Review workflow

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.

1 participant