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

Bridging the gap between DGL and PyG #6979

Closed
nowyouseemejoe opened this issue Mar 20, 2023 · 7 comments
Closed

Bridging the gap between DGL and PyG #6979

nowyouseemejoe opened this issue Mar 20, 2023 · 7 comments

Comments

@nowyouseemejoe
Copy link

🚀 The feature, motivation and pitch

DGL and PyG are two popular deep learning libraries that specialize in working with graph-structured data. Both DGL and PyG have become go-to libraries for researchers and practitioners working on graph deep learning problems, and have a growing community of contributors and users.

I would like to request a new feature for PyG that allows for converting DGL graphs to PyG instances (e.g., Data). This would make it easier for users who have existing graph structures in DGL to switch to PyG without having to recreate their graphs from scratch.

In addition, it would be great to have a tutorial added to the documentation, demonstrating how to mitigate from DGL to PyG using this new feature. The tutorial could introduce some equivalent message and aggregation operations for these two libraries, helping users navigate the differences between them. With this new feature and tutorial, users can seamlessly transition between DGL and PyG, unlocking the full potential of graph deep learning for their projects.

Alternatives

No response

Additional context

No response

@rusty1s
Copy link
Member

rusty1s commented Mar 20, 2023

I like the idea of providing conversion from DGL to PyG and vice versa. This should be pretty straightforward to get in. Do you have interest in contributing this?

@hbenedek
Copy link
Contributor

Hello, I am new to contributing to PyG, but this issue feels like a good one to start. Can I work on it?

@rusty1s
Copy link
Member

rusty1s commented Mar 21, 2023

I am not sure if @nowyouseemejoe has the intention to work on this. I think we could split the work into two parts:

  • from_dgl(dgl.Graph) -> data: Union[Data, HeteroData]
  • to_dgl(Union[Data, HeteroData]) -> dgl.Graph

such that both of you could work on this in parallel. WDYT?

@nowyouseemejoe
Copy link
Author

@rusty1s Sorry. I'm afraid I don't have the time or expertise to contribute effectively to this at the moment. I appreciate your understanding.

Thank you @hbenedek . That would be great!

@tjb-tech
Copy link

tjb-tech commented Mar 23, 2023

@rusty1s
Highly recommend this idea! Maybe having this api, the issue like #7017, which I recently meet, will not arise.

rusty1s added a commit that referenced this issue Mar 29, 2023
Issue #6979

## Description

I add two functions `from_dgl(dgl.Graph) -> data: Union[Data,
HeteroData]`and
`to_dgl(Union[Data, HeteroData]) -> dgl.Graph` in `utils/convert.py`.
Both function in both direction performs the same three operations,
setting the node and edge attributes and copies the edges of the
underlying graph(s).

---------

Co-authored-by: Jintang Li <cnljt@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
@Priyankagautam08
Copy link

did anyone solved it ?

@akihironitta
Copy link
Member

@Priyankagautam08 It's included in 2.4.0 release:

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

No branches or pull requests

6 participants