Skip to content

Conversation

@avik-pal
Copy link
Collaborator

fixes #1765
fixes #1583

@avik-pal avik-pal requested a review from wsmoses October 18, 2025 01:08
Copy link
Member

@wsmoses wsmoses left a comment

Choose a reason for hiding this comment

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

I'm overall rather skeptical of this as an arbitrary rng may have different properties like seeding distribution etc, which means we will give different (wrong) answers when converting to a generic reactant rng.

At minimum we should aggressively yell, but I'd prefer that we implement the specification of the rngs in terms of reactant native primitives

@avik-pal
Copy link
Collaborator Author

Yeah that makes sense. For all RNGs we warn except, ThreeFry2x and Philox2x which are natively supported

@avik-pal avik-pal merged commit 5485f2c into main Oct 18, 2025
64 of 70 checks passed
@avik-pal avik-pal deleted the ap/trace_random branch October 18, 2025 17:52
@bvdmitri
Copy link
Contributor

bvdmitri commented Oct 20, 2025

I'm overall rather skeptical of this as an arbitrary rng may have different properties like seeding distribution etc, which means we will give different (wrong) answers when converting to a generic reactant rng.

fair point, but I also think its fair for an RNG to produce different results on different hardware. The discrepancy can be explained that StableRNG is producing different streams on CPU and TPU/GPU but the streams are of course identical if executed within the same hardware family

a warning is good in either case

edit: ah, you've probably meant if the original RNG is skewed towards particular values and ReactantRNG isnt the same...subtle indeed

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.

Should ReactantDevice (and to_rarray) move all AbstractRNG to ReactantRNG? Convert Random.TaskLocalRNG in to_rarray?

4 participants