Skip to content

Commit d237328

Browse files
authored
Merge pull request #81 from rapidsai/branch-22.06
[RELEASE] kvikio v22.06
2 parents 84a8ffa + 774552c commit d237328

36 files changed

+542
-309
lines changed

.github/ops-bot.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file controls which features from the `ops-bot` repository below are enabled.
2+
# - https://github.com/rapidsai/ops-bot
3+
4+
auto_merger: true
5+
branch_checker: true
6+
label_checker: true
7+
release_drafter: true
8+
external_contributors: false

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# kvikio 22.06.00 (Date TBD)
2+
3+
Please see https://github.com/rapidsai/kvikio/releases/tag/v22.06.00a for the latest changes to this development branch.
4+
5+

ci/cpu/build.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ gpuci_mamba_retry install -c conda-forge boa
6767
# BUILD - Conda package builds
6868
################################################################################
6969

70-
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
71-
CONDA_BUILD_ARGS=""
72-
else
73-
CONDA_BUILD_ARGS="--dirty --no-remove-work-dir"
74-
fi
75-
7670
gpuci_logger "Build conda pkg for libkvikio"
7771
gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} conda/recipes/libkvikio --python=$PYTHON $CONDA_BUILD_ARGS
7872

ci/gpu/build.sh

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
1717
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
1818

1919
# Set home to the job's workspace
20-
export HOME="$WORKSPACE"
20+
export HOME="${WORKSPACE}"
2121

2222
# Switch to project root; also root of repo checkout
23-
cd "$WORKSPACE"
23+
cd "${WORKSPACE}"
2424

2525
# Determine CUDA release version
2626
export CUDA_REL=${CUDA_VERSION%.*}
27-
export CONDA_ARTIFACT_PATH="$WORKSPACE/ci/artifacts/kvikio/cpu/.conda-bld/"
2827

2928
# Parse git describe
3029
export GIT_DESCRIBE_TAG=`git describe --tags`
3130
export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
31+
unset GIT_DESCRIBE_TAG
3232

3333
################################################################################
3434
# SETUP - Check environment
@@ -44,12 +44,6 @@ gpuci_logger "Activate conda env"
4444
. /opt/conda/etc/profile.d/conda.sh
4545
conda activate rapids
4646

47-
gpuci_logger "Install dependencies"
48-
gpuci_mamba_retry install -y \
49-
"cudatoolkit=$CUDA_REL" \
50-
"cupy" \
51-
"zarr"
52-
5347
gpuci_logger "Check compiler versions"
5448
python --version
5549
$CC --version
@@ -64,13 +58,31 @@ conda list --show-channel-urls
6458
# TEST - Run py.test for kvikio
6559
################################################################################
6660

67-
cd "$WORKSPACE/python"
68-
69-
gpuci_logger "Build kvikio from source"
70-
python -m pip install .
61+
gpuci_logger "Build and install libkvikio and kvikio"
62+
cd "${WORKSPACE}"
63+
export CONDA_BLD_DIR="${WORKSPACE}/.conda-bld"
64+
gpuci_mamba_retry install -c conda-forge boa
65+
gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} conda/recipes/libkvikio
66+
gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} conda/recipes/kvikio --python=$PYTHON -c "${CONDA_BLD_DIR}"
67+
gpuci_mamba_retry install -c "${CONDA_BLD_DIR}" libkvikio kvikio
68+
69+
gpuci_logger "Build and run libkvikio-debug"
70+
mkdir "${WORKSPACE}/libkvikio-debug-build"
71+
cd "${WORKSPACE}/libkvikio-debug-build"
72+
cmake ${WORKSPACE}/cpp -DCMAKE_BUILD_TYPE=Debug
73+
make
74+
# Check that `libcuda.so` is NOT being linked
75+
LDD_BASIC_IO=`ldd ${WORKSPACE}/libkvikio-debug-build/examples/basic_io`
76+
if [[ "$LDD_BASIC_IO" == *"libcuda.so"* ]]; then
77+
echo "[ERROR] examples/basic_io shouln't link to libcuda.so: ${LDD_BASIC_IO}"
78+
return 1
79+
fi
80+
# Run basic_io
81+
${WORKSPACE}/libkvikio-debug-build/examples/basic_io
7182

83+
cd "${WORKSPACE}/python"
7284
gpuci_logger "Python py.test for kvikio"
73-
py.test -n 6 --cache-clear --basetemp="$WORKSPACE/cudf-cuda-tmp" --junitxml="$WORKSPACE/junit-kvikio.xml" -v
85+
py.test -n 6 --cache-clear --basetemp="${WORKSPACE}/cudf-cuda-tmp" --junitxml="${WORKSPACE}/junit-kvikio.xml" -v
7486

7587
if [ -n "${CODECOV_TOKEN}" ]; then
7688
codecov -t $CODECOV_TOKEN

ci/release/update-version.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ function sed_runner() {
3030
}
3131

