Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fatbin to shared libs and fixing conda paths in cpu build #485

Merged
merged 36 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b50344f
Adding cpu checks for ci build
cjnolet Feb 2, 2022
e7a1e98
Updating years
cjnolet Feb 2, 2022
6e0628e
Updates
cjnolet Feb 2, 2022
2c59f69
Fixing libraft_headers
cjnolet Feb 2, 2022
c526379
Fixing per review feedback
cjnolet Feb 2, 2022
39f67d8
Merge branch 'branch-22.04' into imp-2204-ci_cpu_build
cjnolet Feb 2, 2022
d940fac
Add fatbin
cjnolet Feb 2, 2022
3cbf3b1
fixing ci conda recipe paths
cjnolet Feb 3, 2022
133ea65
Fixing typo in conda yaml files
cjnolet Feb 3, 2022
3ea2f05
Reordering conda build calls by dependencie
cjnolet Feb 3, 2022
451f8a8
Installing headers
cjnolet Feb 3, 2022
da2ec4e
Trying mamba
cjnolet Feb 3, 2022
5556e09
trying mambabuild again
cjnolet Feb 3, 2022
390c171
Updates
cjnolet Feb 3, 2022
2ad9f41
nprc
cjnolet Feb 3, 2022
bf1eb26
remove -x
cjnolet Feb 3, 2022
6e7a4d0
verbose
cjnolet Feb 3, 2022
49f44ab
Moving verbose flag
cjnolet Feb 3, 2022
386ca8d
printing verbosityi
cjnolet Feb 3, 2022
a9e9c5a
using cmake message log level
cjnolet Feb 3, 2022
acdf7aa
Trying verbose again
cjnolet Feb 3, 2022
dcc3338
adding cuda-python to build
cjnolet Feb 3, 2022
936aeca
Only installing when not compiling any libs
cjnolet Feb 3, 2022
2a2fe1b
Adding rmm to pyraft conda dependencies
cjnolet Feb 3, 2022
d87e349
Removing the wrong logging
cjnolet Feb 3, 2022
c946926
Breaking out jensenshannon specializations
cjnolet Feb 3, 2022
6ab5d4e
Fixing style
cjnolet Feb 3, 2022
375024c
No clean in conda recipes
cjnolet Feb 4, 2022
f294c8f
Adding dsome logging
cjnolet Feb 4, 2022
8a7368e
Updating logging
cjnolet Feb 4, 2022
147ddf4
Always installing cmake. Separating out nn from dist compile libs
cjnolet Feb 4, 2022
199eb5a
fatbin
cjnolet Feb 4, 2022
499708d
Breaking out separate instantiations for distances to speed up compile
cjnolet Feb 4, 2022
3e301b8
Breakig apart more distance source files
cjnolet Feb 4, 2022
773b985
Making sure files are in correct directoris for s3 upload
cjnolet Feb 4, 2022
fce4880
Adding missing src files
cjnolet Feb 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SINGLEGPU=""
NVTX=OFF
CLEAN=0
DISABLE_DEPRECATION_WARNINGS=ON
CMAKE_TARGET=""
CMAKE_TARGET="install;"

# Set defaults for vars that may not have been defined externally
# FIXME: if INSTALL_PREFIX is not set, check PREFIX, then check
Expand Down Expand Up @@ -180,16 +180,16 @@ if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs; then

if (( ${NUMARGS} == 0 )) || hasArg libraft; then
# Run all c++ targets at once
if hasArg --compile-nn || hasArg --compile-dist || hasArg --compile-libs; then
# if hasArg --compile-nn || hasArg --compile-dist || hasArg --compile-libs; then
if ! hasArg --nogtest; then
CMAKE_TARGET="test_raft;${CMAKE_TARGET}"
fi

echo "-- Compiling targets: ${CMAKE_TARGET}"
cmake --build ${CPP_RAFT_BUILD_DIR} -j${PARALLEL_LEVEL} ${VERBOSE_FLAG} --target ${CMAKE_TARGET}
else
cmake --build ${CPP_RAFT_BUILD_DIR} -j${PARALLEL_LEVEL} ${VERBOSE_FLAG}
fi
# else
# cmake --build ${CPP_RAFT_BUILD_DIR} -j${PARALLEL_LEVEL} ${VERBOSE_FLAG}
# fi
fi

