[ENH] Add GPU support to RocketClassifier/Regressor #3205
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.
Reference Issues/PRs
Fixes #1542
Already supports the backend change (CuPy based ) brought about in #3211
What does this implement/fix? Explain your changes.
This PR implements the GPU integration interface for
RocketClassifierandRocketRegressor. It introduces ause_gpu=Trueparameter that seamlessly switches the underlying transformer to the GPU implementation when enabled.Key Implementation Details:
use_gpu=True._check_soft_dependencies("tensorflow")to ensure a clean error message if the user enables GPU mode without the backend installed.use_gpu=False) is strictly preserved and uses the standard CPU transformer.Example Usage:
Does your contribution introduce a new dependency? If yes, which one?
No new mandatory dependencies. It adds tensorflow as a soft dependency (optional). The code only attempts to import it if use_gpu=True is explicitly set.
Any other comments?
Context: I am picking this up following my check-in on Issue #1542 (assignee inactive since Aug 2024) to unblock the GPU integration roadmap requested by @hadifawaz1999.
Verification: Verified locally with the following matrix:
Missing Dependency Check: Verified that setting use_gpu=True without TensorFlow raises a clear ImportError rather than a crash.
PR checklist
For all contributions
[x] I've added myself to the list of contributors. alternatively, you can use the @all-contributors bot to do this for you after the PR has been merged.
[x] The PR title starts with either [ENH], [MNT], [DOC], [BUG], [REF], [DEP] or [GOV] indicating whether the PR topic is related to enhancement, maintenance, documentation, bugs, refactoring, deprecation or governance.
For new estimators and functions
[ ] I've added the estimator/function to the online API documentation.
[ ] (OPTIONAL) I've added myself as a maintainer at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.
For developers with write access
[ ] (OPTIONAL) I've updated aeon's CODEOWNERS to receive notifications about future changes to these files.