Skip to content

Implement OpenReg device autoload mechanism #158555

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 6 commits into
base: main
Choose a base branch
from

Conversation

can-gaa-hou
Copy link
Contributor

@can-gaa-hou can-gaa-hou commented Jul 17, 2025

Implement OpenReg device autoload mechanism

This PR aims to apply device autoload mechanism to the OpenReg module with some simple changes.

Change

Before

import torch
import torch_openreg

x = torch.tensor([1, 2, 3], device="openreg")
print(x)

After

import torch

# No need to import torch_openreg manually!
x = torch.tensor([1, 2, 3], device="openreg")
print(x)

cc @FFFrog

Copy link

pytorch-bot bot commented Jul 17, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158555

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 14c2ffd with merge base 05c4177 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Jul 17, 2025
Copy link

linux-foundation-easycla bot commented Jul 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@can-gaa-hou can-gaa-hou marked this pull request as draft July 17, 2025 12:01
@@ -125,7 +125,7 @@ graph LR

### Autoload
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a section for Autoload:

Take a introduction about background and design of Autoload, and add detailed description to show how the new accelerator to use Autoload mechinasm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I have added more details about Autoload mechanism. Please let me know if there any other problems :)

@FFFrog
Copy link
Collaborator

FFFrog commented Aug 5, 2025

What iss more , please refer to this PR to find out the tests about Autoload and migrate all of those to torch_openreg please.

can-gaa-hou and others added 3 commits August 7, 2025 14:36
…setup.py

Co-authored-by: Jiawei Li <ljw1101.vip@gmail.com>
…torch_openreg/__init__.py

Co-authored-by: Jiawei Li <ljw1101.vip@gmail.com>
@can-gaa-hou can-gaa-hou requested a review from FFFrog August 8, 2025 02:22
@can-gaa-hou can-gaa-hou marked this pull request as ready for review August 11, 2025 02:28
@can-gaa-hou can-gaa-hou requested a review from a team as a code owner August 11, 2025 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants