Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent ordering of cached data files between deeplearning and Great Lakes #1075

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

timwhite0
Copy link
Collaborator

os.listdir() does not necessarily list files in the same order on Great Lakes as it does on the deeplearning server, even if the contents of the directory are the same in both places and the same random seed is set in both places.

This behavior is documented, e.g., here and here.

This issue is relevant for any BLISS case study that trains a network on Great Lakes and then evaluates the trained network on the deeplearning server. In CachedSimulatedDataModule, files are assigned to train/val/test based on the order in which they are read in by os.listdir(). So because of the behavior mentioned above, one could obtain different train/val/test splits on deeplearning and Great Lakes even if the directory contents and random seed are the same in both places.

The proposed fix just wraps sorted() around the list of file names.

@timwhite0 timwhite0 requested a review from jeff-regier October 7, 2024 00:19
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.15%. Comparing base (1baf4d4) to head (6dd65d9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1075   +/-   ##
=======================================
  Coverage   76.15%   76.15%           
=======================================
  Files          22       22           
  Lines        3091     3091           
=======================================
  Hits         2354     2354           
  Misses        737      737           
Flag Coverage Δ
unittests 76.15% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jeff-regier jeff-regier left a comment

Choose a reason for hiding this comment

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

Nice!

@jeff-regier jeff-regier merged commit 0e565b1 into master Oct 7, 2024
3 checks passed
@jeff-regier jeff-regier deleted the tw/cached_dataset branch October 7, 2024 11:24
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