Skip to content

Commit

Permalink
Merge branch 'branch-24.04' into tests/pytest/warning_failure
Browse files Browse the repository at this point in the history
  • Loading branch information
BradReesWork authored Mar 15, 2024
2 parents f971bcb + 6d45e7b commit 499774b
Show file tree
Hide file tree
Showing 22 changed files with 844 additions and 640 deletions.
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,23 @@ repos:
[.]flake8[.]cython$|
meta[.]yaml$|
setup[.]cfg$
- repo: local
hooks:
- id: nx-cugraph-meta-data-update
name: nx-cugraph meta-data updater
entry: bash -c "PYTHONPATH=./python/nx-cugraph python ./python/nx-cugraph/_nx_cugraph/__init__.py"
files: ^python/nx-cugraph/
types: [python]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.2"]
- repo: local
hooks:
- id: nx-cugraph-readme-update
name: nx-cugraph README updater
entry: bash -c "PYTHONPATH=./python/nx-cugraph python ./python/nx-cugraph/scripts/update_readme.py ./python/nx-cugraph/README.md"
files: ^python/nx-cugraph/
types_or: [python, markdown]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.2"]
7 changes: 0 additions & 7 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ python -m nx_cugraph.scripts.print_tree --dispatch-name --plc --incomplete --dif
python -m nx_cugraph.scripts.print_table
popd

rapids-logger "ensure nx-cugraph autogenerated files are up to date"
pushd python/nx-cugraph
make || true
git diff --exit-code .
git checkout .
popd

rapids-logger "pytest cugraph-service (single GPU)"
./ci/run_cugraph_service_pytests.sh \
--verbose \
Expand Down
17 changes: 16 additions & 1 deletion cpp/include/cugraph/mtmg/instance_manager.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-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 @@ -73,6 +73,21 @@ class instance_manager_t {
return handle_t(*raft_handle_[gpu_id], thread_id, device_ids_[gpu_id]);
}

/**
* @brief Get handle for particular GPU
*
* Return a handle for a particular GPU. In a context-free environment
* this lets the caller reconstitute the handle for the right host thread.
* It does assume that the caller will not allow multiple threads to
* concurrently use a gpu_id/thread_id pair.
*
* @return a handle for this thread.
*/
handle_t get_handle(int gpu_id, int thread_id = 0)
{
return handle_t(*raft_handle_[gpu_id], thread_id, device_ids_[gpu_id]);
}

/**
* @brief Reset the thread counter
*
Expand Down
5 changes: 3 additions & 2 deletions cpp/include/cugraph/mtmg/vertex_result_view.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-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 @@ -45,7 +45,8 @@ class vertex_result_view_t : public detail::device_shared_device_span_t<result_t
raft::device_span<vertex_t const> vertices,
std::vector<vertex_t> const& vertex_partition_range_lasts,
cugraph::vertex_partition_view_t<vertex_t, multi_gpu> vertex_partition_view,
std::optional<cugraph::mtmg::renumber_map_view_t<vertex_t>>& renumber_map_view);
std::optional<cugraph::mtmg::renumber_map_view_t<vertex_t>>& renumber_map_view,
result_t default_value = 0);
};

} // namespace mtmg
Expand Down
32 changes: 32 additions & 0 deletions cpp/src/c_api/random_walks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ cugraph_error_code_t cugraph_node2vec(const cugraph_resource_handle_t* handle,
cugraph_random_walk_result_t** result,
cugraph_error_t** error)
{
CAPI_EXPECTS(reinterpret_cast<cugraph::c_api::cugraph_graph_t*>(graph)->vertex_type_ ==
reinterpret_cast<cugraph::c_api::cugraph_type_erased_device_array_view_t const*>(
start_vertices)
->type_,
CUGRAPH_INVALID_INPUT,
"vertex type of graph and start_vertices must match",
*error);

cugraph::c_api::node2vec_functor functor(
handle, graph, start_vertices, max_length, compress_results, p, q);

Expand Down Expand Up @@ -528,6 +536,14 @@ cugraph_error_code_t cugraph_uniform_random_walks(
cugraph_random_walk_result_t** result,
cugraph_error_t** error)
{
CAPI_EXPECTS(reinterpret_cast<cugraph::c_api::cugraph_graph_t*>(graph)->vertex_type_ ==
reinterpret_cast<cugraph::c_api::cugraph_type_erased_device_array_view_t const*>(
start_vertices)
->type_,
CUGRAPH_INVALID_INPUT,
"vertex type of graph and start_vertices must match",
*error);

uniform_random_walks_functor functor(handle, graph, start_vertices, max_length);

return cugraph::c_api::run_algorithm(graph, functor, result, error);
Expand All @@ -541,6 +557,14 @@ cugraph_error_code_t cugraph_biased_random_walks(
cugraph_random_walk_result_t** result,
cugraph_error_t** error)
{
CAPI_EXPECTS(reinterpret_cast<cugraph::c_api::cugraph_graph_t*>(graph)->vertex_type_ ==
reinterpret_cast<cugraph::c_api::cugraph_type_erased_device_array_view_t const*>(
start_vertices)
->type_,
CUGRAPH_INVALID_INPUT,
"vertex type of graph and start_vertices must match",
*error);

biased_random_walks_functor functor(handle, graph, start_vertices, max_length);

return cugraph::c_api::run_algorithm(graph, functor, result, error);
Expand All @@ -556,6 +580,14 @@ cugraph_error_code_t cugraph_node2vec_random_walks(
cugraph_random_walk_result_t** result,
cugraph_error_t** error)
{
CAPI_EXPECTS(reinterpret_cast<cugraph::c_api::cugraph_graph_t*>(graph)->vertex_type_ ==
reinterpret_cast<cugraph::c_api::cugraph_type_erased_device_array_view_t const*>(
start_vertices)
->type_,
CUGRAPH_INVALID_INPUT,
"vertex type of graph and start_vertices must match",
*error);

node2vec_random_walks_functor functor(handle, graph, start_vertices, max_length, p, q);

return cugraph::c_api::run_algorithm(graph, functor, result, error);
Expand Down
Loading

0 comments on commit 499774b

Please sign in to comment.