Skip to content

Need to create the torch Generator on the correct device.#924

Merged
drewoldag merged 2 commits into
mainfrom
awo/fix-rng-location
May 18, 2026
Merged

Need to create the torch Generator on the correct device.#924
drewoldag merged 2 commits into
mainfrom
awo/fix-rng-location

Conversation

@drewoldag

Copy link
Copy Markdown
Collaborator

The torch generator will, by default be created on CPU, but it needs to be in the same place as the rest of the data. On Mac, that means MPS by default.

@drewoldag drewoldag self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 19:07
@drewoldag
drewoldag requested a review from mtauraso May 18, 2026 19:09
@drewoldag

Copy link
Copy Markdown
Collaborator Author

Given that this addresses the issue, we should draft a new release after this merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Hyrax’s Ignite distributed dataloader helper to construct the torch.Generator on the Ignite-selected device (intended to align RNG behavior with non-CPU backends like MPS on macOS).

Changes:

  • Create torch.Generator with device=idist.device() inside dist_data_loader.

Comment thread src/hyrax/pytorch_ignite.py
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.72%. Comparing base (7d52a5f) to head (491cd52).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #924   +/-   ##
=======================================
  Coverage   67.72%   67.72%           
=======================================
  Files          70       70           
  Lines        6805     6805           
=======================================
  Hits         4609     4609           
  Misses       2196     2196           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtauraso mtauraso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works on my machine

@drewoldag
drewoldag merged commit c88c8ee into main May 18, 2026
8 checks passed
@drewoldag
drewoldag deleted the awo/fix-rng-location branch May 18, 2026 21:12
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.

4 participants