Skip to content

Preserve RNG state in dataset iteration - #681

Merged
Kovbo merged 3 commits into
OpenPipe:mainfrom
pragnyanramtha:fix-iterate-dataset-rng-state
Jun 4, 2026
Merged

Preserve RNG state in dataset iteration#681
Kovbo merged 3 commits into
OpenPipe:mainfrom
pragnyanramtha:fix-iterate-dataset-rng-state

Conversation

@pragnyanramtha

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown

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.

@Kovbo

Kovbo commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Good catch, thank you, @pragnyanramtha!

@Kovbo Kovbo closed this Jun 4, 2026
@Kovbo Kovbo reopened this Jun 4, 2026
@Kovbo
Kovbo merged commit fabf3fd into OpenPipe:main Jun 4, 2026
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