cugraph icon indicating copy to clipboard operation
cugraph copied to clipboard

[FEA] Optimize cugraph.uniform_neighbor_sample

Open VibhuJawa opened this issue 2 years ago • 2 comments

Describe the solution you'd like and any additional context

We should optimize cugraph.uniform_neighbor_sample.

import cudf
import cugraph

df = cudf.read_parquet('/datasets/graph_nn/ogbn_products.parquet')
G = cugraph.Graph(directed=True)
G.from_cudf_edgelist(df,source='src',destination='dst',edge_attr='weight')
batch = G.nodes()[0:4096]
%%timeit 

sampled_g_cugraph = cugraph.uniform_neighbor_sample(G,
                                     start_list=batch,
                                     fanout_vals=[10],
                                     with_replacement=False
332 ms ± 847

Expected Performance : I would expect the performance to be around 8-9x better. More details in internal thread.

VibhuJawa avatar Jul 19 '22 23:07 VibhuJawa

Will be optimized by 50x 332 ms to 25 ms by https://github.com/rapidsai/cugraph/pull/2394 .

Of that 25 ms only 6.61 ms seems to spent in the pylibcugraph_uniform_neighbor_sample call so we have more scope there.

VibhuJawa avatar Jul 20 '22 22:07 VibhuJawa

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Sep 04 '22 21:09 github-actions[bot]

@seunghwak or @VibhuJawa
Can you confirm if this is complete? Does anything else need to occur to close this?

kingmesal avatar Mar 08 '23 18:03 kingmesal

https://github.com/rapidsai/cugraph/pull/3269 might be related to this issue no other issue tracking uniform neighbor sampling performance.

seunghwak avatar Mar 08 '23 18:03 seunghwak

@VibhuJawa can you confirm whether or not #3269 fixes your issue?

kingmesal avatar Mar 24 '23 19:03 kingmesal

Lets close this issue. https://github.com/rapidsai/cugraph/pull/3269 fixed most things

VibhuJawa avatar Mar 30 '23 17:03 VibhuJawa