From 9a86a665ef712e66e3c55b842d463ee09c2425b8 Mon Sep 17 00:00:00 2001 From: Muhammed Fatih BALIN Date: Mon, 2 Sep 2024 17:50:08 -0400 Subject: [PATCH] [GraphBolt][CUDA] Remove unused `num_bits` argument from `UniqueAndCompact` (#7764) --- graphbolt/include/graphbolt/cuda_ops.h | 4 ++-- graphbolt/src/cuda/unique_and_compact_impl.cu | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/graphbolt/include/graphbolt/cuda_ops.h b/graphbolt/include/graphbolt/cuda_ops.h index 91cd1a10c6..7ac22e1784 100644 --- a/graphbolt/include/graphbolt/cuda_ops.h +++ b/graphbolt/include/graphbolt/cuda_ops.h @@ -299,7 +299,7 @@ torch::Tensor IndptrEdgeIdsImpl( */ std::tuple UniqueAndCompact( const torch::Tensor src_ids, const torch::Tensor dst_ids, - const torch::Tensor unique_dst_ids, int num_bits = 0); + const torch::Tensor unique_dst_ids); /** * @brief Batched version of UniqueAndCompact. The ith element of the return @@ -310,7 +310,7 @@ std::vector> UniqueAndCompactBatched( const std::vector& src_ids, const std::vector& dst_ids, - const std::vector& unique_dst_ids, int num_bits = 0); + const std::vector& unique_dst_ids); } // namespace ops } // namespace graphbolt diff --git a/graphbolt/src/cuda/unique_and_compact_impl.cu b/graphbolt/src/cuda/unique_and_compact_impl.cu index 71ecfe3f55..5407777dae 100644 --- a/graphbolt/src/cuda/unique_and_compact_impl.cu +++ b/graphbolt/src/cuda/unique_and_compact_impl.cu @@ -61,7 +61,7 @@ std::vector> UniqueAndCompactBatchedSortBased( const std::vector& src_ids, const std::vector& dst_ids, - const std::vector& unique_dst_ids, int num_bits) { + const std::vector& unique_dst_ids, int num_bits = 0) { auto allocator = cuda::GetAllocator(); auto stream = cuda::GetCurrentStream(); auto scalar_type = src_ids.at(0).scalar_type(); @@ -276,7 +276,7 @@ std::vector> UniqueAndCompactBatched( const std::vector& src_ids, const std::vector& dst_ids, - const std::vector& unique_dst_ids, int num_bits) { + const std::vector& unique_dst_ids) { if (cuda::compute_capability() >= 70) { // Utilizes a hash table based implementation, the mapped id of a vertex // will be monotonically increasing as the first occurrence index of it in @@ -287,15 +287,13 @@ UniqueAndCompactBatched( // Utilizes a sort based algorithm, the mapped id of a vertex part of the // src_ids but not part of the unique_dst_ids will be monotonically increasing // as the actual vertex id increases. Thus, it is deterministic. - return UniqueAndCompactBatchedSortBased( - src_ids, dst_ids, unique_dst_ids, num_bits); + return UniqueAndCompactBatchedSortBased(src_ids, dst_ids, unique_dst_ids); } std::tuple UniqueAndCompact( const torch::Tensor src_ids, const torch::Tensor dst_ids, - const torch::Tensor unique_dst_ids, int num_bits) { - return UniqueAndCompactBatched( - {src_ids}, {dst_ids}, {unique_dst_ids}, num_bits)[0]; + const torch::Tensor unique_dst_ids) { + return UniqueAndCompactBatched({src_ids}, {dst_ids}, {unique_dst_ids})[0]; } } // namespace ops