Skip to content

Commit

Permalink
Re-enable optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
naimnv committed Sep 25, 2023
1 parent 0bb76ad commit 7badef0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import gc
from typing import Union
import warnings
import random

import cudf
import cupy as cp
Expand Down Expand Up @@ -182,7 +183,9 @@ def __from_edgelist(
# Repartition to 2 partitions per GPU for memory efficient process
input_ddf = input_ddf.repartition(npartitions=len(workers) * 2)
# FIXME: Make a copy of the input ddf before implicitly altering it.
input_ddf = input_ddf.map_partitions(lambda df: df.copy())
input_ddf = input_ddf.map_partitions(
lambda df: df.copy(), token="custom-" + str(random.random())
)
# The dataframe will be symmetrized iff the graph is undirected
# otherwise, the inital dataframe will be returned
if edge_attr is not None:
Expand Down
5 changes: 4 additions & 1 deletion python/cugraph/cugraph/tests/traversal/test_bfs_mg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# limitations under the License.

import gc
import random

import pytest

Expand Down Expand Up @@ -61,7 +62,9 @@ def modify_dataset(df):
return cudf.concat([df, temp_df])

meta = ddf._meta
ddf = ddf.map_partitions(modify_dataset, meta=meta)
ddf = ddf.map_partitions(
modify_dataset, meta=meta, token="custom-" + str(random.random())
)

df = cudf.read_csv(
input_data_path,
Expand Down

0 comments on commit 7badef0

Please sign in to comment.