-
Notifications
You must be signed in to change notification settings - Fork 5
feat: use original cuda scan from linear RNN #22
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
Conversation
… for scan and lpc functions
…y and maintainability
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.
Pull Request Overview
This PR reintroduces the original CUDA scan implementation for linear RNN recurrence computation while also cleaning up and reorganizing the recurrence functions and extension API. Key changes include:
- Splitting recurrence functionality into separate _cuda_recurrence and _cpu_recurrence functions.
- Renaming and re-registering C++ extension functions from “scan_cpu”/“lpc_cpu” to “scan”/“lpc”.
- Updating tests and setup configuration to support the new extension API and parameterizations.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| torchlpc/recurrence.py | Refactored recurrence functions with separate CPU/CUDA paths. |
| torchlpc/csrc/scan_cpu.cpp | Updated API registration and const/mutable data pointer usage. |
| torchlpc/csrc/cuda/LICENSE.txt | Added license text for CUDA code. |
| torchlpc/core.py | Updated operator calls to reflect new API names. |
| torchlpc/init.py | Changed extension loading logic using try-except for _C import. |
| tests/test_grad.py | Added parameterization for complex data tests. |
| tests/test_extension.py | Updated tests to use new operator names and added device parameter. |
| setup.py | Revised extension build configuration and source file discovery. |
Files not reviewed (1)
- torchlpc/csrc/cuda/linear_recurrence.cu: Language not supported
The results on a 5060 ti GPU with linux machine:
It's roughly the same as before.