-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Vertex ID Offsets in CuGraphStorage (#2996)
Users Vertex ID offsets in `CuGraphStore`. Offers the option of using pre-computed offsets by setting `renumber_graph=False`. Default behavior is to warn the user that it is computing offsets and save the original vertex ids in a new column. If `renumber_graph=True`, there is no warning, `renumber_vertices_by_type()` is called, and the vertex ids are overwritten. Due to a bug in `MGPropertyGraph`, if vertices are renumbered, edges must also be renumbered. Closes rapidsai/graph_dl#95 Closes #3069 - [x] Update Remote Graph tests - [x] Update CGS e2e tests - [x] Update SG PyG Extension Tests - [x] Update MG PyG Extension Tests - [x] Verify tests that are currently broken in CI Includes fix for #3069 Merge after #3012 Authors: - Alex Barghi (https://github.com/alexbarghi-nv) - Erik Welch (https://github.com/eriknw) - Rick Ratzel (https://github.com/rlratzel) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Rick Ratzel (https://github.com/rlratzel) - Vibhu Jawa (https://github.com/VibhuJawa) URL: #2996
- Loading branch information
1 parent
c98da66
commit ef52c5c
Showing
19 changed files
with
1,118 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright (c) 2021-2023, 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
import pytest | ||
|
||
from dask_cuda.initialize import initialize as dask_initialize | ||
from dask_cuda import LocalCUDACluster | ||
from dask.distributed import Client | ||
from cugraph.dask.comms import comms as Comms | ||
from cugraph.dask.common.mg_utils import get_visible_devices | ||
from cugraph.testing.mg_utils import stop_dask_client | ||
|
||
import tempfile | ||
|
||
# module-wide fixtures | ||
|
||
# If the rapids-pytest-benchmark plugin is installed, the "gpubenchmark" | ||
# fixture will be available automatically. Check that this fixture is available | ||
# by trying to import rapids_pytest_benchmark, and if that fails, set | ||
# "gpubenchmark" to the standard "benchmark" fixture provided by | ||
# pytest-benchmark. | ||
try: | ||
import rapids_pytest_benchmark # noqa: F401 | ||
except ImportError: | ||
import pytest_benchmark | ||
|
||
gpubenchmark = pytest_benchmark.plugin.benchmark | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def dask_client(): | ||
dask_scheduler_file = os.environ.get("SCHEDULER_FILE") | ||
cuda_visible_devices = get_visible_devices() | ||
|
||
if dask_scheduler_file is not None: | ||
dask_initialize() | ||
dask_client = Client(scheduler_file=dask_scheduler_file) | ||
else: | ||
# The tempdir created by tempdir_object should be cleaned up once | ||
# tempdir_object goes out-of-scope and is deleted. | ||
tempdir_object = tempfile.TemporaryDirectory() | ||
cluster = LocalCUDACluster( | ||
local_directory=tempdir_object.name, | ||
protocol="tcp", | ||
CUDA_VISIBLE_DEVICES=cuda_visible_devices, | ||
) | ||
|
||
dask_client = Client(cluster) | ||
dask_client.wait_for_workers(len(cuda_visible_devices)) | ||
|
||
if not Comms.is_initialized(): | ||
Comms.initialize(p2p=True) | ||
|
||
yield dask_client | ||
|
||
stop_dask_client(dask_client) | ||
print("\ndask_client fixture: client.close() called") |
Oops, something went wrong.