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

[BUG] If both add_edge_list and add_adj_list of the class Graph (c_graph.pyx) are called, a single graph instance can store two different graphs. #187

Closed
seunghwak opened this issue Mar 26, 2019 · 2 comments · Fixed by #239
Assignees
Labels
bug Something isn't working

Comments

@seunghwak
Copy link
Contributor

Describe the bug
add_edge_list of class Graph (in c_graph.pyx) calls gdf_edge_list_view and add_adj_list calls gdf_adj_list_view.

gdf_edge_list_view does not check there already exists an adjacency list representation and gdf_adj_list_view does not check there already exists an edge list representation. If both are called representing two different graphs, it is unclear what num_vertices of class Graph should return (current it returns the number of vertices in the adjacency list).

Expected behavior
There are two options. If the graph instance already holds a graph, 1) we may allow only conversion between formats. 2) Alternatively, we may delete an existing graph (including graph representations in different formats) before adding a new one.

@seunghwak seunghwak added ? - Needs Triage Need team to review and classify bug Something isn't working labels Mar 26, 2019
@afender
Copy link
Member

afender commented Mar 26, 2019

The current version has the following advantage: if a user has both adj_list and edge_list already, the user can provide it directly without running any conversion.
However, I agree that this can be misused to store different graphs in the same object. In this case, I think the first solution you proposed is a good fix.

@BradReesWork BradReesWork removed the ? - Needs Triage Need team to review and classify label Mar 27, 2019
@seunghwak
Copy link
Contributor Author

Users may not have both edge_list and adj_list from the beginning, but they may convert one format to another using CPU to get both. We may better advise users to do conversion in GPU, and implementing option 1 may be able to facilitate users to do conversion in GPU. We may also add conversion functions to the python API. Currently, we have exposed only the conversion function from COO to CSC (add_transpose) in the Python API. Other conversions occur implicitly. And it can be quite non-intuitive to users that just querying the number of vertices (calling num_vertices()) can invoke COO to CSR conversion (which takes time and requires additional memory). We may better compute num_vertices from COO if CSR is not available (and cache the computed value) or compute num_vertices when add_edge_list is called. This could be another [FEA]ture issue if this is worth implementing.

ChuckHastings pushed a commit to ChuckHastings/cugraph that referenced this issue Jun 14, 2021
PR updates RAFT's CMake and uses CPM for dependency management. Still WIP, meant for early 0.20, but opening the PR to start debugging in CI. 

This is heavily based on cuDF's, RMM's and cumlprims' changes. PR does the following:

- [x] Adopt CPM:
    - [x] RMM
    - [x] FAISS
    - [x] GTest
    - [ ] NCCL: Missing building from source, will be added if/when required
    - [ ] UCX: Missing building from source, will be added if/when required
    - [x] CUB for CUDA < 11.0
- [x] Update arch detection 
- [x] Use generators to allow clang compilation as well
- [x] Updates to outdated cmake parts and remove old code
- [x] Update code to aid transition to rapidsai#83

Authors:
  - Dante Gama Dessavre (https://github.com/dantegd)
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - Rick Ratzel (https://github.com/rlratzel)
  - Divye Gala (https://github.com/divyegala)

URL: rapidsai/raft#187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants