Skip to content

Commit

Permalink
update negative sampling behavior to match rapidsai/cugraph#4885
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarghi-nv committed Jan 30, 2025
1 parent 296ed80 commit 725a460
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions python/cugraph-pyg/cugraph_pyg/sampler/sampler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,11 @@ def neg_sample(
int(ceil(seed_src.numel() / batch_size)),
)

if graph_store.is_multi_gpu:
num_neg_global = torch.tensor([num_neg], device="cuda")
torch.distributed.all_reduce(num_neg_global, op=torch.distributed.ReduceOp.SUM)
else:
num_neg_global = num_neg

if node_time is None:
result_dict = pylibcugraph.negative_sampling(
graph_store._resource_handle,
graph_store._graph,
num_neg_global,
num_neg,
vertices=None
if unweighted
else cupy.arange(src_weight.numel(), dtype="int64"),
Expand Down

0 comments on commit 725a460

Please sign in to comment.