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

[torch_xla2] Use torch.Generator for random number generation in Environment #7018

Merged
merged 10 commits into from
Jun 3, 2024

Conversation

will-cromar
Copy link
Collaborator

@will-cromar will-cromar commented May 2, 2024

  • Pull jax.random.keys from torch.Generator (either argument or global generator)
  • Use randn as a test case
    • Fix empty because I thought it was required for randn (it's probably not)
  • Support nondeterministic output in test_ops
    • Bonus: use torch.testing.assert_close because it prints a much better error message upon failure; instead of False is not True, you get:
E       AssertionError: Scalars are not close!
E       
E       Expected 0 but got 140357434826080.
E       Absolute difference: 140357434826080 (up to 0.001 allowed)
E       Relative difference: inf (up to 1e-05 allowed)
  • Remove manually-managed PRNG key

@will-cromar will-cromar reopened this May 30, 2024
@will-cromar will-cromar changed the title [WIP] Implement randn and empty [torch_xla2] Use torch.Generator for random number generation in Environment May 30, 2024
@will-cromar will-cromar marked this pull request as ready for review May 30, 2024 20:50
@will-cromar will-cromar requested a review from qihqi May 30, 2024 20:50
@qihqi qihqi merged commit 94fa999 into master Jun 3, 2024
2 checks passed
@qihqi qihqi deleted the wcromar/randn branch June 3, 2024 23:51
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