Skip to content

Commit

Permalink
Merge branch 'branch-23.08' into branch-23.08
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-rliu authored Jul 25, 2023
2 parents 30734f9 + 4535d38 commit c1c2de9
Show file tree
Hide file tree
Showing 85 changed files with 4,073 additions and 1,053 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,20 @@ jobs:
sha: ${{ inputs.sha }}
wheel-build-pylibcugraph:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: pylibcugraph
package-dir: python/pylibcugraph

# Note that this approach to cloning repos obviates any modification to
# the CMake variables in get_cumlprims_mg.cmake since CMake will just use
# the clone as is.
script: ci/build_wheel_pylibcugraph.sh
extra-repo: rapidsai/cugraph-ops
extra-repo-sha: branch-23.08
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY

skbuild-configure-options: "-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/python/pylibcugraph/cugraph-ops/"
wheel-publish-pylibcugraph:
needs: wheel-build-pylibcugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -98,28 +91,20 @@ jobs:
wheel-build-cugraph:
needs: wheel-publish-pylibcugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cugraph
package-dir: python/cugraph

# Note that this approach to cloning repos obviates any modification to
# the CMake variables in get_cumlprims_mg.cmake since CMake will just use
# the clone as is.
script: ci/build_wheel_cugraph.sh
extra-repo: rapidsai/cugraph-ops
extra-repo-sha: branch-23.08
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY

before-wheel: "RAPIDS_PY_WHEEL_NAME=pylibcugraph_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 /local-wheelhouse"
skbuild-configure-options: "-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/python/cugraph/cugraph-ops/"
wheel-publish-cugraph:
needs: wheel-build-cugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,47 +78,34 @@ jobs:
wheel-build-pylibcugraph:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
package-name: pylibcugraph
package-dir: python/pylibcugraph
script: ci/build_wheel_pylibcugraph.sh
extra-repo: rapidsai/cugraph-ops
extra-repo-sha: branch-23.08
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
skbuild-configure-options: "-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/python/pylibcugraph/cugraph-ops/"
wheel-tests-pylibcugraph:
needs: wheel-build-pylibcugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
package-name: pylibcugraph
test-unittest: "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest ./python/pylibcugraph/pylibcugraph/tests"
test-smoketest: "python ci/wheel_smoke_test_pylibcugraph.py"
script: ci/test_wheel_pylibcugraph.sh
wheel-build-cugraph:
needs: wheel-tests-pylibcugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
package-name: cugraph
package-dir: python/cugraph
script: ci/build_wheel_cugraph.sh
extra-repo: rapidsai/cugraph-ops
extra-repo-sha: branch-23.08
extra-repo-deploy-key: CUGRAPH_OPS_SSH_PRIVATE_DEPLOY_KEY
before-wheel: "RAPIDS_PY_WHEEL_NAME=pylibcugraph_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 /local-wheelhouse"
skbuild-configure-options: "-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/python/cugraph/cugraph-ops/"
wheel-tests-cugraph:
needs: wheel-build-cugraph
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
package-name: cugraph
# Always want to test against latest dask/distributed.
test-before-amd64: "cd ./datasets && bash ./get_test_data.sh && cd - && RAPIDS_PY_WHEEL_NAME=pylibcugraph_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 ./local-pylibcugraph-dep && pip install --no-deps ./local-pylibcugraph-dep/*.whl && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/dask-cuda.git@branch-23.08"
# Skip dataset downloads on arm to save CI time -- arm only runs smoke tests.
test-before-arm64: "RAPIDS_PY_WHEEL_NAME=pylibcugraph_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 ./local-pylibcugraph-dep && pip install --no-deps ./local-pylibcugraph-dep/*.whl && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/dask-cuda.git@branch-23.08"
test-unittest: "RAPIDS_DATASET_ROOT_DIR=/__w/cugraph/cugraph/datasets python -m pytest -m sg ./python/cugraph/cugraph/tests"
test-smoketest: "python ci/wheel_smoke_test_cugraph.py"
script: ci/test_wheel_cugraph.sh
13 changes: 4 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,19 @@ jobs:
sha: ${{ inputs.sha }}
wheel-tests-pylibcugraph:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
package-name: pylibcugraph
test-unittest: "RAPIDS_DATASET_ROOT_DIR=./datasets python -m pytest ./python/pylibcugraph/pylibcugraph/tests"
script: ci/test_wheel_pylibcugraph.sh
wheel-tests-cugraph:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
package-name: cugraph
# Always want to test against latest dask/distributed.
test-before-amd64: "cd ./datasets && bash ./get_test_data.sh && cd - && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/dask-cuda.git@branch-23.08"
test-before-arm64: "cd ./datasets && bash ./get_test_data.sh && cd - && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/dask-cuda.git@branch-23.08"
test-unittest: "RAPIDS_DATASET_ROOT_DIR=/__w/cugraph/cugraph/datasets python -m pytest -m sg ./python/cugraph/cugraph/tests"
script: ci/test_wheel_cugraph.sh
29 changes: 29 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

