Sync official LeRobot v3 release - #5
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR syncs the repository to the official LeRobot v3 release workflow for OMG-Data, introducing LeRobot v3-compatible export/ingest tooling, a cache-first episode materialization path, and exact (including distributed) statistics/validation needed for large-scale training.
Changes:
- Add LeRobot v3 dataset schema + export/inspect CLIs and a
LeRobotG1MotionDatasetadapter for training-time window sampling and feature encoding. - Introduce episode-cache materialization (frame-level qpos/FK tensors) plus validation/inspection utilities, and update training/materialization/stats pipelines to use it.
- Improve training robustness and throughput (interleaved shard sampling, bounded validation, divergence guard monitoring a configurable loss component), and update docs/config defaults accordingly.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/robots/test_g1_kinematics_fast.py | Updates kinematics/feature-codec test to use G1MotionFeatureCodec directly. |
| tests/generation/test_train_callbacks.py | Adds coverage for skipping logger-dependent callbacks when logger is disabled. |
| tests/generation/test_materialized_dataset.py | Updates materialized dataset test to new summary.json format and stats-batch iterator. |
| tests/generation/test_episode_cache.py | Adds tests for episode-cache indexing, atomic publishing, resumption, and stats iteration. |
| tests/generation/test_compute_stats.py | Adds tests for float64 moments and empty distributed partitions. |
| tests/data/test_lerobot_official_compat.py | Validates OMG export is loadable by the official lerobot loader. |
| tests/data/test_lerobot_export.py | End-to-end export + adapter + episode-cache materialization test coverage. |
| tests/data/test_build_lerobot_config.py | Adds test for generated export config preserving split availability. |
| tests/callbacks/test_divergence_guard.py | Extends divergence-guard tests for monitoring a specific loss component. |
| src/omg/tracking/holomotion/runner.py | Sets MUJOCO_GL to glfw on macOS, egl elsewhere. |
| src/omg/render/mujoco.py | Aligns default MUJOCO_GL selection with macOS vs non-macOS behavior. |
| src/omg/data/unified.py | Improves label/text resolution with relative-path indexing; flushes cache build log. |
| src/omg/data/materialized.py | Adds iter_stats_batches() to support exact scalable stats on materialized shards. |
| src/omg/data/lerobot_schema.py | Introduces LeRobot v3 schema/constants and feature definitions. |
| src/omg/data/lerobot_inspect.py | Adds LeRobot export inspection/validation helper. |
| src/omg/data/lerobot_export.py | Implements LeRobot v3 export writer + pipeline to export unified sources. |
| src/omg/data/lerobot_dataset.py | Adds LeRobot v3 dataset adapter for OMG training, including exact stats iterators. |
| src/omg/data/episode_cache.py | Adds episode-cache dataset reading exact windows from cached frame-level tensors. |
| src/omg/data/episode_cache_inspect.py | Adds episode-cache integrity inspector. |
| src/omg/data/datamodule.py | Updates distributed sampler to interleave shard blocks for better batch mixing/caching. |
| src/omg/data/init.py | Exposes LeRobotG1MotionDataset via package lazy import. |
| src/omg/cli/generation/train.py | Makes callbacks logger-aware via requires_logger gating. |
| src/omg/cli/generation/compute_stats.py | Switches to exact batch-based stats, float64 moments, and distributed aggregation. |
| src/omg/cli/data/validate_episode_cache.py | Adds CLI to validate episode-cache structure and manifests. |
| src/omg/cli/data/materialize.py | Updates defaults/naming and supports LeRobot dataset target in materialization config resolution. |
| src/omg/cli/data/materialize_episode_cache.py | Adds episode-cache materialization CLI with resumable atomic writing. |
| src/omg/cli/data/inspect_lerobot.py | Adds CLI wrapper for LeRobot export inspection. |
| src/omg/cli/data/export_lerobot.py | Adds CLI wrapper for exporting LeRobot v3 datasets. |
| src/omg/cli/data/build_lerobot_config.py | Adds CLI to generate export configs from a unified source root. |
| src/omg/callbacks/divergence_guard.py | Adds configurable loss_monitor for divergence guard error detection/messages. |
| scripts/validate_lerobot_official.py | Adds script to validate exports using the official lerobot loader. |
| scripts/materialize_omg_data.sh | Updates materialization script to build the episode-cache artifact by default. |
| README.md | Updates release links, materialization/stats instructions, and defaults to LeRobot/episode-cache flow. |
| pyproject.toml | Adds [data] extra and includes LeRobot-related dependencies in all. |
| Makefile | Updates default data config selection to omg_data_lerobot. |
| docs/training.md | Updates example commands to use materialized data config. |
| docs/installation.md | Documents installing the new [data] extra. |
| docs/data.md | Rewrites data docs around LeRobot v3 source + episode-cache materialization + export tooling. |
| docs/artifacts.md | Updates artifact links and directory layout to LeRobot v3 format. |
| configs/generation/train.yaml | Switches default training config to omg_data_lerobot. |
| configs/generation/exp/100m.yaml | Bounds val batches and configures divergence guard to monitor diffusion_loss. |
| configs/generation/data/omg_data_materialized.yaml | Switches materialized config to EpisodeCachedG1MotionDataset. |
| configs/generation/data/omg_data_lerobot.yaml | Adds LeRobot v3 source-data config. |
| configs/generation/callbacks/default.yaml | Adds requires_logger and loss_monitor fields to callback configs. |
| assets/stats/g1_125d_stats.json | Adds verified 125D normalization stats artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+270
to
+278
| mean = self.total / float(self.count) | ||
| variance = self.total_sq / float(self.count) - np.square(mean) | ||
| return { | ||
| "count": [self.count], | ||
| "mean": mean.astype(float).tolist(), | ||
| "std": np.sqrt(np.maximum(variance, 0.0)).astype(float).tolist(), | ||
| "min": self.minimum.astype(float).tolist(), | ||
| "max": self.maximum.astype(float).tolist(), | ||
| } |
Comment on lines
+157
to
+160
| def _load_episodes(self, info: dict[str, Any]) -> list[dict[str, Any]]: | ||
| frame = self.episode_dataset.to_pandas() | ||
| if "omg/split" in frame.columns: | ||
| frame = frame.loc[frame["omg/split"] == self.split] |
Comment on lines
+57
to
+63
| episode_files = sorted((root / "meta" / "episodes").rglob("*.parquet")) | ||
| if not episode_files: | ||
| raise FileNotFoundError(f"No episode parquet files found under {root / 'meta' / 'episodes'}") | ||
| rows: list[dict[str, Any]] = [] | ||
| for path in episode_files: | ||
| rows.extend(pq.read_table(path).to_pylist()) | ||
| data = _data_file_stats(root) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
KunYing-Lee/OMG@7900f62Why
The official repository still reflected the June 10 release snapshot and the old window-materialization/statistics workflow. OMG-Data is now published in official LeRobot v3 form, and the cache-first training path has been validated on the full dataset and in a live four-A100 100M training run.
The official and development repositories have unrelated Git histories. As in official PR #1, this branch is based on the official
mainand applies the current development repository tracked tree as one auditable sync commit. The committed tree hash exactly matches the source tree hash:92e0be2dbaf935a951f94ae3eb2d2f0f56920d54.Impact
THU-MARS/OMG-DatadatasetValidation
pytest -q: 134 passed, 4 skipped