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

[FEA] Enable using cugraph uniform sampling in multi client environments #3184

Merged
merged 8 commits into from
Jan 27, 2023

Conversation

VibhuJawa
Copy link
Member

@VibhuJawa VibhuJawa commented Jan 26, 2023

In multi client environments our sampling algorithms tend to hang, this PR adds a lock to prevent that from happening. This PR closes #3186

See notebooks here with MRE to reproduce.

Before PR (HANG):
Screen Shot 2023-01-25 at 9 01 39 PM
After PR (NO HANG):
Screen Shot 2023-01-25 at 9 07 02 PM

I have not added tests for this here because mocking dask with multi client environment is not possible in CI yet so we will do this as future work.

Also includes a bug fix in our sampling code path.

@VibhuJawa VibhuJawa requested a review from a team as a code owner January 26, 2023 05:11
@VibhuJawa VibhuJawa added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2023

Codecov Report

Base: 55.22% // Head: 55.30% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (b27025d) compared to base (5c021fb).
Patch coverage: 73.11% of modified lines in pull request are covered.

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-23.02    #3184      +/-   ##
================================================
+ Coverage         55.22%   55.30%   +0.07%     
================================================
  Files               148      148              
  Lines              9543     9573      +30     
================================================
+ Hits               5270     5294      +24     
- Misses             4273     4279       +6     
Impacted Files Coverage Δ
python/cugraph-pyg/cugraph_pyg/data/__init__.py 100.00% <ø> (ø)
...h/cugraph/dask/sampling/uniform_neighbor_sample.py 20.65% <13.33%> (-1.30%) ⬇️
...ugraph/cugraph/gnn/feature_storage/feat_storage.py 83.67% <50.00%> (-1.44%) ⬇️
...thon/cugraph-pyg/cugraph_pyg/data/cugraph_store.py 76.43% <77.56%> (-3.78%) ⬇️
python/cugraph/cugraph/structure/graph_classes.py 78.64% <90.00%> (+0.62%) ⬆️
...cugraph-pyg/cugraph_pyg/sampler/cugraph_sampler.py 80.32% <100.00%> (+41.26%) ⬆️
...hon/cugraph-pyg/cugraph_pyg/utilities/api_tools.py 29.16% <0.00%> (-5.21%) ⬇️

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 VibhuJawa assigned VibhuJawa and unassigned alexbarghi-nv Jan 26, 2023
@BradReesWork BradReesWork added this to the 23.02 milestone Jan 26, 2023
@alexbarghi-nv
Copy link
Member

That bug is also fixed in 3148

@alexbarghi-nv
Copy link
Member

Could you add some documentation? Is setting _multi_clients=True sufficient or is there something else that needs to be done in addition?

@alexbarghi-nv
Copy link
Member

Just a code comment is probably sufficient, maybe link to dask documentation.

@VibhuJawa
Copy link
Member Author

Just a code comment is probably sufficient, maybe link to dask documentation.

Done, added both.

Copy link
Member

@alexbarghi-nv alexbarghi-nv left a comment

Choose a reason for hiding this comment

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

👍

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.

This is great, thanks. Just had a few questions below.

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.

marking as "request changes" to prevent accidental merging while past feedback is being addressed.

@VibhuJawa
Copy link
Member Author

@rlratzel , All changes should be addressed now. Lets try to get this in sooner as #3186 builds on this.

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!

@rlratzel
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 068629e into rapidsai:branch-23.02 Jan 27, 2023
rapids-bot bot pushed a commit that referenced this pull request Jan 30, 2023
This PR makes `cugraph.structure.graph_classes` dask serializable and de-serializable.  This means that we can cleanly use dask to transmit graph objects b/w different clients without much work and using all ready supported API. 

Depends on PR:  ~#3184 (PR is IN) and closes #3193

See docs here: https://distributed.dask.org/en/stable/publish.html


**On client 0**
```python3
print(type(g))
client.publish_dataset(mg_graph_for_sampling=g)
```
```
<class 'cugraph.structure.graph_classes.MultiGraph'>
```

**On client 1** 
```python3
g = client_worker_1.get_dataset('mg_graph_for_sampling')
type(g)
```
```
cugraph.structure.graph_classes.MultiGraph
```


CC: @rlratzel

Authors:
  - Vibhu Jawa (https://github.com/VibhuJawa)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)
  - Erik Welch (https://github.com/eriknw)

URL: #3192
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] Enable using cugraph uniform sampling in multi client environments
7 participants