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

Add a non-blocking option on DGLGraph.to #1547

Closed
ZhaofengWu opened this issue May 21, 2020 · 5 comments
Closed

Add a non-blocking option on DGLGraph.to #1547

ZhaofengWu opened this issue May 21, 2020 · 5 comments

Comments

@ZhaofengWu
Copy link

🚀 Feature

Change DGLGraphs's to from def to(self, ctx): to def to(self, ctx, non_blocking=False): or with some other default.

Motivation

I'm using pytorch-lightning, a framework that provides a scaffold for many PyTorch applications, with DGL. One thing they do is that they automatically call .to on every parameter to forward (https://github.com/PyTorchLightning/pytorch-lightning/blob/98f7842970fd593c21bebfdba5da8aa311d50730/pytorch_lightning/trainer/distrib_parts.py#L458). They recently added non_blocking=True to this .to call (Lightning-AI/pytorch-lightning#1843), making it no longer compatible with DGLGraph as its .to doesn't have such an argument. Therefore, is it possible that a non_blocking option be supported in DGL too?

Alternatives

Something like def to(self, ctx, **kwargs): with **kwargs entirely ignored. That'll solve the compatibility issue but is not very elegant.

@yzh119
Copy link
Member

yzh119 commented May 22, 2020

@ZhaofengWu Thanks for your suggestion, I'll take a look :)

@yzh119 yzh119 mentioned this issue Jun 8, 2020
6 tasks
yzh119 added a commit that referenced this issue Jun 15, 2020
@sophiakrix
Copy link

Hi there!

Are you using the dataloaders from DGL with pytorch lightning? I am trying to do that but I get the suspicion that it does not accept the NodeDataLoader and EdgeDataLoaders.

What is your experience?

@BarclayII
Copy link
Collaborator

@sophiakrix Currently we are working with PyTorch Lightning to make DGL compatible. It requires some changes in DGL's NodeDataLoader and EdgeDataLoader.

@github-actions
Copy link

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

@jermainewang
Copy link
Member

The issue has been resolved in the latest release. Both Torch Lightning and async copy have been supported.

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

5 participants