From 050d524d88c27cce6d91c6ec4f26350d1fd9b3bb Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 30 Oct 2024 17:30:58 -0500 Subject: [PATCH] print sccache stats in builds (#4719) Contributes to https://github.com/rapidsai/build-planning/issues/111 Proposes some small packaging/CI changes, matching similar changes being made across RAPIDS. * printing `sccache` stats to CI logs * updating to the latest `rapids-dependency-file-generator` (v1.16.0) * always explicitly specifying `cpp` / `python` in calls to `rapids-upload-wheels-to-s3` ## Notes for Reviewers This originally also ran wheel builds with `--no-build-isolation`, but I reverted that based on https://github.com/rapidsai/build-planning/issues/108#issuecomment-2436764212. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: https://github.com/rapidsai/cugraph/pull/4719 --- .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 2 ++ ci/build_python.sh | 7 +++++++ ci/build_wheel.sh | 10 ++++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3687562b48e..b5fbcf9ad42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: setup[.]cfg$ - id: verify-alpha-spec - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 859977d76d5..93e5c680d07 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -17,4 +17,6 @@ rapids-logger "Begin cpp build" RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcugraph +sccache --show-adv-stats + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index c94cc2a0fce..af9c3c56403 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -20,6 +20,8 @@ export RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-logger "Begin py build" +sccache --zero-stats + # TODO: Remove `--no-test` flags once importing on a CPU # node works correctly rapids-conda-retry mambabuild \ @@ -27,12 +29,17 @@ rapids-conda-retry mambabuild \ --channel "${CPP_CHANNEL}" \ conda/recipes/pylibcugraph +sccache --show-adv-stats +sccache --zero-stats + rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/cugraph +sccache --show-adv-stats + # NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA # platform to ensure it is included in each set of artifacts, since test # scripts only install from one set of artifacts based on the CUDA version used diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f3979ab3049..944975c55ee 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -15,6 +15,10 @@ rapids-generate-version > ./VERSION cd "${package_dir}" +sccache --zero-stats + +rapids-logger "Building '${package_name}' wheel" + python -m pip wheel \ -w dist \ -v \ @@ -23,12 +27,14 @@ python -m pip wheel \ --extra-index-url https://pypi.nvidia.com \ . +sccache --show-adv-stats + # pure-python packages should be marked as pure, and not have auditwheel run on them. if [[ ${package_name} == "nx-cugraph" ]] || \ [[ ${package_name} == "cugraph-dgl" ]] || \ [[ ${package_name} == "cugraph-pyg" ]] || \ [[ ${package_name} == "cugraph-equivariant" ]]; then - RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 python dist else case "${RAPIDS_CUDA_VERSION}" in 12.*) @@ -48,5 +54,5 @@ else mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* - RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist fi