3232
# cpp update
33-
sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' cpp/CMakeLists.txt
33+
sed_runner "/project(/,/)/s/VERSION.*/VERSION ${NEXT_FULL_TAG}/" cpp/CMakeLists.txt
34+
35+
# python update
36+
sed_runner 's/set(kvikio_version.*)/set(kvikio_version '${NEXT_FULL_TAG}')/g' python/CMakeLists.txt
37+
38+
# rapids-cmake version
39+
sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' cpp/cmake/fetch_rapids.cmake
40+
41+
# script update
42+
sed_runner 's/version=.*/version="'${NEXT_SHORT_TAG}'"):/g' scripts/format-all.py
3443

3544
# doxyfile update
3645
sed_runner 's/PROJECT_NUMBER = .*/PROJECT_NUMBER = '${NEXT_FULL_TAG}'/g' cpp/doxygen/Doxyfile
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
c_compiler_version:
2+
- 9
3+
4+
cxx_compiler_version:
5+
- 9
6+
7+
cuda_compiler:
8+
- nvcc
9+
10+
sysroot_version:
11+
- "2.17"

conda/recipes/kvikio/meta.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ build:
1818
script_env:
1919
- VERSION_SUFFIX
2020
- PARALLEL_LEVEL
21-
- CC
22-
- CXX
23-
- CUDAHOSTCXX
2421
script:
2522
- cd python
2623
- python -m pip install . -vv
24+
ignore_run_exports_from:
25+
- {{ compiler('cuda') }}
2726

2827
requirements:
2928
build:
3029
- cmake >=3.20.1
3130
- ninja
31+
- {{ compiler('c') }}
32+
- {{ compiler('cxx') }}
33+
- {{ compiler('cuda') }} {{ cuda_version }}
34+
- sysroot_{{ target_platform }} {{ sysroot_version }}
3235
host:
3336
- python
3437
- setuptools
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
c_compiler_version:
2+
- 9
3+
4+
cxx_compiler_version:
5+
- 9
6+
7+
cuda_compiler:
8+
- nvcc
9+
10+
sysroot_version:
11+
- "2.17"

conda/recipes/libkvikio/meta.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ build:
1515
number: {{ GIT_DESCRIBE_NUMBER }}
1616
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
1717
script_env:
18-
- CC
19-
- CXX
20-
- CUDAHOSTCXX
2118
- PARALLEL_LEVEL
2219
- VERSION_SUFFIX
2320
- PROJECT_FLASH
@@ -32,12 +29,18 @@ build:
3229
- SCCACHE_IDLE_TIMEOUT=32768
3330
run_exports:
3431
- {{ pin_subpackage("libkvikio", max_pin="x.x") }}
32+
ignore_run_exports_from:
33+
- {{ compiler('cuda') }}
3534

3635

3736
requirements:
3837
build:
3938
- cmake >=3.20.1
4039
- make
40+
- {{ compiler('c') }}
41+
- {{ compiler('cxx') }}
42+
- {{ compiler('cuda') }} {{ cuda_version }}
43+
- sysroot_{{ target_platform }} {{ sysroot_version }}
4144
host:
4245
- cudatoolkit {{ cuda_version }}.*
4346
run:

cpp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ include(rapids-find)
2222

2323
project(
2424
KvikIO
25-
VERSION 22.04.00
25+
VERSION 22.06.00
2626
LANGUAGES CXX
2727
)
2828

@@ -71,11 +71,11 @@ target_include_directories(
7171
)
7272

7373
target_link_libraries(kvikio INTERFACE Threads::Threads)
74-
target_link_libraries(kvikio INTERFACE cuda)
74+
target_link_libraries(kvikio INTERFACE CUDA::toolkit)
7575
if(cuFile_FOUND)
7676
target_link_libraries(kvikio INTERFACE cufile::cuFile_interface)
7777
endif()
78-
target_link_libraries(kvikio INTERFACE dl)
78+
target_link_libraries(kvikio INTERFACE ${CMAKE_DL_LIBS})
7979
target_compile_features(kvikio INTERFACE cxx_std_17)
8080

8181
# optionally build examples

cpp/cmake/fetch_rapids.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# or implied. See the License for the specific language governing permissions and limitations under
1212
# the License.
1313
# =============================================================================
14-
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake
14+
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.06/RAPIDS.cmake
1515
${CMAKE_BINARY_DIR}/RAPIDS.cmake
1616
)
1717
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)

cpp/doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "libkvikio"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 22.04.00
41+
PROJECT_NUMBER = 22.06.00
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

cpp/examples/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@
1515
add_executable(basic_io basic_io.cpp)
1616
target_include_directories(basic_io PRIVATE ../include ${cuFile_INCLUDE_DIRS})
1717
target_link_libraries(basic_io PRIVATE kvikio CUDA::cudart)
18+
19+
if(CMAKE_COMPILER_IS_GNUCXX)
20+
set(KVIKIO_CXX_FLAGS "-Wall;-Werror;-Wno-unknown-pragmas")
21+
target_compile_options(
22+
basic_io PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${KVIKIO_CXX_FLAGS}>"
23+
)
24+
endif()

