Skip to content

[Backend]: Support device backend registration for a wide range of third-party hardware #20349

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

zhiyuan1i
Copy link

@zhiyuan1i zhiyuan1i commented Oct 19, 2024

What does this PR do?

Thank you to the lightning team for providing such an easy-to-use, clearly designed library.

The pr draft hopes to provide better registration support for a wide range of third-party hardware, and the pr is designed to integrate third-party hardware with minimal intrusive changes, including intel XPU and more.

Fixes #<issue_number>

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--20349.org.readthedocs.build/en/20349/

@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Oct 19, 2024
@zhiyuan1i
Copy link
Author

Examples here: https://github.com/uniartisan/RWKV-PEFT/blob/device-enhance/train.py#L499

There are a lot of things to be checked, I will try to do it later and make it more clear in documentation

@github-actions github-actions bot added the docs Documentation related label Oct 19, 2024
@zhiyuan1i zhiyuan1i marked this pull request as ready for review October 19, 2024 07:13
@zhiyuan1i zhiyuan1i changed the title Device enhance Better registration support for a wide range of third-party hardware Oct 19, 2024
@zhiyuan1i zhiyuan1i force-pushed the device-enhance branch 11 times, most recently from 8f0b3d6 to 2a89640 Compare October 22, 2024 06:58
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 71.87500% with 27 lines in your changes missing coverage. Please review.

Project coverage is 86%. Comparing base (b6442c5) to head (4195883).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #20349    +/-   ##
========================================
- Coverage      87%      86%    -1%     
========================================
  Files         268      268            
  Lines       23442    23521    +79     
========================================
- Hits        20394    20287   -107     
- Misses       3048     3234   +186     

@zhiyuan1i zhiyuan1i force-pushed the device-enhance branch 2 times, most recently from 1c83154 to 15595bf Compare October 22, 2024 08:00
@zhiyuan1i zhiyuan1i force-pushed the device-enhance branch 3 times, most recently from bdb81d4 to 01a931d Compare December 20, 2024 03:18
@fritol
Copy link

fritol commented Dec 23, 2024

will you add DirectML?

@zhiyuan1i
Copy link
Author

will you add DirectML?

What I've added is the code for plug-in registration, which means you can register Direct ML by yourself. Just write a few simple function 🤓

@zhiyuan1i zhiyuan1i requested a review from lantiga December 25, 2024 09:11
@lantiga
Copy link
Collaborator

lantiga commented Jan 6, 2025

Thank you @uniartisan!

@lantiga lantiga removed the waiting on author Waiting on user action, correction, or update label Jan 6, 2025
Copy link

stale bot commented Apr 16, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://lightning.ai/docs/pytorch/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Discord. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Apr 16, 2025
Copy link

stale bot commented Apr 27, 2025

This pull request is going to be closed. Please feel free to reopen it or create a new one based on top of the 'master' branch.

@stale stale bot removed the won't fix This will not be worked on label Jun 14, 2025
@zhiyuan1i
Copy link
Author

@lantiga Hello, since pytorch 2.3, it has started to support Intel's SYCL post-computing device, alias torch.xpu, so I wonder if we can promote the landing of this PR. Is there anything I can do?

@zhiyuan1i zhiyuan1i changed the title Better registration support for a wide range of third-party hardware [Backend]: Support device backend registration for a wide range of third-party hardware Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator docs Documentation related fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants