google-deepmind / google-deepmind/rlax
Add `unroll` argument to functions that use `lax.scan`
Open
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 109
- Avg merge
- 2h 15m
- Merged PRs (30d)
- 1
Description
**Feature request:** Add an `unroll` argument (default `1`) to functions that use [`lax.scan`](https://docs.jax.dev/en/latest/_autosummary/jax.lax.scan.html).
`scan` is known to be slow on GPUs because it requires a kernel launch on each iteration, unless multiple iterations are unrolled.
This change would allow users to do that, and thus potentially speed up computation.
I can submit a PR for this.
Contributor guide
Assessment
This issue has not been assessed yet.