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

A potencial solution to enable hardware acceleration on torchdrug #222

Open
ccorbi opened this issue Aug 31, 2023 · 0 comments
Open

A potencial solution to enable hardware acceleration on torchdrug #222

ccorbi opened this issue Aug 31, 2023 · 0 comments

Comments

@ccorbi
Copy link

ccorbi commented Aug 31, 2023

Hello, I recently installed torch drug on my Apple Laptop with Apple silicon. And I realize that Torchdrug was not taking advantage of the hardware acceleration. I manage to do it so by modifying torch drug , see below the details. It improves significantly the performance of torch drug. I am wondering if you would be interested on adding this modification to the code base?

on line 83 at torchdrug.core.engine.py

        if gpus is None:
            if torch.backends.mps.is_available():
                self.device = torch.device("mps")  
            else:
                self.device = torch.device("cpu")  
        else:
            if len(gpus) != self.world_size:

I am aware that this lines are not compatible with torch <1.13, so may be it will work better to encapsule that in try/except . Also not sure if I should include this in other parts of the code. What do you think about it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant