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

[REVIEW] Allow passing a dict in feat_name for add_edge_data and add_node_data #2795

Merged
merged 17 commits into from
Oct 19, 2022

Conversation

VibhuJawa
Copy link
Member

@VibhuJawa VibhuJawa commented Oct 12, 2022

This PR adds support for dict in feat_name for add_edge_data and add_node_data.

  • Code Cleanup and ensure it lines with DGL
  • Add tests
  • Fix a get_feature_storage bug when device is set

@VibhuJawa VibhuJawa added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 12, 2022
@VibhuJawa VibhuJawa changed the title [WIP] Allow passing a dict in feat_name for add_edge_data and add_node_data [REVIEW] Allow passing a dict in feat_name for add_edge_data and add_node_data Oct 13, 2022
@VibhuJawa VibhuJawa marked this pull request as ready for review October 13, 2022 00:53
@VibhuJawa VibhuJawa requested a review from a team as a code owner October 13, 2022 00:53
Comment on lines +58 to 60
feat_name=None,
contains_vector_features=False,
):
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to this to keep the API cleaner and intuitive as you would want to provide feat_name together with contains_vector_features

tensor = tensor.to(device)
else:
return tensor
return tensor
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed an error here when a user provides device, cant test this as that needs Pytorch installed here.


# Clear properties if set as data has changed
self.__clear_cached_properties()

def get_node_storage(self, feat_name, ntype=None):
def get_node_storage(self, key, ntype=None, indices_offset=0):
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to key to match DGL.

Copy link
Member Author

Choose a reason for hiding this comment

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

backend_lib=self.backend_lib,
)

def get_edge_storage(self, feat_name, etype=None):
def get_edge_storage(self, key, etype=None, indices_offset=0):
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to key to match DGL.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -548,6 +528,7 @@ def __init__(self, pg, columns, storage_type, backend_lib="torch"):
self.storage_type = storage_type

self.from_dlpack = from_dlpack
self.indices_offset = indices_offset
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting offset makes upstream code cleaner

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.12@84a5ed3). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-22.12    #2795   +/-   ##
===============================================
  Coverage                ?   60.48%           
===============================================
  Files                   ?      111           
  Lines                   ?     6526           
  Branches                ?        0           
===============================================
  Hits                    ?     3947           
  Misses                  ?     2579           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@VibhuJawa
Copy link
Member Author

@gpucibot rerun tests

Copy link
Contributor

@rlratzel rlratzel left a comment

Choose a reason for hiding this comment

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

Mostly minor things: some questions, suggestions, typos, etc.

python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Outdated Show resolved Hide resolved
python/cugraph/cugraph/gnn/graph_store.py Show resolved Hide resolved
Copy link
Member Author

@VibhuJawa VibhuJawa left a comment

Choose a reason for hiding this comment

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

Thanks @rlratzel , Have addressed your reviews and added comment on the questions. Let me know what else needs to be done.

@VibhuJawa
Copy link
Member Author

@gpucibot merge

@VibhuJawa
Copy link
Member Author

@gpucibot merge

@rlratzel
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit fbd5f20 into rapidsai:branch-22.12 Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants