Skip to content

Speed up norm stats by skipping video decoding - #1028

Open
noobyalan wants to merge 1 commit into
Physical-Intelligence:mainfrom
noobyalan:skip-video-norm-stats-pr
Open

Speed up norm stats by skipping video decoding#1028
noobyalan wants to merge 1 commit into
Physical-Intelligence:mainfrom
noobyalan:skip-video-norm-stats-pr

Conversation

@noobyalan

Copy link
Copy Markdown

Summary

Normalization statistics only use states and actions, but compute_norm_stats.py currently reuses the training data pipeline and decodes every video observation. This adds unnecessary CPU, memory, and I/O overhead, especially for high-resolution, multi-camera LeRobot datasets.

This PR adds an optional --skip-video-decoding flag for LeRobot datasets.

When enabled, it:

  • keeps the existing dataset and transform pipeline;
  • avoids downloading video files;
  • replaces decoded frames with 1x1 uint8 placeholders;
  • continues computing statistics from the original states and actions.

The option is disabled by default, so existing training and normalization behavior is unchanged.

Usage

uv run scripts/compute_norm_stats.py \
  --config-name <config_name> \
  --skip-video-decoding

Benchmark

Tested on a 1080p, three-camera LeRobot dataset:

Dataset Frames Default Skip video decoding Speedup
Subset 10,000 748.4 s 223.2 s 3.35×
Full dataset 159,423 7,629.3 s 403.6 s 18.9×

Statistics equivalence

The generated normalization statistics were identical between the default and optimized paths.
image

Testing

  • Added a unit test covering disabled video downloads and dummy frame shape/dtype.
  • Targeted data loader tests pass.
  • ruff check, ruff format --check, and pre-commit pass on the modified files.

Related to #688.

@jimmyt857
jimmyt857 removed their request for review August 30, 2026 19:23
@noobyalan

Copy link
Copy Markdown
Author

@kvablack Hi! A gentle ping on this PR, it skips redundant video decoding in compute_norm_stats to speed up preprocessing, with unit tests included. Thanks!

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