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

Create graph with edge property values #2660

Merged

Conversation

seunghwak
Copy link
Contributor

@seunghwak seunghwak commented Sep 2, 2022

  • Move the CSR (+ DCSR, or CSC +DCSC) compression and adjacency list sort parts from graph_t to create_graph_from_edgelist; for the main code path, there is another graph_t constructor used in cython.cu, this constructor is still performing compress and sort, this function will be deleted once cython.cu retires. Currently, the compression and sort functions are moved to detail/structure_utils.cuh to be used in both create_graph_from_edgelist_impl.cuh and graph_impl.cuh.
  • Added another graph_t constructor taking compressed and sorted CSR + DCSR graph data
  • Updated the create_graph_from_edgelist function to ooptionally take edge IDs and types.
  • Made few std::optional objects in multi-GPU struct/class non-optional (as they will always have a valid value in multi-GPU).
  • Replace few more raw-pointers with raft::device_span

@seunghwak seunghwak added feature request New feature or request 2 - In Progress non-breaking Non-breaking change labels Sep 2, 2022
@seunghwak seunghwak added this to the 22.10 milestone Sep 2, 2022
@seunghwak seunghwak self-assigned this Sep 2, 2022
@seunghwak seunghwak requested a review from a team as a code owner September 2, 2022 15:00
@seunghwak seunghwak changed the title [WIP][skip-ci] Create graph with edge property values Create graph with edge property values Sep 6, 2022
@seunghwak
Copy link
Contributor Author

rerun tests

@alexbarghi-nv
Copy link
Member

Is this ready for me to test with #2629 ?

@seunghwak
Copy link
Contributor Author

Is this ready for me to test with #2629 ?

Hopefully in few hours, I will mark this as ready-for-review once this is ready to be tested with #2629. I have locally tested, but we have two versions of create_graph_edgelist (one does not take edge IDs and types and one OPTIONALLY takes edge IDs and types, as the first can be implemented with the second, I want to remove the first).

@seunghwak
Copy link
Contributor Author

@alexbarghi-nv And I am currently assuming that edge types are 32 bit signed integers, and will this work for you?

@alexbarghi-nv
Copy link
Member

I was hoping they would be uint8 to save memory; right now we don't have any use cases with anything more than a handful of edge types.

@alexbarghi-nv
Copy link
Member

But if they need to be int32 that's ok, it will just not be very memory-efficient

@seunghwak
Copy link
Contributor Author

But if they need to be int32 that's ok, it will just not be very memory-efficient

OK, then, let's stick to int32_t at this moment, but once we find this becomes a memory bottleneck, we will get back to uint8_t. We can instantiate this for both uint8_t and uint32_t but we're getting some complaints about compile time and binary size, so we may want to avoid instantiating for too many type combinations. uint8 may not be sufficient for some future use cases but if this limits the maximum size we can run, we can use uint8 instead.

@alexbarghi-nv
Copy link
Member

Ok, sounds good. I'll update my code to use int32

@seunghwak
Copy link
Contributor Author

@alexbarghi-nv OK, this PR is now ready for testing.

cugraph::create_graph_from_edgelist<vertex_t,
edge_t,
weight_t,
int32_t,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This hard-codes int32_t, which is fine for now (as you've discussed with @alexbarghi-nv. Ultimately we should probably allow this to be arbitrary, but I think we can defer that to later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about doing using edge_type_t = int32_t then passing edge_type_t? I guess this will make the intention clearer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that would be a bit better. That would make the references easier to isolate when we ultimately add support for variable types.

@naimnv naimnv self-requested a review September 13, 2022 12:46
@codecov-commenter
Copy link

Codecov Report

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

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-22.10    #2660   +/-   ##
===============================================
  Coverage                ?   60.11%           
===============================================
  Files                   ?      112           
  Lines                   ?     6150           
  Branches                ?        0           
===============================================
  Hits                    ?     3697           
  Misses                  ?     2453           
  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.

Copy link
Member

@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.

LGTM

@ChuckHastings
Copy link
Collaborator

@gpucibot merge

@rapids-bot rapids-bot bot merged commit addadb7 into rapidsai:branch-22.10 Sep 14, 2022
@seunghwak seunghwak deleted the fea_create_graph_with_edge_prop branch October 20, 2022 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants