diff --git a/build.sh b/build.sh index c2eba134c35..8b3add1dddd 100755 --- a/build.sh +++ b/build.sh @@ -185,12 +185,9 @@ if buildAll || hasArg libcudf; then fi # get the current count before the compile starts - FILES_IN_CCACHE="" - if [[ "$BUILD_REPORT_INCL_CACHE_STATS" == "ON" && -x "$(command -v ccache)" ]]; then - FILES_IN_CCACHE=$(ccache -s | grep "files in cache") - echo "$FILES_IN_CCACHE" - # zero the ccache statistics - ccache -z + if [[ "$BUILD_REPORT_INCL_CACHE_STATS" == "ON" && -x "$(command -v sccache)" ]]; then + # zero the sccache statistics + sccache --zero-stats fi cmake -S $REPODIR/cpp -B ${LIB_BUILD_DIR} \ @@ -216,11 +213,12 @@ if buildAll || hasArg libcudf; then echo "Formatting build metrics" python ${REPODIR}/cpp/scripts/sort_ninja_log.py ${LIB_BUILD_DIR}/.ninja_log --fmt xml > ${LIB_BUILD_DIR}/ninja_log.xml MSG="
"
- # get some ccache stats after the compile
- if [[ "$BUILD_REPORT_INCL_CACHE_STATS"=="ON" && -x "$(command -v ccache)" ]]; then
- MSG="${MSG}
$FILES_IN_CCACHE"
- HIT_RATE=$(ccache -s | grep "cache hit rate")
- MSG="${MSG}
${HIT_RATE}"
+ # get some sccache stats after the compile
+ if [[ "$BUILD_REPORT_INCL_CACHE_STATS" == "ON" && -x "$(command -v sccache)" ]]; then
+ COMPILE_REQUESTS=$(sccache -s | grep "Compile requests \+ [0-9]\+$" | awk '{ print $NF }')
+ CACHE_HITS=$(sccache -s | grep "Cache hits \+ [0-9]\+$" | awk '{ print $NF }')
+ HIT_RATE=$(echo - | awk "{printf \"%.2f\n\", $CACHE_HITS / $COMPILE_REQUESTS * 100}")
+ MSG="${MSG}
cache hit rate ${HIT_RATE} %"
fi
MSG="${MSG}
parallel setting: $PARALLEL_LEVEL"
MSG="${MSG}
parallel build time: $compile_total seconds"
diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh
index 6f19f174da0..574a55d26b6 100755
--- a/ci/cpu/build.sh
+++ b/ci/cpu/build.sh
@@ -31,6 +31,10 @@ if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then
export VERSION_SUFFIX=`date +%y%m%d`
fi
+export CMAKE_CUDA_COMPILER_LAUNCHER="sccache"
+export CMAKE_CXX_COMPILER_LAUNCHER="sccache"
+export CMAKE_C_COMPILER_LAUNCHER="sccache"
+
################################################################################
# SETUP - Check environment
################################################################################
@@ -77,6 +81,8 @@ if [ "$BUILD_LIBCUDF" == '1' ]; then
gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcudf $CONDA_BUILD_ARGS
mkdir -p ${CONDA_BLD_DIR}/libcudf/work
cp -r ${CONDA_BLD_DIR}/work/* ${CONDA_BLD_DIR}/libcudf/work
+ gpuci_logger "sccache stats"
+ sccache --show-stats
# Copy libcudf build metrics results
LIBCUDF_BUILD_DIR=$CONDA_BLD_DIR/libcudf/work/cpp/build
diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh
index d5fb7451769..6a5c28faeff 100755
--- a/ci/gpu/build.sh
+++ b/ci/gpu/build.sh
@@ -36,6 +36,10 @@ export DASK_DISTRIBUTED_GIT_TAG='2022.01.0'
# ucx-py version
export UCX_PY_VERSION='0.25.*'
+export CMAKE_CUDA_COMPILER_LAUNCHER="sccache"
+export CMAKE_CXX_COMPILER_LAUNCHER="sccache"
+export CMAKE_C_COMPILER_LAUNCHER="sccache"
+
################################################################################
# TRAP - Setup trap for removing jitify cache
################################################################################
diff --git a/conda/recipes/libcudf/meta.yaml b/conda/recipes/libcudf/meta.yaml
index 2cbe5173de0..70c020d4abd 100644
--- a/conda/recipes/libcudf/meta.yaml
+++ b/conda/recipes/libcudf/meta.yaml
@@ -22,13 +22,15 @@ build:
- PARALLEL_LEVEL
- VERSION_SUFFIX
- PROJECT_FLASH
- - CCACHE_DIR
- - CCACHE_NOHASHDIR
- - CCACHE_COMPILERCHECK
- CMAKE_GENERATOR
- CMAKE_C_COMPILER_LAUNCHER
- CMAKE_CXX_COMPILER_LAUNCHER
- CMAKE_CUDA_COMPILER_LAUNCHER
+ - SCCACHE_S3_KEY_PREFIX=libcudf-aarch64 # [aarch64]
+ - SCCACHE_S3_KEY_PREFIX=libcudf-linux64 # [linux64]
+ - SCCACHE_BUCKET=rapids-sccache
+ - SCCACHE_REGION=us-west-2
+ - SCCACHE_IDLE_TIMEOUT=32768
run_exports:
- {{ pin_subpackage("libcudf", max_pin="x.x") }}