-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: tracing Random.jl functionality correctly #363
Merged
Merged
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
5b40fdf
refactor: move stdlib overloads to a different directory
avik-pal a584127
fix: Ops.rng_bit_generator
avik-pal 8699131
feat: initial prototype for random number generation
avik-pal 9da77c7
feat: add support for scalar sampling
avik-pal 6dcad12
feat: efficient sampling for non-native RNGs
avik-pal bbf2a48
fix: handling floating point sampling
avik-pal e82c2c0
feat: use the override macro
avik-pal 4b7c504
fix: use `@noinline`
avik-pal 7d73538
feat: support randexp
avik-pal 591320c
feat: override seeding inside interpreter
avik-pal 1b45638
refactor: move things into a module
avik-pal 51f91e4
refactor: rework how the overlays are implemented
avik-pal 5a94f14
docs: add internal api to the docs
avik-pal d61d269
test: include floating point tests
avik-pal 36e56cb
test: setup testing
avik-pal 6c21721
feat: overlay all generators
avik-pal d0064f2
test: ensure distributions are correct
avik-pal 9129ce2
test: overlay generation
avik-pal 867324e
fix: test whether we can call into the non-overlayed version
avik-pal 66b16c4
fix: try marking TracedRandom in whitelist
avik-pal e370200
fix: workaround the AbsInt issues for now
avik-pal eaa1f30
fix: throw errors for now instead of crashing
avik-pal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
```@meta | ||
CollapsedDocStrings = true | ||
``` | ||
|
||
# Internal API | ||
|
||
These functions are not part of the public API and are subject to change at any time. | ||
|
||
```@docs | ||
Reactant.REDUB_ARGUMENTS_NAME | ||
Reactant.within_reactant_interpreter | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module ReactantRandom123Ext | ||
|
||
using Random123: Threefry4x, Threefry2x, Philox4x, Philox2x | ||
using Reactant: TracedRandom | ||
|
||
TracedRandom.rng_algorithm(::Threefry4x) = "THREE_FRY" | ||
TracedRandom.rng_algorithm(::Threefry2x) = "THREE_FRY" | ||
TracedRandom.rng_algorithm(::Philox4x) = "PHILOX" | ||
TracedRandom.rng_algorithm(::Philox2x) = "PHILOX" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wsmoses my understanding was that this should call the non-overlayed version. But here I get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using this trick #369 (comment) seems to work correctly (though this has other weird edge-cases)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a general issue with any kind of recursion of an overlayed function. Do we have a way to force using the NativeInterpreter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ccing @gbaraldi and @aviatesk