Skip to content

Preserve RNG state in dataset iteration#681

Open
pragnyanramtha wants to merge 1 commit into
OpenPipe:mainfrom
pragnyanramtha:fix-iterate-dataset-rng-state
Open

Preserve RNG state in dataset iteration#681
pragnyanramtha wants to merge 1 commit into
OpenPipe:mainfrom
pragnyanramtha:fix-iterate-dataset-rng-state

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • avoid resetting Python global random state while shuffling dataset epochs
  • keep deterministic epoch ordering by using a local RNG seeded per epoch
  • add focused tests for deterministic iteration and global RNG preservation

Validation

  • uv run pytest tests/unit/test_iterate_dataset.py
  • uv run ruff format --check src/art/utils/iterate_dataset.py tests/unit/test_iterate_dataset.py
  • uv run ruff check src/art/utils/iterate_dataset.py tests/unit/test_iterate_dataset.py

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 17, 2026 02:19
Copilot AI review requested due to automatic review settings May 17, 2026 02:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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