fi
Expand Down
18 changes: 9 additions & 9 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ conda config --set ssl_verify False
# install. This should eliminate a mismatch between different CUDA versions on
# cpu vs. gpu builds that is problematic with CUDA 11.5 Enhanced Compat.
if [ "$BUILD_LIBRAFT" == '1' ]; then
BUILD_PYRAFT=1
BUILD_RAFT=1
# If we are doing CUDA + Python builds, libraft package is located at ${CONDA_BLD_DIR}
CONDA_LOCAL_CHANNEL="${CONDA_BLD_DIR}"
else
Expand All @@ -86,21 +86,21 @@ fi
if [ "$BUILD_LIBRAFT" == '1' ]; then
gpuci_logger "Building conda packages for libraft-nn, libraft-distance, and libraft-headers"
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft-nn
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft-distance
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft-headers
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft_headers
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft_nn
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libraft_distance
else
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft-nn
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft-distance
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft-headers
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft_headers
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft_nn
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libraft_distance
mkdir -p ${CONDA_BLD_DIR}/libraft
mv ${CONDA_BLD_DIR}/work ${CONDA_BLD_DIR}/libraft/work
fi
else
gpuci_logger "SKIPPING build of conda packages for libraft-nn, libraft-distance and libraft-headers"
fi

if [ "$BUILD_raft" == "1" ]; then
if [ "$BUILD_RAFT" == "1" ]; then
gpuci_logger "Building conda packages for pyraft"
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/pyraft --python=$PYTHON
Expand All @@ -118,4 +118,4 @@ fi
################################################################################

gpuci_logger "Upload conda packages"
source ci/cpu/upload.sh
source ci/cpu/upload.sh
2 changes: 1 addition & 1 deletion ci/cpu/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
#If project flash is not activate, always build both
export BUILD_PYRAFT=1
export BUILD_RAFT=1
export BUILD_LIBRAFT=1
fi

Expand Down
2 changes: 1 addition & 1 deletion ci/cpu/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [[ "$BUILD_LIBRAFT" == "1" && "$UPLOAD_LIBRAFT" == "1" ]]; then
gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${LIBRAFT_HEADERS_FILE} --no-progress
fi

if [[ "$BUILD_PYRAFT" == "1" ]]; then
if [[ "$BUILD_RAFT" == "1" ]]; then
test -e ${PYRAFT_FILE}
echo "Upload pyraft"
echo ${PYRAFT_FILE}
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/libraft_distance/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ requirements:
build:
- cmake>=3.20.1
host:
- libraft-headers {{
- libraft-headers {{ version }}
- nccl>=2.9.9
- cudatoolkit {{ cuda_version }}.*
- ucx-py {{ ucx_py_version }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/pyraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ requirements:
- python x.x
- setuptools
- cython>=0.29,<0.30
- libraft-headers={{ version }}
- libraft-headers {{ version }}
- cudatoolkit {{ cuda_version }}.*
- ucx-py {{ ucx_py_version }}
- ucx-proc=*=gpu
run:
- python x.x
- dask-cuda {{ minor_version }}
- libraft-headers={{ version }}
- libraft-headers {{ version }}
- cupy>=7.8.0,<10.0.0a0
- nccl>=2.9.9
- ucx-py {{ ucx_py_version }}
Expand Down
16 changes: 16 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ target_link_libraries(raft INTERFACE
target_compile_definitions(raft INTERFACE $<$<BOOL:${NVTX}>:NVTX_ENABLED>)
target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)

if(RAFT_COMPILE_LIBRARIES)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld"
[=[
SECTIONS
{
.nvFatBinSegment : { *(.nvFatBinSegment) }
.nv_fatbin : { *(.nv_fatbin) }
}
]=])
endif()
##############################################################################
# - raft_distance ------------------------------------------------------------
add_library(raft_distance INTERFACE)
Expand Down Expand Up @@ -180,6 +190,9 @@ if(RAFT_COMPILE_LIBRARIES)
target_compile_definitions(raft_distance_lib
INTERFACE "RAFT_DISTANCE_COMPILED")

# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
target_link_options(raft_distance_lib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")

endif()

target_link_libraries(raft_distance INTERFACE raft::raft
Expand Down Expand Up @@ -214,6 +227,9 @@ if(RAFT_COMPILE_LIBRARIES)
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${RAFT_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>"
)
# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
target_link_options(raft_nn_lib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")

target_compile_definitions(raft_nn_lib
INTERFACE "RAFT_NN_COMPILED")

Expand Down