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

RNN / GRU / LSTM implementation for torch_xla #8655

Open
qihqi opened this issue Jan 30, 2025 · 2 comments
Open

RNN / GRU / LSTM implementation for torch_xla #8655

qihqi opened this issue Jan 30, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@qihqi
Copy link
Collaborator

qihqi commented Jan 30, 2025

🚀 Feature

Given that the experimental launch of scan operator that lowers to XLA's WhileOp, we should leverage it to implement performant RNN layers.

It should great to leverage it in place of the for loop that loops throught the time dimension, which could be large.

Motivation

for loops defined in python will be traced through by Lazy tensor and create a huge XLA graph. The runtime of these graphs might even be better than the rolled loop; but the compile time would be too long.

Scan operator is the technique for shortening compile time, this is also used in flax's RNN implementation.

Pitch

Alternatives

Additional context

@qihqi
Copy link
Collaborator Author

qihqi commented Jan 31, 2025

@qihqi
Copy link
Collaborator Author

qihqi commented Feb 3, 2025

related: #2422

@ysiraichi ysiraichi added the enhancement New feature or request label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants