Skip to content

fix(streaming): do not auto-window JPEG and other per-item media - #899

Merged
tchaton merged 2 commits into
mainfrom
fix/jpeg-no-decode-window
Sep 1, 2026
Merged

fix(streaming): do not auto-window JPEG and other per-item media#899
tchaton merged 2 commits into
mainfrom
fix/jpeg-no-decode-window

Conversation

@tchaton

@tchaton tchaton commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR #897 auto-windowed ~115KB JPEGs at 16 rows. With item_shuffle_window=256 that dropped and re-decoded the same ImageNet JPEGs (~15× decode_jpeg, 120k for 8k items) and cut epoch-1 from 10,441 → 1,974 img/s at 48 workers.

Heavy per-item leaves (JPEG / image / audio / video / …) now use batch_decode=1 and skip _store_decode_window. Cheap leaves (text, ints, small tensors) still batch. Full epoch on this patch: 10,380 img/s.

test_shuffled_jpeg_auto_batch_decodes_once streams a shuffled JPEG dataset and asserts one decode_jpeg per item, plus _auto_batch_rows / _item_only_batch == 1 when jpeg is in data_format.

Test plan

  • test_batch_rows_for_format — JPEG auto window is 1; tensors/text can still batch
  • test_shuffled_jpeg_auto_batch_decodes_once — shuffle + JPEG decodes once per item
  • tests/streaming/test_item_loader.py (56 passed)

Made with Cursor

Restore ImageNet stream speed: a 16-row decode window plus item_shuffle_window=256 re-decoded each JPEG ~16×. Heavy per-item leaves now use batch_decode=1 and skip the window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

codecov-commenter commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81%. Comparing base (86be0dd) to head (603e26e).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #899   +/-   ##
=====================================
  Coverage     81%     81%           
=====================================
  Files         67      67           
  Lines      15530   15547   +17     
=====================================
+ Hits       12642   12666   +24     
+ Misses      2888    2881    -7     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tchaton
tchaton merged commit a47f5a5 into main Sep 1, 2026
35 checks passed
@tchaton
tchaton deleted the fix/jpeg-no-decode-window branch September 1, 2026 10:15
@tchaton tchaton mentioned this pull request Sep 1, 2026
3 tasks
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