-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tracing Random.jl functionality correctly (#363)
* refactor: move stdlib overloads to a different directory * fix: Ops.rng_bit_generator * feat: initial prototype for random number generation * feat: add support for scalar sampling * feat: efficient sampling for non-native RNGs * fix: handling floating point sampling * feat: use the override macro * fix: use `@noinline` * feat: support randexp * feat: override seeding inside interpreter * refactor: move things into a module * refactor: rework how the overlays are implemented * docs: add internal api to the docs * test: include floating point tests * test: setup testing * feat: overlay all generators * test: ensure distributions are correct * test: overlay generation * fix: test whether we can call into the non-overlayed version * fix: try marking TracedRandom in whitelist * fix: workaround the AbsInt issues for now * fix: throw errors for now instead of crashing
- Loading branch information
Showing
17 changed files
with
690 additions
and
16 deletions.
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.