Skip to content

chore(tests): speed up streaming pytest suite - #856

Open
tchaton wants to merge 3 commits into
mainfrom
chore/faster-pytest
Open

chore(tests): speed up streaming pytest suite#856
tchaton wants to merge 3 commits into
mainfrom
chore/faster-pytest

Conversation

@tchaton

@tchaton tchaton commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Speed up the streaming pytest suite without cutting resume/MP regression coverage.

Safe speedups (kept):

  • Reuse shared Cache dirs per (len1, len2) inside each xdist worker
  • Shrink dataloader fixture sizes where assertions still exercise restore/epochs
  • Replace fixed sleep(1/2) waits with polls / backdated clocks
  • Raise streaming xdist to -n 4 on Linux only (macOS/Windows stay at 2)

Coverage (restored):

  • Full num_workers=[0,2] grids for RNG + dataloader state tests
  • Full length × resume × shuffle matrices for partial/complete resume stay on num_workers=2 every cell
  • Dataset-only resume tests keep num_workers=0 (no DataLoader workers are used there)

Test plan

  • Local smoke of multi-worker resume cells
  • CI: ubuntu streaming step still green; wall-time improvement from shared caches / xdist / fixture size only

Collapse redundant num_workers=2 parallel-matrix cells onto a single-process
path (keep one MP cell per behavior), reuse shared Cache dirs across params,
shrink dataloader fixtures, replace fixed sleeps with polls/backdated clocks,
and raise Ubuntu xdist workers to 4.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tchaton
tchaton requested a review from justusschock as a code owner July 25, 2026 00:42
pre-commit-ci Bot and others added 2 commits July 25, 2026 00:42
Keep every resume/rng/state matrix cell on num_workers=2 (or the original
0/2 grid). Speedups remain shared Cache reuse, smaller dataloader fixtures,
sleep→poll/clock backdating, and Ubuntu xdist=4 — not coverage cuts.

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

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81%. Comparing base (22f383b) to head (6545ef6).
⚠️ Report is 9 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #856   +/-   ##
===================================
- Coverage    81%    81%   -0%     
===================================
  Files        56     56           
  Lines      8389   8389           
===================================
- Hits       6794   6793    -1     
- Misses     1595   1596    +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

--ignore=tests/processing \
--ignore=tests/raw \
-n 2 --dist=loadgroup --cov=litdata --durations=0 --timeout=120 --capture=no --verbose
-n "${XDIST_WORKERS}" --dist=loadgroup --cov=litdata --durations=0 --timeout=120 --capture=no --verbose

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also try standalone script for running tests

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.

3 participants