-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[python] Add ACT storage benchmark and contiguous windows #9466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YannByron
wants to merge
16
commits into
apache:master
Choose a base branch
from
YannByron:m0/pr3-act-benchmark
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,407
−9
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8a850dd
feat(python): add lazy contiguous window dataset
YannByron 5988a49
feat(python): add paired HDF5 Paimon ACT benchmark
YannByron 94d7d0d
fix(python): harden paired ACT benchmark
YannByron 2af914f
perf(python): coalesce ACT physical fetches
YannByron 5aef6d0
perf(python): tune ACT physical fetch depth
YannByron 6a5fc46
fix(python): align ACT benchmark with latest master
YannByron 6c8b2de
fix(python): isolate ACT benchmark test dependencies
YannByron 1f53ff3
refactor(python): modularize ACT benchmark execution
YannByron 058129e
perf(python): read ACT state from window anchor
YannByron f65afe5
docs(python): clarify window dataset contracts
YannByron ac91b1c
fix(python): satisfy ACT runner style checks
YannByron 09d00bc
fix(python): guard optional ACT benchmark imports
YannByron dfbf459
fix(python): stabilize ACT throughput measurement
YannByron 06fd1c2
test(python): simplify ACT benchmark coverage
YannByron c1dbea1
fix(python): address ACT benchmark review feedback
YannByron 9e0340a
docs(python): clarify ACT benchmark measurements
YannByron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| --- | ||
| title: "RoboMIND ACT Storage Benchmark" | ||
| sidebar_position: 8 | ||
| --- | ||
|
|
||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| # RoboMIND ACT Storage Benchmark | ||
|
|
||
| This benchmark measures the same CPU LeRobot ACT training workload over an | ||
| original RoboMIND AgileX HDF5 dataset or an already ingested and | ||
| canonical-action-backfilled Paimon warehouse. Ingestion and backfill are outside | ||
| the timed scope. | ||
|
|
||
| The backends run independently. A resolved experiment document preserves the | ||
| shared configuration, normalization, seed, episode selection, Paimon snapshot, | ||
| and logical window sequence. Result comparison verifies that contract before it | ||
| calculates performance ratios. | ||
|
|
||
| ## Install | ||
|
|
||
| Python 3.10 or newer is required. | ||
|
|
||
| ```shell | ||
| pip install 'pypaimon[act,hdf5]' | ||
| ``` | ||
|
|
||
| ## 1. Prepare the experiment | ||
|
|
||
| ```shell | ||
| python -m pypaimon.benchmark.act prepare \ | ||
| --input /data/RoboMIND/h5_agilex_3rgb \ | ||
| --warehouse /data/warehouse \ | ||
| --output /data/results/experiment.json | ||
| ``` | ||
|
|
||
| Preparation is not timed. It verifies that HDF5 discovery matches the Paimon | ||
| episodes table, checks versioned action statistics against train-only HDF5 | ||
| moments, selects eligible train and validation episodes, pins the frames | ||
| snapshot, and materializes deterministic measurement, training, and validation | ||
| window indices. | ||
|
|
||
| Without `--experiment`, preparation starts from the packaged | ||
| `default_experiment.json`. `--experiment` replaces that definition, so a | ||
| custom JSON file must contain every required field. Command-line options then | ||
| override individual values: | ||
|
|
||
| ```shell | ||
| python -m pypaimon.benchmark.act prepare \ | ||
| --experiment my-experiment.json \ | ||
| --input /data/RoboMIND/h5_agilex_3rgb \ | ||
| --warehouse /data/warehouse \ | ||
| --action-horizon 32 \ | ||
| --batch-size 2 \ | ||
| --fetch-batches 8 \ | ||
| --rounds 3 \ | ||
| --output /data/results/experiment.json | ||
| ``` | ||
|
|
||
| The resolved experiment embeds the effective parameters as well as: | ||
|
|
||
| - portable source episode metadata and its SHA-256; | ||
| - normalization values, scope, version, frame count, and SHA-256; | ||
| - selected train and validation episode IDs; | ||
| - every logical window index, the window-plan SHA-256, and the | ||
| episode-qualified sample-sequence SHA-256; | ||
| - the Paimon database, frames table, and pinned snapshot ID. | ||
|
|
||
| ## 2. Run each backend | ||
|
|
||
| ```shell | ||
| python -m pypaimon.benchmark.act run \ | ||
| --backend hdf5 \ | ||
| --experiment /data/results/experiment.json \ | ||
| --input /data/RoboMIND/h5_agilex_3rgb \ | ||
| --results-dir /data/results | ||
|
|
||
| python -m pypaimon.benchmark.act run \ | ||
| --backend paimon \ | ||
| --experiment /data/results/experiment.json \ | ||
| --warehouse /data/warehouse \ | ||
| --results-dir /data/results | ||
| ``` | ||
|
|
||
| Use `--output` to choose an exact result path. Otherwise the command writes an | ||
| automatically named JSON file below `--results-dir` and prints its absolute | ||
| path as a compact JSON object. | ||
|
|
||
| Each result contains the complete resolved experiment and experiment SHA-256, | ||
| backend identity, runtime environment, model metadata, planned-sample tensor | ||
| fingerprint, three or more raw measurement rounds, and median/minimum/maximum | ||
| summary metrics. | ||
|
|
||
| Both adapters produce the same shared sample contract. State and camera images | ||
| come from the anchor frame; action covers the complete horizon. HDF5 reads a | ||
| window on demand from one episode file. Paimon uses a lazy, snapshot-pinned | ||
| `ContiguousWindowDataset`; image columns are anchor-only, and plural | ||
| `__getitems__` access coalesces multiple logical batches into a physical | ||
| fetch before splitting them back into the unchanged model batch size. | ||
|
|
||
| ## 3. Compare results | ||
|
|
||
| Compare explicit files: | ||
|
|
||
| ```shell | ||
| python -m pypaimon.benchmark.act compare \ | ||
| /data/results/robomind-act-hdf5-20260901T010000Z-a1b2c3d4.json \ | ||
| /data/results/robomind-act-paimon-20260901T011000Z-e5f6a7b8.json \ | ||
| --output /data/results/comparison.json | ||
| ``` | ||
|
|
||
| Or discover all ACT result documents in a directory: | ||
|
|
||
| ```shell | ||
| python -m pypaimon.benchmark.act compare \ | ||
| --results-dir /data/results \ | ||
| --output /data/results/comparison.json | ||
| ``` | ||
|
|
||
| Directory discovery ignores experiment and prior comparison JSON files. | ||
| Results are grouped by experiment SHA-256. Different experiments remain | ||
| separate entries in one comparison artifact; only compatible repeated results | ||
| for the same experiment and backend are aggregated. | ||
|
|
||
| Within one experiment group, comparison requires identical runtime environment, | ||
| model metadata, tensor fingerprint, train-loss trace, and validation-loss trace. | ||
| An environment mismatch marks the group `INCOMPATIBLE`; a model, tensor, or | ||
| loss mismatch marks it `FAILED`. Neither case produces performance ratios. | ||
|
|
||
| For compatible HDF5 and Paimon results, higher-is-better metrics report | ||
| `paimon_over_hdf5`. Lower-is-better latency, time, and memory metrics report | ||
| `hdf5_over_paimon`, which is the Paimon speedup or reduction factor. | ||
|
|
||
| ## Measurements | ||
|
|
||
| Every backend repeat records: | ||
|
|
||
| - dataset construction time; | ||
| - first-batch latency after construction; | ||
| - batch-fetch samples per second after warm-up; | ||
| - end-to-end fixed ACT optimizer-step time, including dataset fetch; | ||
| - per-step loss and compute time after each training batch has been fetched; | ||
| - validation loss; | ||
| - total measured wall time; | ||
| - Python peak allocation from a separate dataset-first-batch replay. | ||
|
|
||
| The shared harness resets Python, NumPy, and Torch random generators before | ||
| model construction and enables deterministic Torch algorithms. The logical | ||
| window plan is explicit rather than delegated to a streaming reader. | ||
|
|
||
| Python peak allocation uses `tracemalloc` after wall-clock measurement so | ||
| tracing overhead does not distort throughput. It does not include every native | ||
| Arrow or Torch allocation. The benchmark does not drop the OS page cache. | ||
| GPU, multi-worker loading, distributed training, recovery, and policy quality | ||
| remain outside this benchmark. | ||
|
|
||
| ## Code organization | ||
|
|
||
| - `benchmark.act.harness`: shared ACT tensors, model, trainer, window plan, and | ||
| measurement lifecycle; | ||
| - `benchmark.act.hdf5`: HDF5 window dataset and train normalization moments; | ||
| - `benchmark.act.paimon`: Paimon adapter, snapshot-pinned datasets, and | ||
| versioned statistics access; | ||
| - `benchmark.act.runner`: experiment preparation and one-backend execution; | ||
| - `benchmark.act.compare`: result discovery, compatibility checks, grouping by | ||
| experiment, and aggregation of compatible repeated runs; | ||
| - `benchmark.act.__main__`: the `prepare`, `run`, and `compare` | ||
| command-line interface. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """ACT training benchmark backends and result comparison.""" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.