Skip to content

Commit c60693c

Browse files
authored
Merge branch 'main' into cupy-pin
2 parents d6a63e1 + fd06889 commit c60693c

11 files changed

Lines changed: 126 additions & 39 deletions

File tree

.github/CODEOWNERS

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
#cpp code owners
2-
cpp/ @rapidsai/raft-cpp-codeowners
2+
cpp/ @NVIDIA/raft-cpp-codeowners
33

44
#python code owners
5-
python/ @rapidsai/raft-python-codeowners
5+
python/ @NVIDIA/raft-python-codeowners
66

77
#cmake code owners
8-
CMakeLists.txt @rapidsai/raft-cmake-codeowners
9-
**/cmake/ @rapidsai/raft-cmake-codeowners
10-
*.cmake @rapidsai/raft-cmake-codeowners
11-
python/setup.py @rapidsai/raft-cmake-codeowners
12-
build.sh @rapidsai/raft-cmake-codeowners
13-
**/build.sh @rapidsai/raft-cmake-codeowners
8+
CMakeLists.txt @NVIDIA/raft-cmake-codeowners
9+
**/cmake/ @NVIDIA/raft-cmake-codeowners
10+
*.cmake @NVIDIA/raft-cmake-codeowners
11+
python/setup.py @NVIDIA/raft-cmake-codeowners
12+
build.sh @NVIDIA/raft-cmake-codeowners
13+
**/build.sh @NVIDIA/raft-cmake-codeowners
1414

1515
#CI code owners
16-
/.github/ @rapidsai/ci-codeowners
17-
/ci/ @rapidsai/ci-codeowners
18-
/.shellcheckrc @rapidsai/ci-codeowners
19-
/.coderabbit.yaml @rapidsai/ci-codeowners
16+
/.github/ @NVIDIA/adi-ci-codeowners
17+
/ci/ @NVIDIA/adi-ci-codeowners
18+
/.shellcheckrc @NVIDIA/adi-ci-codeowners
19+
/.coderabbit.yaml @NVIDIA/adi-ci-codeowners
2020

2121
#packaging code owners
22-
/.pre-commit-config.yaml @rapidsai/packaging-codeowners
23-
/.devcontainer/ @rapidsai/packaging-codeowners
24-
/conda/ @rapidsai/packaging-codeowners
25-
dependencies.yaml @rapidsai/packaging-codeowners
26-
/build.sh @rapidsai/packaging-codeowners
27-
pyproject.toml @rapidsai/packaging-codeowners
22+
/.pre-commit-config.yaml @NVIDIA/adi-packaging-codeowners
23+
/.devcontainer/ @NVIDIA/adi-packaging-codeowners
24+
/conda/ @NVIDIA/adi-packaging-codeowners
25+
dependencies.yaml @NVIDIA/adi-packaging-codeowners
26+
/build.sh @NVIDIA/adi-packaging-codeowners
27+
pyproject.toml @NVIDIA/adi-packaging-codeowners
2828

2929
# Ops code owners
30-
/SECURITY.md @rapidsai/ops-codeowners
30+
/SECURITY.md @NVIDIA/adi-ops-codeowners

.github/workflows/pr.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ jobs:
6868
with:
6969
repo: ${{ github.repository }}
7070
target-branch: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
71-
# Tracking Issue: https://github.com/rapidsai/raft/issues/3037
72-
max-days-without-success: 30
7371
changed-files:
7472
needs: telemetry-setup
7573
permissions:
@@ -277,6 +275,7 @@ jobs:
277275
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_conda
278276
with:
279277
build_type: pull-request
278+
run_codecov: false
280279
script: ci/test_python.sh
281280
docs-build:
282281
needs: [conda-python-build, changed-files]

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
build_type: ${{ inputs.build_type }}
6969
branch: ${{ inputs.branch }}
7070
date: ${{ inputs.date }}
71+
run_codecov: false
7172
script: ci/test_python.sh
7273
sha: ${{ inputs.sha }}
7374
wheel-tests-pylibraft:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

44
repos:
@@ -85,7 +85,7 @@ repos:
8585
(?x)
8686
^CHANGELOG[.]md$|
8787
- repo: https://github.com/rapidsai/pre-commit-hooks
88-
rev: v1.4.2
88+
rev: v1.6.0
8989
hooks:
9090
- id: verify-copyright
9191
name: verify-copyright-raft
@@ -145,7 +145,7 @@ repos:
145145
)
146146
- id: verify-alpha-spec
147147
- id: verify-codeowners
148-
args: [--fix, --project-prefix=raft]
148+
args: [--fix, --org=NVIDIA, --project-prefix=raft]
149149
- id: verify-hardcoded-version
150150
exclude: |
151151
(?x)
@@ -171,7 +171,7 @@ repos:
171171
^conda/environments/|
172172
(^|/)UCXX_BRANCH$|
173173
(^|/)RAPIDS_BRANCH$|
174-
[.](md|rst)$
174+
[.](md|rst|svg)$
175175
- id: verify-pyproject-license
176176
# ignore the top-level pyproject.toml, which doesn't
177177
# have or need a [project] table

