Skip to content

Commit

Permalink
use sccache, print sccache stats in builds (#112)
Browse files Browse the repository at this point in the history
Contributes to rapidsai/build-planning#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) and `rapidsai/pre-commit-hooks` (v0.4.0)
* always explicitly specifying `python` in calls to `rapids-upload-wheels-to-s3`

While doing that, I also noticed this project wasn't using `sccache`. This PR proposes using `sccache` to drive compilation, to speed up builds a bit.

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #112
  • Loading branch information
jameslamb authored Oct 29, 2024
1 parent 63536f4 commit 666375a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: clang-format
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.13.11
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand All @@ -19,7 +19,7 @@ repos:
- id: ruff
- id: ruff-format
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.1.0
rev: v0.4.0
hooks:
- id: verify-copyright
args: [--fix, --main-branch=main]
4 changes: 4 additions & 0 deletions ci/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ cuda_compiler_version:
- "${CUDA_VERSION}"
EOF

sccache --zero-stats

rapids-conda-retry build \
conda/recipes/pynvjitlink \
-m cuda_compiler_version.yaml \
;

sccache --show-adv-stats

rapids-upload-conda-to-s3 python
10 changes: 8 additions & 2 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@

set -euo pipefail

source rapids-configure-sccache

rapids-logger "Install CUDA Toolkit"
source "$(dirname "$0")/install_latest_cuda_toolkit.sh"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

sccache --zero-stats

rapids-logger "Build wheel"
mkdir -p ./dist
python -m pip wheel . --wheel-dir=./dist -vvv --disable-pip-version-check --no-deps
python -m pip wheel . --wheel-dir=./dist -v --disable-pip-version-check --no-deps

sccache --show-adv-stats

# Exclude libcuda.so.1 because we only install a driver stub
python -m auditwheel repair --exclude libcuda.so.1 -w ./final_dist ./dist/*

rapids-logger "Upload Wheel"
RAPIDS_PY_WHEEL_NAME="pynvjitlink_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 ./final_dist
RAPIDS_PY_WHEEL_NAME="pynvjitlink_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python ./final_dist
16 changes: 16 additions & 0 deletions conda/recipes/pynvjitlink/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ source:
build:
script:
- {{ PYTHON }} -m pip install . -vv
script_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- CMAKE_C_COMPILER_LAUNCHER
- CMAKE_CUDA_COMPILER_LAUNCHER
- CMAKE_CXX_COMPILER_LAUNCHER
- CMAKE_GENERATOR
- PARALLEL_LEVEL
- SCCACHE_BUCKET
- SCCACHE_IDLE_TIMEOUT
- SCCACHE_REGION
- SCCACHE_S3_KEY_PREFIX=pynvjitlink-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=pynvjitlink-linux64 # [linux64]
- SCCACHE_S3_USE_SSL
- SCCACHE_S3_NO_CREDENTIALS
ignore_run_exports_from:
- {{ compiler('cuda') }}
- libnvjitlink-dev
Expand Down

0 comments on commit 666375a

Please sign in to comment.