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] AttributeError: 'NoneType' object has no attribute 'implementation' when using dask_cugraph.louvain #1936

Closed
co-tran-sp opened this issue Nov 9, 2021 · 3 comments · Fixed by #1943
Labels
bug Something isn't working
Milestone

Comments

@co-tran-sp
Copy link

Describe the bug

The error happened when I tried to perform dask cugraph louvain on a symmetric digraph. The reason I need to use dask cugraph louvain because my graph is very big to load into the graph class without dask and from_dask_cudf_edgelist only supports DiGraph.

AttributeError Traceback (most recent call last)
/tmp/ipykernel_7871/183532962.py in
11 G = cugraph.DiGraph()
12 G.from_dask_cudf_edgelist(df_0, source='source', destination='target',edge_attr = 'similarity', renumber=False)
---> 13 df, mod = dask_cugraph.louvain(G)
14
15 t2 = time.time() - t1

~/anaconda3/envs/rapids-21.10/lib/python3.8/site-packages/cugraph/dask/community/louvain.py in louvain(input_graph, max_iter, resolution)
88
89 ddf = input_graph.edgelist.edgelist_df
---> 90 vertex_partition_offsets = get_vertex_partition_offsets(input_graph)
91 num_verts = vertex_partition_offsets.iloc[-1]
92 num_edges = len(ddf)

~/anaconda3/envs/rapids-21.10/lib/python3.8/site-packages/cugraph/dask/common/input_utils.py in get_vertex_partition_offsets(input_graph)
227 def get_vertex_partition_offsets(input_graph):
228 import cudf
--> 229 renumber_vertex_count = input_graph.renumber_map.implementation.ddf.
230 map_partitions(len).compute()
231 renumber_vertex_cumsum = renumber_vertex_count.cumsum()

AttributeError: 'NoneType' object has no attribute 'implementation'

Steps/Code to reproduce bug
edges = 1000000
vertices = 100000
source = np.random.randint(vertices,size = edges)
target = np.random.randint(vertices,size = edges)
sim = np.random.uniform(0,1,edges)
df = cudf.DataFrame()
df['source'] = source
df['target'] = target
df['similarity'] = sim
df = dask_cudf.from_cudf(df,npartitions=2)
G = cugraph.DiGraph()
G.from_dask_cudf_edgelist(df, source='source', destination='target',edge_attr = 'similarity', renumber=False)
_, mod = dask_cugraph.louvain(G)

Expected behavior
Should be able to run louvain A
Environment overview (please complete the following information)

  • Environment location: [aws ec2 g4dn.12xlarge]
  • Method of cuGraph install: [conda]

Additional context
Add any other context about the problem here.

@co-tran-sp co-tran-sp added ? - Needs Triage Need team to review and classify bug Something isn't working labels Nov 9, 2021
@BradReesWork
Copy link
Member

@co-tran-sp thanks for submitting the issue. We will dive into solving it

@BradReesWork BradReesWork removed the ? - Needs Triage Need team to review and classify label Nov 10, 2021
@BradReesWork BradReesWork added this to the 21.12 milestone Nov 10, 2021
@jnke2016
Copy link
Contributor

Hi @co-tran-sp .
I was able to reproduce the error. I would like to confirm that the number of partitions is the same as the number workers your client hold. A quick fix to your problem would be to not set renumber to False as all our MNMG agos require renumbering (for performance optimization) which is by default set to True internally. A PR should be out soon to return a proper error message when renumber happens to be False.

@co-tran-sp
Copy link
Author

Hi all, thanks for the replies. @jnke2016 I was able to go around the error. Will there be support for undirected graph class using from_dask_cudf_edgelist? The digraph louvain process returns me very low modularity comparing to undirected graph class.

rapids-bot bot pushed a commit that referenced this issue Nov 12, 2021
A bug was reported when calling a MNMG algo with unrenumbered edge list. 
This PR returns an error if `renumber=False `

Change the algo name for asv reporting 

closes #1936

Authors:
  - Joseph Nke (https://github.com/jnke2016)

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

URL: #1943
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