Skip to content

[Python] Avoid unused tensor conversions in LeRobot windows - #10704

Merged
JingsongLi merged 1 commit into
apache:masterfrom
XiaoHongbo-Hope:python-lerobot-window-feature-conversion
Oct 21, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
XiaoHongbo-Hope:python-lerobot-window-feature-conversion

Conversation

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

Purpose

LeRobot temporal windows load auxiliary frames alongside each requested sample. These auxiliary rows currently convert control fields such as index and timestamp to tensors even when only their State/Action or image features are used.

Convert only the requested window features for auxiliary rows. Base samples retain all fields, explicitly requested control-field windows still work, and all rows undergo the existing metadata validation.

Three paired prototype runs on #10701 with public lerobot/pusht: 4,996 → 5,478 samples/s (+9.6%), with average PSS essentially unchanged at 3.20 GiB. Local warm-cache CPU decoding, batch 32, 8 workers, 8-frame windows, uint8, no transforms/model; 10 warmup + 500 measured batches. Same-run official Lance achieved 6,091 samples/s. These are diagnostic prototype measurements, not a benchmark of this PR head.

Tests

  • Related LeRobot/video tests: 81 passed, 89 subtests passed; 29 optional-dependency skips.
  • Covers omitted auxiliary conversions, explicitly requested timestamp windows, and rejection of invalid auxiliary-frame metadata.
  • Real-data prototype validation: all tensor bytes match the baseline across 16 batches, including images and State/Action.
  • Flake8 and git diff --check passed.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review October 21, 2026 04:23
@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the python-lerobot-window-feature-conversion branch from 7d9a444 to 99055c6 Compare October 21, 2026 06:06
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 96b84c2 into apache:master Oct 21, 2026
14 of 15 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.

2 participants