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

Fix MG PLC algos intermittent hang #2607

Merged
2 changes: 2 additions & 0 deletions conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ requirements:
- ucx-proc=*=gpu
- cudatoolkit {{ cuda_version }}.*
- libraft-headers {{ minor_version }}
# FIXME: this pin can be removed once we move to the GitHub Actions build process
- setuptools<=65.2.0
run:
- python x.x
- pylibcugraph={{ version }}
Expand Down
13 changes: 12 additions & 1 deletion python/cugraph/cugraph/dask/cores/core_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def core_number(input_graph,
degree_type,
do_expensive_check,
workers=[w],
allow_other_workers=False,
)
for w in Comms.get_workers()
]
Expand All @@ -126,7 +127,17 @@ def core_number(input_graph,

wait(cudf_result)

ddf = dask_cudf.from_delayed(cudf_result)
ddf = dask_cudf.from_delayed(cudf_result).persist()
wait(ddf)

# FIXME: Dask doesn't always release it fast enough.
# For instance if the algo is run several times with
# the same PLC graph, the current iteration might try to cache
# the past iteration's futures and this can cause a hang if some
# of those futures get released midway
del result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing result is still a good practice as when cudf_result is completed we will still have result in memory so from a memory relief standpoint it makes sense.

del cudf_result

Copy link
Member

@VibhuJawa VibhuJawa Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we also del cudf_result here to save on memory . We have a renumbered call after this so result does not go out of scope immediately, hence its important .

if input_graph.renumbered:
ddf = input_graph.unrenumber(ddf, "vertex")

Expand Down
14 changes: 13 additions & 1 deletion python/cugraph/cugraph/dask/link_analysis/pagerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def pagerank(input_graph,
max_iter,
do_expensive_check,
workers=[w],
allow_other_workers=False,
)
for w, data_personalization in data_prsztn.worker_to_parts.items()
]
Expand All @@ -304,6 +305,7 @@ def pagerank(input_graph,
max_iter,
do_expensive_check,
workers=[w],
allow_other_workers=False,
)
for w in Comms.get_workers()
]
Expand All @@ -316,7 +318,17 @@ def pagerank(input_graph,

wait(cudf_result)

ddf = dask_cudf.from_delayed(cudf_result)
ddf = dask_cudf.from_delayed(cudf_result).persist()
wait(ddf)

# FIXME: Dask doesn't always release it fast enough.
# For instance if the algo is run several times with
# the same PLC graph, the current iteration might try to cache
# the past iteration's futures and this can cause a hang if some
# of those futures get released midway
del result
del cudf_result

if input_graph.renumbered:
ddf = input_graph.unrenumber(ddf, "vertex")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def uniform_neighbor_sample(input_graph,
fanout_vals,
with_replacement,
workers=[w],
allow_other_workers=False,
)
for w in Comms.get_workers()
]
Expand All @@ -164,7 +165,16 @@ def uniform_neighbor_sample(input_graph,

wait(cudf_result)

ddf = dask_cudf.from_delayed(cudf_result)
ddf = dask_cudf.from_delayed(cudf_result).persist()
wait(ddf)

# FIXME: Dask doesn't always release it fast enough.
# For instance if the algo is run several times with
# the same PLC graph, the current iteration might try to cache
# the past iteration's futures and this can cause a hang if some
# of those futures get released midway
del result
del cudf_result

if input_graph.renumbered:
ddf = input_graph.unrenumber(ddf, "sources", preserve_order=True)
Expand Down
14 changes: 12 additions & 2 deletions python/cugraph/cugraph/dask/traversal/bfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def bfs(input_graph,
st[0],
depth_limit,
return_distances,
workers=[w]
workers=[w],
allow_other_workers=False,
)
for w, st in data_start.worker_to_parts.items()
]
Expand All @@ -188,7 +189,16 @@ def bfs(input_graph,
for cp_arrays in cupy_result]
wait(cudf_result)

ddf = dask_cudf.from_delayed(cudf_result)
ddf = dask_cudf.from_delayed(cudf_result).persist()
wait(ddf)

# FIXME: Dask doesn't always release it fast enough.
# For instance if the algo is run several times with
# the same PLC graph, the current iteration might try to cache
# the past iteration's futures and this can cause a hang if some
# of those futures get released midway
del cupy_result
del cudf_result

if input_graph.renumbered:
ddf = input_graph.unrenumber(ddf, 'vertex')
Expand Down