build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
4848
--cmake-args=\\\"<args>\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument)
4949
--cache-tool=<tool> - pass the build cache tool (eg: ccache, sccache, distcc) that will be used
5050
to speedup the build process.
51+
--logging-level=<level> - set macro \"RAFT_LOG_ACTIVE_LEVEL\" to RAPIDS_LOGGER_LOG_LEVEL_{given_value}.
52+
Valid values are (TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, OFF)
5153
--time - Enable nvcc compilation time logging into cpp/build/nvcc_compile_log.csv.
5254
Results can be interpreted with cpp/scripts/analyze_nvcc_log.py
5355
-h - print this text
@@ -72,6 +74,7 @@ COMPILE_LIBRARY=OFF
7274
INSTALL_TARGET=install
7375
BUILD_REPORT_METRICS=""
7476
BUILD_REPORT_INCL_CACHE_STATS=OFF
77+
LIBRAFT_LOGGING_LEVEL=INFO
7578

7679
TEST_TARGETS="CORE_TEST;\
7780
CORE_TEST_NOCUDA;\
@@ -193,6 +196,21 @@ function limitBench {
193196
fi
194197
}
195198

199+
function loggingLevel {
200+
if [[ -n $(echo "$ARGS" | { grep -E "\-\-logging\-level" || true; } ) ]]; then
201+
LIBRAFT_LOGGING_LEVEL=$(echo "$ARGS" | sed -e 's/.*--logging-level[= ]//' -e 's/ .*//')
202+
if [[ -n ${LIBRAFT_LOGGING_LEVEL} ]]; then
203+
ARGS="${ARGS//--logging-level[= ]${LIBRAFT_LOGGING_LEVEL}/}"
204+
VALID_LEVELS="TRACE DEBUG INFO WARN ERROR CRITICAL OFF"
205+
if [[ ! " ${VALID_LEVELS} " == *" ${LIBRAFT_LOGGING_LEVEL} "* ]]; then
206+
echo "Invalid --logging-level value: '${LIBRAFT_LOGGING_LEVEL}'. Valid values are: ${VALID_LEVELS}"
207+
exit 1
208+
fi
209+
echo "Set LIBRAFT_LOGGING_LEVEL to ${LIBRAFT_LOGGING_LEVEL}"
210+
fi
211+
fi
212+
}
213+
196214
function buildMetrics {
197215
# Check for multiple build-metrics options
198216
if [[ $(echo "$ARGS" | { grep -Eo "\-\-build\-metrics" || true; } | wc -l ) -gt 1 ]]; then
@@ -223,6 +241,7 @@ if (( NUMARGS != 0 )); then
223241
cacheTool
224242
limitTests
225243
limitBench
244+
loggingLevel
226245
buildMetrics
227246
for a in ${ARGS}; do
228247
if ! (echo " ${VALIDARGS} " | grep -q " ${a} "); then
@@ -406,6 +425,7 @@ if (( NUMARGS == 0 )) || hasArg libraft || hasArg docs || hasArg tests || hasArg
406425
-DBUILD_TESTS=${BUILD_TESTS} \
407426
-DBUILD_PRIMS_BENCH=${BUILD_PRIMS_BENCH} \
408427
-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL} \
428+
-DLIBRAFT_LOGGING_LEVEL="${LIBRAFT_LOGGING_LEVEL}" \
409429
"${CACHE_ARGS[@]}" \
410430
"${EXTRA_CMAKE_ARGS[@]}"
411431

cpp/include/raft/core/interruptible.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <rmm/cuda_stream_view.hpp>
1616

17+
#include <atomic>
1718
#include <memory>
1819
#include <mutex>
1920
#include <optional>