cpp/include/kvikio/buffer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ inline void buffer_register(const void* devPtr_base,
5151
{
5252
if (defaults::compat_mode()) { return; }
5353
#ifdef KVIKIO_CUFILE_EXIST
54-
CUfileError_t status = cuFileAPI::instance()->BufRegister(devPtr_base, size, flags);
54+
CUfileError_t status = cuFileAPI::instance().BufRegister(devPtr_base, size, flags);
5555
if (status.err != CU_FILE_SUCCESS) {
5656
// Check if `status.err` is in `errors_to_ignore`
5757
if (std::find(errors_to_ignore.begin(), errors_to_ignore.end(), status.err) ==
@@ -71,7 +71,7 @@ inline void buffer_deregister(const void* devPtr_base)
7171
{
7272
if (defaults::compat_mode()) { return; }
7373
#ifdef KVIKIO_CUFILE_EXIST
74-
CUFILE_TRY(cuFileAPI::instance()->BufDeregister(devPtr_base));
74+
CUFILE_TRY(cuFileAPI::instance().BufDeregister(devPtr_base));
7575
#endif
7676
}
7777

cpp/include/kvikio/defaults.hpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
#include <kvikio/thread_pool.hpp>
2828

2929
namespace kvikio {
30-
31-
namespace {
30+
namespace detail {
3231

3332
template <typename T>
3433
T getenv_or(std::string_view env_var_name, T default_val)
@@ -47,7 +46,7 @@ T getenv_or(std::string_view env_var_name, T default_val)
4746
}
4847

4948
template <>
50-
bool getenv_or(std::string_view env_var_name, bool default_val)
49+
inline bool getenv_or(std::string_view env_var_name, bool default_val)
5150
{
5251
const auto* env_val = std::getenv(env_var_name.data());
5352
if (env_val == nullptr) { return default_val; }
@@ -71,7 +70,7 @@ bool getenv_or(std::string_view env_var_name, bool default_val)
7170
std::string{env_val});
7271
}
7372

74-
} // namespace
73+
} // namespace detail
7574

7675
/**
7776
* @brief Singleton class of default values used thoughtout KvikIO.
@@ -80,12 +79,12 @@ bool getenv_or(std::string_view env_var_name, bool default_val)
8079
class defaults {
8180
private:
8281
kvikio::third_party::thread_pool _thread_pool{get_num_threads_from_env()};
83-
bool _combat_mode;
82+
bool _compat_mode;
8483
std::size_t _task_size;
8584

8685
static unsigned int get_num_threads_from_env()
8786
{
88-
const int ret = getenv_or("KVIKIO_NTHREADS", 1);
87+
const int ret = detail::getenv_or("KVIKIO_NTHREADS", 1);
8988
if (ret <= 0) { throw std::invalid_argument("KVIKIO_NTHREADS has to be a positive integer"); }
9089
return ret;
9190
}
@@ -96,15 +95,15 @@ class defaults {
9695
{
9796
if (std::getenv("KVIKIO_COMPAT_MODE") != nullptr) {
9897
// Setting `KVIKIO_COMPAT_MODE` take precedence
99-
_combat_mode = getenv_or("KVIKIO_COMPAT_MODE", false);
98+
_compat_mode = detail::getenv_or("KVIKIO_COMPAT_MODE", false);
10099
} else {
101100
// If `KVIKIO_COMPAT_MODE` isn't set, we infer based on runtime environment
102-
_combat_mode = !is_cufile_available();
101+
_compat_mode = !is_cufile_available();
103102
}
104103
}
105104
// Determine the default value of `task_size`
106105
{
107-
const ssize_t env = getenv_or("KVIKIO_TASK_SIZE", 16 * 1024 * 1024);
106+
const ssize_t env = detail::getenv_or("KVIKIO_TASK_SIZE", 4 * 1024 * 1024);
108107
if (env <= 0) {
109108
throw std::invalid_argument("KVIKIO_TASK_SIZE has to be a positive integer");
110109
}
@@ -137,12 +136,17 @@ class defaults {
137136
*
138137
* @return The boolean answer
139138
*/
140-
[[nodiscard]] static bool compat_mode() { return instance()->_combat_mode; }
139+
[[nodiscard]] static bool compat_mode() { return instance()->_compat_mode; }
141140

142141
/**
143142
* @brief Reset the value of `kvikio::defaults::compat_mode()`
143+
*
144+
* Changing compatibility mode, effects all new FileHandles that doesn't sets the
145+
* `compat_mode` argument explicitly but it never effect existing FileHandles.
146+
*
147+
* @param enable Whether to enable compatibility mode or not.
144148
*/
145-
static void compat_mode_reset(bool enable) { instance()->_combat_mode = enable; }
149+
static void compat_mode_reset(bool enable) { instance()->_compat_mode = enable; }
146150

147151
/**
148152
* @brief Get the default thread pool.

0 commit comments

Comments
 (0)