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 Bug in MG ego_graph #4262

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

set -euo pipefail

# TODO: Enable dask query planning (by default) once some bugs are fixed.
# xref: https://github.com/rapidsai/cudf/issues/15027
export DASK_DATAFRAME__QUERY_PLANNING=False

# Support invoking test_python.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

Expand Down
4 changes: 4 additions & 0 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

set -eoxu pipefail

# TODO: Enable dask query planning (by default) once some bugs are fixed.
# xref: https://github.com/rapidsai/cudf/issues/15027
export DASK_DATAFRAME__QUERY_PLANNING=False

package_name=$1
package_dir=$2

Expand Down
7 changes: 5 additions & 2 deletions python/cugraph/cugraph/dask/common/part_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -115,7 +115,10 @@ def persist_dask_df_equal_parts_per_worker(
raise ValueError("return_type must be either 'dask_cudf.DataFrame' or 'dict'")

ddf_keys = dask_df.to_delayed()
workers = client.scheduler_info()["workers"].keys()
rank_to_worker = Comms.rank_to_worker(client)
# rank-worker mappings are in ascending order
workers = dict(sorted(rank_to_worker.items())).values()

ddf_keys_ls = _chunk_lst(ddf_keys, len(workers))
persisted_keys_d = {}
for w, ddf_k in zip(workers, ddf_keys_ls):
Expand Down
15 changes: 14 additions & 1 deletion python/cugraph/cugraph/dask/comms/comms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -265,3 +265,16 @@ def get_n_workers(sID=None, dask_worker=None):
dask_worker = get_worker()
sessionstate = get_raft_comm_state(sID, dask_worker)
return sessionstate["nworkers"]


def rank_to_worker(client):
"""
Return a mapping of ranks to dask workers.
"""
workers = client.scheduler_info()["workers"].keys()
worker_info = __instance.worker_info(workers)
rank_to_worker = {}
for w in worker_info:
rank_to_worker[worker_info[w]["rank"]] = w

return rank_to_worker
Loading