package_name=$1
package_dir=$2

source rapids-configure-sccache
source rapids-date-string

# Use gha-tools rapids-pip-wheel-version to generate wheel version then
# update the necessary files
version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

bash ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}"
echo "The package name and/or version was modified in the package source. The git diff is:"
git diff

cd "${package_dir}"

python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check

mkdir -p final_dist
python -m auditwheel repair -w final_dist dist/*

RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist
13 changes: 13 additions & 0 deletions ci/build_wheel_cugraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

RAPIDS_PY_WHEEL_NAME=pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX} rapids-download-wheels-from-s3 ./local-pylibcugraph
python -m pip install --no-deps ./local-pylibcugraph/pylibcugraph*.whl

export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"

./ci/build_wheel.sh cugraph python/cugraph
8 changes: 8 additions & 0 deletions ci/build_wheel_pylibcugraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DCUGRAPH_BUILD_WHEELS=ON -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"

./ci/build_wheel.sh pylibcugraph python/pylibcugraph
22 changes: 22 additions & 0 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -eoxu pipefail

package_name=$1
package_dir=$2

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# echo to expand wildcard before adding `[extra]` requires for pip
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist
python -m pip install $(echo ./dist/${package_name}*.whl)[test]

# Run smoke tests for aarch64 pull requests
arch=$(uname -m)
if [[ "${arch}" == "aarch64" && ${RAPIDS_BUILD_TYPE} == "pull-request" ]]; then
python ./ci/wheel_smoke_test_${package_name}.py
else
RAPIDS_DATASET_ROOT_DIR=`pwd`/datasets python -m pytest ./python/${package_name}/${package_name}/tests
fi
22 changes: 22 additions & 0 deletions ci/test_wheel_cugraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -eoxu pipefail

# Download the pylibcugraph built in the previous step
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-pylibcugraph-dep
python -m pip install --no-deps ./local-pylibcugraph-dep/pylibcugraph*.whl

# Always install latest dask for testing
python -m pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/dask-cuda.git@branch-23.08

# Only download test data for x86
arch=$(uname -m)
if [[ "${arch}" == "x86_64" ]]; then
pushd ./datasets
bash ./get_test_data.sh
popd
fi

./ci/test_wheel.sh cugraph python/cugraph
6 changes: 6 additions & 0 deletions ci/test_wheel_pylibcugraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -eoxu pipefail

./ci/test_wheel.sh pylibcugraph python/pylibcugraph
70 changes: 70 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
channels:
- rapidsai
- rapidsai-nightly
- dask/label/dev
- pytorch
- dglteam/label/cu118
- conda-forge
- nvidia
dependencies:
- aiohttp
- c-compiler
- cmake>=3.26.4
- cuda-nvcc
- cuda-version=12.0
- cudf==23.8.*
- cupy>=12.0.0
- cxx-compiler
- cython>=0.29,<0.30
- dask-core>=2023.5.1
- dask-cuda==23.8.*
- dask-cudf==23.8.*
- dask>=2023.5.1
- distributed>=2023.5.1
- doxygen
- fsspec[http]>=0.6.0
- gcc_linux-64=11.*
- gmock>=1.13.0
- graphviz
- gtest>=1.13.0
- ipython
- libcudf==23.8.*
- libcugraphops==23.8.*
- libraft-headers==23.8.*
- libraft==23.8.*
- librmm==23.8.*
- nbsphinx
- nccl>=2.9.9
- networkx>=2.5.1
- ninja
- notebook>=0.5.0
- numba>=0.57
- numpy>=1.21
- numpydoc
- openmpi
- pandas
- pre-commit
- pydata-sphinx-theme
- pylibcugraphops==23.8.*
- pylibraft==23.8.*
- pytest
- pytest-benchmark
- pytest-cov
- pytest-xdist
- python-louvain
- raft-dask==23.8.*
- recommonmark
- requests
- rmm==23.8.*
- scikit-build>=0.13.1
- scikit-learn>=0.23.1
- scipy
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx<6
- sphinxcontrib-websupport
- ucx-proc=*=gpu
- ucx-py==0.33.*
name: all_cuda-120_arch-x86_64
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ set(CUGRAPH_SOURCES
src/community/detail/mis_mg.cu
src/detail/utility_wrappers.cu
src/structure/graph_view_mg.cu
src/utilities/cython.cu
src/utilities/path_retrieval.cu
src/structure/legacy/graph.cu
src/linear_assignment/legacy/hungarian.cu
Expand Down Expand Up @@ -229,6 +228,7 @@ set(CUGRAPH_SOURCES
src/sampling/detail/shuffle_and_organize_output_mg.cu
src/sampling/uniform_neighbor_sampling_mg.cpp
src/sampling/uniform_neighbor_sampling_sg.cpp
src/sampling/renumber_sampled_edgelist_sg.cu
src/cores/core_number_sg.cu
src/cores/core_number_mg.cu
src/cores/k_core_sg.cu
Expand Down
52 changes: 52 additions & 0 deletions cpp/include/cugraph/graph_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,4 +916,56 @@ rmm::device_uvector<vertex_t> select_random_vertices(
bool sort_vertices,
bool do_expensive_check = false);

/**
* @brief renumber sampling output
*
* This function renumbers sampling function (e.g. uniform_neighbor_sample) outputs satisfying the
* following requirements.
*
* 1. Say @p edgelist_srcs has N unique vertices. These N unique vertices will be mapped to [0, N).
* 2. Among the N unique vertices, an original vertex with a smaller attached hop number will be
* renumbered to a smaller vertex ID than any other original vertices with a larger attached hop
* number (if @p edgelist_hops.has_value() is true). If a single vertex is attached to multiple hop
* numbers, the minimum hop number is used.
* 3. Say @p edgelist_dsts has M unique vertices that appear only in @p edgelist_dsts (the set of M
* unique vertices does not include any vertices that appear in @p edgelist_srcs). Then, these M
* unique vertices will be mapped to [N, N + M).
* 4. If label_offsets.has_value() is ture, edge lists for different labels will be renumbered
* separately.
*
* This function is single-GPU only (we are not aware of any practical multi-GPU use cases).
*
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam label_t Type of labels. Needs to be an integral type.
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param edgelist_srcs A vector storing original edgelist source vertices.
* @param edgelist_hops An optional pointer to the array storing hops for each edge list source
* vertices (size = @p edgelist_srcs.size()).
* @param edgelist_dsts A vector storing original edgelist destination vertices (size = @p
* edgelist_srcs.size()).
* @param label_offsets An optional tuple of unique labels and the input edge list (@p
* edgelist_srcs, @p edgelist_hops, and @p edgelist_dsts) offsets for the labels (siez = # unique
* labels + 1).
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
* @return Tuple of vectors storing renumbered edge sources (size = @p edgelist_srcs.size()) ,
* renumbered edge destinations (size = @p edgelist_dsts.size()), renumber_map to query original
* verties (size = # unique vertices or aggregate # unique vertices for every label), and
* renumber_map offsets (size = std::get<0>(*label_offsets).size() + 1, valid only if @p
* label_offsets.has_value() is true).
*/
template <typename vertex_t, typename label_t>
std::tuple<rmm::device_uvector<vertex_t>,
rmm::device_uvector<vertex_t>,
rmm::device_uvector<vertex_t>,
std::optional<rmm::device_uvector<size_t>>>
renumber_sampled_edgelist(
raft::handle_t const& handle,
rmm::device_uvector<vertex_t>&& edgelist_srcs,
std::optional<raft::device_span<int32_t const>> edgelist_hops,
rmm::device_uvector<vertex_t>&& edgelist_dsts,
std::optional<std::tuple<raft::device_span<label_t const>, raft::device_span<size_t const>>>
label_offsets,
bool do_expensive_check = false);

} // namespace cugraph
Loading

0 comments on commit c1c2de9

Please sign in to comment.