From 1effdd6ebb59191c77bea7dbfd5e4d073958b831 Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Thu, 10 Dec 2020 13:27:15 -0600 Subject: [PATCH 1/5] Updated cuxfilter to 0.18 --- conda/environments/cugraph_dev_cuda10.1.yml | 2 +- conda/environments/cugraph_dev_cuda10.2.yml | 2 +- conda/environments/cugraph_dev_cuda11.0.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conda/environments/cugraph_dev_cuda10.1.yml b/conda/environments/cugraph_dev_cuda10.1.yml index ed345fcafff..46d770e6cb0 100644 --- a/conda/environments/cugraph_dev_cuda10.1.yml +++ b/conda/environments/cugraph_dev_cuda10.1.yml @@ -8,7 +8,7 @@ dependencies: - cudf=0.18.* - libcudf=0.18.* - rmm=0.18.* -- cuxfilter=0.17.* +- cuxfilter=0.18.* - librmm=0.18.* - dask>=2.12.0 - distributed>=2.12.0 diff --git a/conda/environments/cugraph_dev_cuda10.2.yml b/conda/environments/cugraph_dev_cuda10.2.yml index 325a89382b7..01aec115bf9 100644 --- a/conda/environments/cugraph_dev_cuda10.2.yml +++ b/conda/environments/cugraph_dev_cuda10.2.yml @@ -8,7 +8,7 @@ dependencies: - cudf=0.18.* - libcudf=0.18.* - rmm=0.18.* -- cuxfilter=0.17.* +- cuxfilter=0.18.* - librmm=0.18.* - dask>=2.12.0 - distributed>=2.12.0 diff --git a/conda/environments/cugraph_dev_cuda11.0.yml b/conda/environments/cugraph_dev_cuda11.0.yml index 386377e745d..def32ccb291 100644 --- a/conda/environments/cugraph_dev_cuda11.0.yml +++ b/conda/environments/cugraph_dev_cuda11.0.yml @@ -8,7 +8,7 @@ dependencies: - cudf=0.18.* - libcudf=0.18.* - rmm=0.18.* -- cuxfilter=0.17.* +- cuxfilter=0.18.* - librmm=0.18.* - dask>=2.12.0 - distributed>=2.12.0 From 22994b3cb441a90356b6cce03b18f665bcb2ce69 Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Thu, 10 Dec 2020 14:07:20 -0600 Subject: [PATCH 2/5] Removing datashader dep since it's not a direct dependency and is instead pulled in via cuxfilter. --- conda/environments/cugraph_dev_cuda10.1.yml | 1 - conda/environments/cugraph_dev_cuda10.2.yml | 1 - conda/environments/cugraph_dev_cuda11.0.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/conda/environments/cugraph_dev_cuda10.1.yml b/conda/environments/cugraph_dev_cuda10.1.yml index 46d770e6cb0..067fd0bc4ba 100644 --- a/conda/environments/cugraph_dev_cuda10.1.yml +++ b/conda/environments/cugraph_dev_cuda10.1.yml @@ -32,7 +32,6 @@ dependencies: - scikit-learn>=0.23.1 - colorcet - holoviews -- datashader - sphinx - sphinx_rtd_theme - sphinxcontrib-websupport diff --git a/conda/environments/cugraph_dev_cuda10.2.yml b/conda/environments/cugraph_dev_cuda10.2.yml index 01aec115bf9..3371340d8bd 100644 --- a/conda/environments/cugraph_dev_cuda10.2.yml +++ b/conda/environments/cugraph_dev_cuda10.2.yml @@ -32,7 +32,6 @@ dependencies: - scikit-learn>=0.23.1 - colorcet - holoviews -- datashader - sphinx - sphinx_rtd_theme - sphinxcontrib-websupport diff --git a/conda/environments/cugraph_dev_cuda11.0.yml b/conda/environments/cugraph_dev_cuda11.0.yml index def32ccb291..ee3b57632a1 100644 --- a/conda/environments/cugraph_dev_cuda11.0.yml +++ b/conda/environments/cugraph_dev_cuda11.0.yml @@ -31,7 +31,6 @@ dependencies: - pytest - scikit-learn>=0.23.1 - colorcet -- datashader - holoviews - sphinx - sphinx_rtd_theme From f675ccde0e9d930be361d8c8b8beb9e23d1d1483 Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Mon, 14 Dec 2020 21:54:14 -0600 Subject: [PATCH 3/5] Updated code to swap df columns (thanks to iroy30), added comments. --- python/cugraph/centrality/betweenness_centrality.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/cugraph/centrality/betweenness_centrality.py b/python/cugraph/centrality/betweenness_centrality.py index 634cc2aa7a2..93bdce7c515 100644 --- a/python/cugraph/centrality/betweenness_centrality.py +++ b/python/cugraph/centrality/betweenness_centrality.py @@ -233,7 +233,6 @@ def edge_betweenness_centrality( >>> G.from_cudf_edgelist(gdf, source='0', destination='1') >>> ebc = cugraph.edge_betweenness_centrality(G) """ - if weight is not None: raise NotImplementedError( "weighted implementation of betweenness " @@ -254,8 +253,16 @@ def edge_betweenness_centrality( df = G.unrenumber(df, "dst") if type(G) is cugraph.Graph: + # select the lower triangle of the df based on src/dst vertex value lower_triangle = df['src'] >= df['dst'] - df[["src", "dst"]][lower_triangle] = df[["dst", "src"]][lower_triangle] + # swap the src and dst vertices for the lower triangle only. Because + # this is a symmeterized graph, this operation results in a df with + # multiple src/dst entries. + df['src'][lower_triangle], df['dst'][lower_triangle] = \ + df['dst'][lower_triangle], df['src'][lower_triangle] + # overwrite the df with the sum of the values for all alike src/dst + # vertex pairs, resulting in half the edges of the original df from the + # symmeterized graph. df = df.groupby(by=["src", "dst"]).sum().reset_index() if isNx is True: From 28daab03d3ea02e3f04baf57880722ae9e2d81d2 Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Thu, 17 Dec 2020 12:44:38 -0600 Subject: [PATCH 4/5] Moved call to number_of_vertices() since it performs a cudf operation that has a side effect of moving device data, and if this is called after pointer values are assigned to pass to C++, the C++ code will not get the correct pointers. This is a cudf bug and they have already been notified. --- python/cugraph/structure/graph_primtypes.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/cugraph/structure/graph_primtypes.pyx b/python/cugraph/structure/graph_primtypes.pyx index f3f0fd9b9a6..da16f8f4c8a 100644 --- a/python/cugraph/structure/graph_primtypes.pyx +++ b/python/cugraph/structure/graph_primtypes.pyx @@ -93,6 +93,9 @@ cdef GraphCOOViewType get_coo_graph_view(input_graph, bool weighted=True, GraphC if not input_graph.edgelist: input_graph.view_edge_list() + num_edges = input_graph.number_of_edges(directed_edges=True) + num_verts = input_graph.number_of_vertices() + cdef uintptr_t c_src = input_graph.edgelist.edgelist_df['src'].__cuda_array_interface__['data'][0] cdef uintptr_t c_dst = input_graph.edgelist.edgelist_df['dst'].__cuda_array_interface__['data'][0] cdef uintptr_t c_weights = NULL @@ -101,8 +104,6 @@ cdef GraphCOOViewType get_coo_graph_view(input_graph, bool weighted=True, GraphC if input_graph.edgelist.weights and weighted: c_weights = input_graph.edgelist.edgelist_df['weights'].__cuda_array_interface__['data'][0] - num_verts = input_graph.number_of_vertices() - num_edges = input_graph.number_of_edges(directed_edges=True) cdef GraphCOOViewType in_graph if GraphCOOViewType is GraphCOOViewFloat: in_graph = GraphCOOViewFloat(c_src, c_dst, c_weights, num_verts, num_edges) From 566b4a86118fe74f8939b174350810b70898288e Mon Sep 17 00:00:00 2001 From: Rick Ratzel Date: Thu, 17 Dec 2020 12:51:57 -0600 Subject: [PATCH 5/5] Added cuxfilter to update-version.sh. --- ci/release/update-version.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index d853c3693c6..7cd0d9720fc 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -68,4 +68,5 @@ for FILE in conda/environments/*.yml; do sed_runner "s/dask-cuda=${CURRENT_SHORT_TAG}/dask-cuda=${NEXT_SHORT_TAG}/g" ${FILE}; sed_runner "s/dask-cudf=${CURRENT_SHORT_TAG}/dask-cudf=${NEXT_SHORT_TAG}/g" ${FILE}; sed_runner "s/ucx-py=${CURRENT_SHORT_TAG}/ucx-py=${NEXT_SHORT_TAG}/g" ${FILE}; + sed_runner "s/cuxfilter=${CURRENT_SHORT_TAG}/cuxfilter=${NEXT_SHORT_TAG}/g" ${FILE}; done