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

DGL Dataloader #3181

Merged
merged 435 commits into from
Jan 31, 2023
Merged

Conversation

VibhuJawa
Copy link
Member

@VibhuJawa VibhuJawa commented Jan 25, 2023

This PR depends upon #3148 (#3170)

This PR closes #3154

  • Works on SG Homogenous Graph (OBGN-Products)
  • Works on SG Heterogenous Graphs (OBGN-Mag)
  • Works on MG Homogenous Graphs (OBGN-Products, OBGN-PAPERS100M (1 Billion edge graph))
  • Works on MG Heterogenous Graphs (OBGN-Mag)

Tests to add:

  • Tests on SG Homogenous Graphs
  • Tests on SG Heterogenous Graphs
  • Tests on MG Homogenous Graphs
  • Tests on MG Heterogenous Graphs

Maybe Todo:
- [ ] Test Multi-trainer examples and verification (Will do a follow up)

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.

Thanks for all this hard work. I noticed some minor things.

I also wish we didn't have to copy DataFrames for the reverse_edges code, but I can't think of a more efficient way either.

python/cugraph-dgl/cugraph_dgl/cugraph_storage.py Outdated Show resolved Hide resolved
python/cugraph-dgl/cugraph_dgl/dataloading/dataloader.py Outdated Show resolved Hide resolved
python/cugraph-dgl/cugraph_dgl/dataloading/dataloader.py Outdated Show resolved Hide resolved
python/cugraph-dgl/cugraph_dgl/dataloading/dataloader.py Outdated Show resolved Hide resolved
Comment on lines +46 to +50
if self._input_directory is None:
raise dgl.DGLError(
"Please set input directory by calling `set_input_directory` "
"before trying to fetch a sample"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than this check and another method, can the ctor just require an input_directory arg and do the set_input_directory steps itself upfront?

Copy link
Member Author

Choose a reason for hiding this comment

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

So i did not do this because this is set/reset per epoch basis as each epoch has a different directory, Happy to discuss if you have ideas on how to do this cleanly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me know if this is fine for now please.


from cugraph.gnn.data_loading import EXPERIMENTAL__BulkSampler

BulkSampler = experimental_warning_wrapper(EXPERIMENTAL__BulkSampler)
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI PR #3170 changed this so that the gnn namespace wouldn't be lost, based on thisfeedback.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, waiting on #3170 to land before i make these changes.

@VibhuJawa
Copy link
Member Author

I also wish we didn't have to copy DataFrames for the reverse_edges code, but I can't think of a more efficient way either.

A couple of clarifications:

  1. We need to copy frames to add the edge_ids column and not for reverse_edges
  2. For non persisted dask-cudf frames this does not return in any memory overhead .
  3. For persisted cudf Frames/dask-cudf Frames we will in future enable COW(copy-on-write) [REVIEW] Merge copy-on-write feature branch into branch-23.04 cudf#12619 which will i think will mean that we have non memory overhead for this sort of behavior going forward.

CC: @galipremsagar , For context we are renaming some columns and adding an extra column but can not modify the input DataFrame. I think your amazing work with COW will address these cases.

@galipremsagar
Copy link
Contributor

  1. For persisted cudf Frames/dask-cudf Frames we will in future enable COW(copy-on-write) [REVIEW] Merge copy-on-write feature branch into branch-23.02 cudf#12619 which will i think will mean that we have non memory overhead for this sort of behavior going forward.

CC: @galipremsagar , For context we are renaming some columns and adding an extra column but can not modify the input DataFrame. I think your amazing work with COW will address these cases.

Yes, COW will remove the memory overhead. But we are slipping it to 23.04. For now you could use shallow copies, if that doesn't suffice, happy to hop on a call to discuss some internal API solutions offline.

Comment on lines 147 to 149
).persist()
empty_df = (
create_empty_df_with_edge_props(indices_t, weight_t)
if with_edge_properties
else create_empty_df(indices_t, weight_t)
)
ddf = dask_cudf.from_delayed(result, meta=empty_df, verify_meta=False).persist()
Copy link
Member Author

Choose a reason for hiding this comment

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

Will be over-writted by : #3170 so please ignore.

# See the License for the specific language governing permissions and
# limitations under the License.

from cugraph.gnn.data_loading.bulk_sampler import EXPERIMENTAL__BulkSampler
Copy link
Member Author

Choose a reason for hiding this comment

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

Same for this file #3170

@VibhuJawa
Copy link
Member Author

CC: @rlratzel , Have resolved all changes that were part of this PR , other minor 3 variable name changes will come once 3180 lands.

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2023

Codecov Report

Base: 55.30% // Head: 55.61% // Increases project coverage by +0.31% 🎉

Coverage data is based on head (e37aa69) compared to base (068629e).
Patch coverage: 74.12% of modified lines in pull request are covered.

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-23.02    #3181      +/-   ##
================================================
+ Coverage         55.30%   55.61%   +0.31%     
================================================
  Files               148      150       +2     
  Lines              9573     9671      +98     
================================================
+ Hits               5294     5379      +85     
- Misses             4279     4292      +13     
Impacted Files Coverage Δ
...ugraph/cugraph/dask/structure/mg_property_graph.py 11.90% <0.00%> (-0.02%) ⬇️
...ure/graph_implementation/simpleDistributedGraph.py 14.24% <0.00%> (-0.09%) ⬇️
...h/cugraph/dask/sampling/uniform_neighbor_sample.py 24.75% <41.17%> (+4.10%) ⬆️
.../cugraph/dask/centrality/eigenvector_centrality.py 30.00% <50.00%> (ø)
...cugraph/cugraph/dask/centrality/katz_centrality.py 19.56% <50.00%> (ø)
python/cugraph/cugraph/dask/community/egonet.py 18.51% <50.00%> (ø)
python/cugraph/cugraph/dask/community/louvain.py 30.30% <50.00%> (ø)
...n/cugraph/cugraph/dask/community/triangle_count.py 21.62% <50.00%> (ø)
...on/cugraph/cugraph/dask/components/connectivity.py 31.03% <50.00%> (ø)
python/cugraph/cugraph/dask/cores/core_number.py 26.66% <50.00%> (ø)
... and 14 more

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.

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.

Thanks for the updates. The use_ddp additions are pretty exciting.

@rlratzel
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit a51bfa7 into rapidsai:branch-23.02 Jan 31, 2023
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.

[FEA] Update cugraph-dgl to use bulk sampler
7 participants