cpp/include/raft/matrix/detail/gather_inplace.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void gatherInplaceImpl(raft::resources const& handle,
5454
transform_op,
5555
batch_offset,
5656
map_length,
57-
cols_per_batch = raft::util::FastIntDiv(cols_per_batch),
57+
cols_per_batch = raft::util::FastIntDiv<IndexT>(cols_per_batch),
5858
n,
5959
ld] __device__(auto idx) {
6060
IndexT row = idx / cols_per_batch;
@@ -74,7 +74,7 @@ void gatherInplaceImpl(raft::resources const& handle,
7474
scratch_space = scratch_space.data_handle(),
7575
batch_offset,
7676
map_length,
77-
cols_per_batch = raft::util::FastIntDiv(cols_per_batch),
77+
cols_per_batch = raft::util::FastIntDiv<IndexT>(cols_per_batch),
7878
n,
7979
ld] __device__(auto idx) {
8080
IndexT row = idx / cols_per_batch;

cpp/include/raft/matrix/detail/scatter_inplace.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void scatterInplaceImpl(
7777
auto copy_op = [inout = inout.data_handle(),
7878
map = map.data_handle(),
7979
batch_offset,
80-
cols_per_batch = raft::util::FastIntDiv(cols_per_batch),
80+
cols_per_batch = raft::util::FastIntDiv<IndexT>(cols_per_batch),
8181
n] __device__(auto idx) {
8282
IndexT row = idx / cols_per_batch;
8383
IndexT col = idx % cols_per_batch;
@@ -92,7 +92,7 @@ void scatterInplaceImpl(
9292
map = map.data_handle(),
9393
scratch_space = scratch_space.data_handle(),
9494
batch_offset,
95-
cols_per_batch = raft::util::FastIntDiv(cols_per_batch),
95+
cols_per_batch = raft::util::FastIntDiv<IndexT>(cols_per_batch),
9696
n] __device__(auto idx) {
9797
IndexT row = idx / cols_per_batch;
9898
IndexT col = idx % cols_per_batch;

cpp/include/raft/util/fast_int_div.cuh

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,34 @@
1010

1111
#include <stdint.h>
1212

13+
#include <type_traits>
14+
1315
namespace raft {
1416
namespace util {
1517

1618
/**
1719
* @brief Perform fast integer division and modulo using a known divisor
1820
* From Hacker's Delight, Second Edition, Chapter 10
1921
*
20-
* @note This currently only supports 32b signed integers
22+
* @note 32b signed integer is supported.
23+
* @note 64b signed integers is supported for an input data up to 2^31
24+
* because gpu-non-native int128 is avoided for performance.
2125
* @todo Extend support for signed divisors
2226
*/
27+
template <typename IntT>
2328
struct FastIntDiv {
29+
static_assert(std::is_same_v<IntT, int32_t> || std::is_same_v<IntT, int64_t>,
30+
"FastIntDiv: IntT must be int32_t or int64_t");
31+
using UIntT = std::make_unsigned_t<IntT>;
32+
2433
/**
2534
* @defgroup HostMethods Ctor's that are accessible only from host
2635
* @{
2736
* @brief Host-only ctor's
2837
* @param _d the divisor
2938
*/
30-
FastIntDiv(int _d) : d(_d) { computeScalars(); }
31-
FastIntDiv& operator=(int _d)
39+
FastIntDiv(IntT _d) : d(_d) { computeScalars(); }
40+
FastIntDiv& operator=(IntT _d)
3241
{
3342
d = _d;
3443
computeScalars();
@@ -53,9 +62,9 @@ struct FastIntDiv {
5362
/** @} */
5463

5564
/** divisor */
56-
int d;
65+
IntT d;
5766
/** the term 'm' as found in the reference chapter */
58-
unsigned m;
67+
UIntT m;
5968
/** the term 'p' as found in the reference chapter */
6069
int p;
6170

@@ -90,10 +99,11 @@ struct FastIntDiv {
9099
* @param divisor the denominator
91100
* @return the quotient
92101
*/
93-
HDI int operator/(int n, const FastIntDiv& divisor)
102+
template <typename IntT>
103+
HDI IntT operator/(IntT n, const FastIntDiv<IntT>& divisor)
94104
{
95105
if (divisor.d == 1) return n;
96-
int ret = (int64_t(divisor.m) * int64_t(n)) >> divisor.p;
106+
IntT ret = (int64_t(divisor.m) * int64_t(n)) >> divisor.p;
97107
if (n < 0) ++ret;
98108
return ret;
99109
}
@@ -105,10 +115,11 @@ HDI int operator/(int n, const FastIntDiv& divisor)
105115
* @param divisor the denominator
106116
* @return the remainder
107117
*/
108-
HDI int operator%(int n, const FastIntDiv& divisor)
118+
template <typename IntT>
119+
HDI IntT operator%(IntT n, const FastIntDiv<IntT>& divisor)
109120
{
110-
int quotient = n / divisor;
111-
int remainder = n - quotient * divisor.d;
121+
IntT quotient = n / divisor;
122+
IntT remainder = n - quotient * divisor.d;
112123
return remainder;
113124
}
114125

cpp/tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ if(BUILD_TESTS)
317317
util/bitonic_sort.cu
318318
util/cudart_utils.cpp
319319
util/device_atomics.cu
320+
util/fast_int_div.cu
320321
util/integer_utils.cpp
321322
util/integer_utils.cu
322323
util/memory_type_dispatcher.cu

0 commit comments

Comments
 (0)