From b73cb818c432cafaf69a529c2594eea2e9c5c75e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 12:45:01 -0400 Subject: [PATCH 01/50] [chore] Use sccache in builds --- .github/workflows/build-wheel.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 283a0d462b..b2b63e8a0f 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -46,6 +46,9 @@ jobs: with: fetch-depth: 0 + - name: Enable sccache + uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 + - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true From b4c2849ca35f8bed59f32006ca44a6d07ab057be Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 13:34:13 -0400 Subject: [PATCH 02/50] Set compiler env vars --- .github/workflows/build-wheel.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index b2b63e8a0f..cb0816faed 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -40,6 +40,10 @@ jobs: runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} + env: + CC: "sccache cc" + CXX: "sccache c++" + steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 7f6c222b1092fb01af9e6a74e3307034e71cbb90 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 13:35:20 -0400 Subject: [PATCH 03/50] Add the other special envvar --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index cb0816faed..afb26e887e 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -41,6 +41,7 @@ jobs: (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} env: + SCCACHE_GHA_ENABLED: "true" CC: "sccache cc" CXX: "sccache c++" From 2d8d2c8370be2ae8567795649c40d9945684ee5d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 13:42:33 -0400 Subject: [PATCH 04/50] Try adding vars to cibuildwheel --- .github/workflows/build-wheel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index afb26e887e..b32f6a4ade 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -141,7 +141,8 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - + CC: sccache gcc + CXX: sccache g++ - name: List the cuda.bindings artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then From 577fa3d857e9503d12897b83ba5ae6b953c166a6 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 13:59:13 -0400 Subject: [PATCH 05/50] Try a different way to pass vars fo cibuildwheel --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index b32f6a4ade..a0ece76a26 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -138,11 +138,11 @@ jobs: CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CC=/host$(which sccache) cc + CXX=/host$(which sccache) c++ CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - CC: sccache gcc - CXX: sccache g++ - name: List the cuda.bindings artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then From 5605da0b2e104025270e729896a108f3c9fd6d9d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 14:05:15 -0400 Subject: [PATCH 06/50] Try another approach --- .github/workflows/build-wheel.yml | 6 ++---- ci/tools/env-vars | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index a0ece76a26..8cf6bf5f9d 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -42,8 +42,6 @@ jobs: (inputs.host-platform == 'win-64' && 'windows-2022') }} env: SCCACHE_GHA_ENABLED: "true" - CC: "sccache cc" - CXX: "sccache c++" steps: - name: Checkout ${{ github.event.repository.name }} @@ -138,8 +136,8 @@ jobs: CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - CC=/host$(which sccache) cc - CXX=/host$(which sccache) c++ + CC="/host${{ env.SCCACHE_PATH }} cc" + CXX="/host${{ env.SCCACHE_PATH }} c++" CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} diff --git a/ci/tools/env-vars b/ci/tools/env-vars index f7db5179d6..185f44e1cd 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -86,3 +86,5 @@ fi echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" } >> $GITHUB_ENV + +echo "SCCACHE_PATH=$(which sccache)" From 41f1359bbd703d9fc9e420bbf61528f74a07e0a9 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 14:17:00 -0400 Subject: [PATCH 07/50] Adjust SCCACHE_DIR inside the container --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 8cf6bf5f9d..eb3fae7f95 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -138,6 +138,7 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" + SCCACHE_DIR=/host${{ env.SCCACHE_DIR }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From 4d3b284290016cad2cc5d92a1c4dd870a92cd512 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 14:32:16 -0400 Subject: [PATCH 08/50] Specify a cache dir --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index eb3fae7f95..428d50e68b 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -42,6 +42,7 @@ jobs: (inputs.host-platform == 'win-64' && 'windows-2022') }} env: SCCACHE_GHA_ENABLED: "true" + SCCACHE_DIR: ${{ github.workspace }}/.sccache steps: - name: Checkout ${{ github.event.repository.name }} From 5b15052e9aa6d44f09cdbf00852efbf2eee8e8d2 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 14:46:47 -0400 Subject: [PATCH 09/50] Try something different --- .github/workflows/build-wheel.yml | 5 ++++- ci/tools/env-vars | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 428d50e68b..bbae46fc13 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -42,7 +42,6 @@ jobs: (inputs.host-platform == 'win-64' && 'windows-2022') }} env: SCCACHE_GHA_ENABLED: "true" - SCCACHE_DIR: ${{ github.workspace }}/.sccache steps: - name: Checkout ${{ github.event.repository.name }} @@ -50,6 +49,10 @@ jobs: with: fetch-depth: 0 + - name: Setup SCCACHE_DIR + run: | + echo "SCCACHE_DIR=${{ github.workspace }}/.sccache" >> $GITHUB_ENV + - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 diff --git a/ci/tools/env-vars b/ci/tools/env-vars index 185f44e1cd..f7db5179d6 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -86,5 +86,3 @@ fi echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" } >> $GITHUB_ENV - -echo "SCCACHE_PATH=$(which sccache)" From a0e0603d3629485ac65cc72a1f0ec1e02e174e07 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 15:20:15 -0400 Subject: [PATCH 10/50] Remove explicit SCCACHE_DIR manipulation --- .github/workflows/build-wheel.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index bbae46fc13..5230f95f0f 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -49,10 +49,6 @@ jobs: with: fetch-depth: 0 - - name: Setup SCCACHE_DIR - run: | - echo "SCCACHE_DIR=${{ github.workspace }}/.sccache" >> $GITHUB_ENV - - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 @@ -142,10 +138,12 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" - SCCACHE_DIR=/host${{ env.SCCACHE_DIR }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CC="${{ env.SCCACHE_PATH }} cl" + CXX="${{ env.SCCACHE_PATH }} cl" + - name: List the cuda.bindings artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then From 303e91d4af1ef2121236255b46d207036d157e42 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 15:40:30 -0400 Subject: [PATCH 11/50] Add envvar --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 5230f95f0f..3d8b592b2c 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -138,6 +138,7 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" + SCCACHE_GHA_ENABLED=true CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From 4bb10e5461866ccc81a1377ff6b318075f6b168d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 15:56:44 -0400 Subject: [PATCH 12/50] Explicitly start the host --- .github/workflows/build-wheel.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 3d8b592b2c..4ea984e0e0 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -52,6 +52,11 @@ jobs: - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 + - name: Start sccache + # Since we actually /use/ this from a container, we need to start the server + # in the host first. + run: sccache --start-server + - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true From 8732bca296feb898f61fd1636a4b7a67ff7d4cb1 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:11:45 -0400 Subject: [PATCH 13/50] Pass along GHA cache url --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 4ea984e0e0..2face22414 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -144,6 +144,7 @@ jobs: CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From a542dc5adb6524f586d16dda000a43336bd33d32 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:18:36 -0400 Subject: [PATCH 14/50] Expose the necessary tokens --- .github/workflows/build-wheel.yml | 1 + ci/tools/env-vars | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 2face22414..b0e3ecb2cc 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -145,6 +145,7 @@ jobs: CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} diff --git a/ci/tools/env-vars b/ci/tools/env-vars index f7db5179d6..ff845238eb 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -85,4 +85,7 @@ fi echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${SHA}" echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" + + echo "ACTIONS_RUNTIME_TOKEN=${ACTIONS_RUNTIME_TOKEN}" + echo "ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL}" } >> $GITHUB_ENV From a032a0a5c4157f87236494b1dbf0a1dfc1fe381d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:26:17 -0400 Subject: [PATCH 15/50] Try a different approach --- .github/workflows/build-wheel.yml | 5 +++++ ci/tools/env-vars | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index b0e3ecb2cc..1e41e8a482 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -57,6 +57,11 @@ jobs: # in the host first. run: sccache --start-server + - name: Expose Cache URL + run: | + echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" >> $GITHUB_ENV + echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV + - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true diff --git a/ci/tools/env-vars b/ci/tools/env-vars index ff845238eb..f7db5179d6 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -85,7 +85,4 @@ fi echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${SHA}" echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/dist")" echo "CUDA_BINDINGS_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_bindings/tests/cython")" - - echo "ACTIONS_RUNTIME_TOKEN=${ACTIONS_RUNTIME_TOKEN}" - echo "ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL}" } >> $GITHUB_ENV From 3db7f806a2a5a8860e0442a7381bf5ce867e5ae4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:29:11 -0400 Subject: [PATCH 16/50] Is the token enough? --- .github/workflows/build-wheel.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 1e41e8a482..220c43e50a 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -59,7 +59,6 @@ jobs: - name: Expose Cache URL run: | - echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" >> $GITHUB_ENV echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV - name: Setup proxy cache @@ -149,7 +148,6 @@ jobs: CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true - ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" From d82486457c1ab9ed1aa64cc41cc45a58a5cc1c7d Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:34:12 -0400 Subject: [PATCH 17/50] Does this work? --- .github/workflows/build-wheel.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 220c43e50a..619b9bf897 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -148,7 +148,8 @@ jobs: CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true - ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN + ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From bec662466f202bdb053791dccc8f94e0ad5ab60a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:37:28 -0400 Subject: [PATCH 18/50] ACTIONS_RESULTS_URL --- .github/workflows/build-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 619b9bf897..e91a5ad44b 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -149,7 +149,7 @@ jobs: CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN - ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL + ACTIONS_RESULTS_URL=$ACTIONS_RESULTS_URL CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From eaf3f4a9a98b2d97ce7488a4439390557e29e613 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 17 Oct 2025 16:46:00 -0400 Subject: [PATCH 19/50] Get some debug --- .github/workflows/build-wheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index e91a5ad44b..2b1b760fb5 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -150,6 +150,8 @@ jobs: SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN ACTIONS_RESULTS_URL=$ACTIONS_RESULTS_URL + SCCACHE_LOG=debug + SCCACHE_NO_DAEMON=1 CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From b5b0af48267e9d5a89be0d31407c5cfdaba462a5 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sun, 19 Oct 2025 23:33:14 -0400 Subject: [PATCH 20/50] fix syntax --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 2b1b760fb5..c5174f5ddb 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -148,8 +148,8 @@ jobs: CC="/host${{ env.SCCACHE_PATH }} cc" CXX="/host${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true - ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN - ACTIONS_RESULTS_URL=$ACTIONS_RESULTS_URL + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 CIBW_ENVIRONMENT_WINDOWS: > From b608357bbca8f2dfc89b59b69db0ae22d0d81487 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sun, 19 Oct 2025 23:48:51 -0400 Subject: [PATCH 21/50] try to get accurate cache hit/miss rates --- .github/workflows/build-wheel.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index c5174f5ddb..9413213b73 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -141,6 +141,9 @@ jobs: output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} + # check cache stats before leaving cibuildwheel + CIBW_BEFORE_TEST: > + "/host${{ env.SCCACHE_PATH }}" --show-stats # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} From ee75abe31e90a304b1b46f1df543fe0503352a6b Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 00:08:51 -0400 Subject: [PATCH 22/50] debug --- .github/workflows/build-wheel.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 9413213b73..0f5b1b4b22 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -40,8 +40,8 @@ jobs: runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} - env: - SCCACHE_GHA_ENABLED: "true" +# env: +# SCCACHE_GHA_ENABLED: "true" steps: - name: Checkout ${{ github.event.repository.name }} @@ -52,14 +52,14 @@ jobs: - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 - - name: Start sccache - # Since we actually /use/ this from a container, we need to start the server - # in the host first. - run: sccache --start-server - - - name: Expose Cache URL - run: | - echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV +# - name: Start sccache +# # Since we actually /use/ this from a container, we need to start the server +# # in the host first. +# run: sccache --start-server +# +# - name: Expose Cache URL +# run: | +# echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main @@ -144,6 +144,9 @@ jobs: # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST: > "/host${{ env.SCCACHE_PATH }}" --show-stats + # force the test stage to be run (so that before-test is not skipped) + CIBW_TEST_COMMAND: > + echo "ok!" # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} @@ -160,6 +163,10 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CC="${{ env.SCCACHE_PATH }} cl" CXX="${{ env.SCCACHE_PATH }} cl" + SCCACHE_GHA_ENABLED=true + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + SCCACHE_LOG=debug - name: List the cuda.bindings artifacts directory run: | From f7a986f5688cb3a9ea88247ebec3ff939a444d6f Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 00:22:15 -0400 Subject: [PATCH 23/50] fix windows Reintroduced CIBW_BEFORE_TEST and CIBW_TEST_COMMAND for Linux and Windows. --- .github/workflows/build-wheel.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 0f5b1b4b22..c49279e2e6 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -141,12 +141,6 @@ jobs: output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} - # check cache stats before leaving cibuildwheel - CIBW_BEFORE_TEST: > - "/host${{ env.SCCACHE_PATH }}" --show-stats - # force the test stage to be run (so that before-test is not skipped) - CIBW_TEST_COMMAND: > - echo "ok!" # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} @@ -167,6 +161,16 @@ jobs: ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} SCCACHE_LOG=debug + # check cache stats before leaving cibuildwheel + CIBW_BEFORE_TEST_LINUX: > + "/host${{ env.SCCACHE_PATH }}" --show-stats + CIBW_BEFORE_TEST_WINDOWS: > + "${{ env.SCCACHE_PATH }}" --show-stats + # force the test stage to be run (so that before-test is not skipped) + # TODO: we might want to think twice on adding this, it does a lot of + # steps. + CIBW_TEST_COMMAND: > + echo "ok!" - name: List the cuda.bindings artifacts directory run: | From 9b0d0412b88426200a28dc8312edb37fa8ae55ef Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 09:27:32 -0400 Subject: [PATCH 24/50] Try to fix cache writing --- .github/workflows/build-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index c49279e2e6..357a8f1786 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -151,7 +151,7 @@ jobs: ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} SCCACHE_LOG=debug - SCCACHE_NO_DAEMON=1 +# SCCACHE_NO_DAEMON=1 CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} From 3ad8ea73d127d4201e5756052251381155ceca6a Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 10:07:05 -0400 Subject: [PATCH 25/50] restore SCCACHE_GHA_ENABLED --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 357a8f1786..e81e2acad6 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -40,8 +40,8 @@ jobs: runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} -# env: -# SCCACHE_GHA_ENABLED: "true" + env: + SCCACHE_GHA_ENABLED: "true" steps: - name: Checkout ${{ github.event.repository.name }} From e2ec4df37ce8fb3f719daf511660360331db9acd Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 10:18:19 -0400 Subject: [PATCH 26/50] set up env vars in build stage --- ci/tools/env-vars | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/tools/env-vars b/ci/tools/env-vars index f7db5179d6..bbc3ed66c5 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -45,6 +45,9 @@ if [[ "${1}" == "build" ]]; then echo "BUILD_CUDA_MAJOR=${BUILD_CUDA_MAJOR}" >> $GITHUB_ENV echo "BUILD_PREV_CUDA_MAJOR=$((${BUILD_CUDA_MAJOR} - 1))" >> $GITHUB_ENV CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${CUDA_VER}-${HOST_PLATFORM}" + # Enforce an explicit cache dir so that we can reuse this path later + echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=1G" >> $GITHUB_ENV elif [[ "${1}" == "test" ]]; then BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${BUILD_CUDA_VER})" TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})" From 319d289167eee2bb569bca1d93fd4d4f77556598 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 10:19:36 -0400 Subject: [PATCH 27/50] pass env vars to cibuildwheel --- .github/workflows/build-wheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index e81e2acad6..4d45e963d5 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -150,6 +150,8 @@ jobs: SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + SCCACHE_DIR=${{ env.SCCACHE_DIR }} + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug # SCCACHE_NO_DAEMON=1 CIBW_ENVIRONMENT_WINDOWS: > From dc19abe9b03464b09a50f364f40e232f1b425b85 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 10:20:29 -0400 Subject: [PATCH 28/50] fix --- .github/workflows/build-wheel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 4d45e963d5..a28ab7572f 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -145,12 +145,12 @@ jobs: CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - CC="/host${{ env.SCCACHE_PATH }} cc" - CXX="/host${{ env.SCCACHE_PATH }} c++" + CC="/host/${{ env.SCCACHE_PATH }} cc" + CXX="/host/${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} - SCCACHE_DIR=${{ env.SCCACHE_DIR }} + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug # SCCACHE_NO_DAEMON=1 From d0757eebeb57bb61051e0f7d3ee37ff261301b85 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 11:08:57 -0400 Subject: [PATCH 29/50] try this --- .github/workflows/build-wheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index a28ab7572f..d59d7f22c1 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -150,6 +150,7 @@ jobs: SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug From 4d315365d3255d1e9e389f4b4743812e29c6a222 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 11:20:48 -0400 Subject: [PATCH 30/50] try this --- .github/workflows/build-wheel.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d59d7f22c1..d2299269ab 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -49,6 +49,8 @@ jobs: with: fetch-depth: 0 + # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN + # are exposed by this action. - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 @@ -61,6 +63,16 @@ jobs: # run: | # echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV + # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 + - name: Adding addtional GHA cache-related env vars + uses: actions/github-script@v7 + env: + github-token: ${{ secrets.GITHUB_TOKEN }} + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) + core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL']) + - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true From 93b92b7ea5d9629f052c7fb1710b3009da3de5a7 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 11:42:29 -0400 Subject: [PATCH 31/50] start server on host and make container aware of the ports Uncommented sccache start server step and added container engine configuration. --- .github/workflows/build-wheel.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d2299269ab..5b701b6cac 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -54,14 +54,10 @@ jobs: - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 -# - name: Start sccache -# # Since we actually /use/ this from a container, we need to start the server -# # in the host first. -# run: sccache --start-server -# -# - name: Expose Cache URL -# run: | -# echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV + - name: Start sccache + # Since we actually /use/ this from a container, we need to start the server + # in the host first. + run: sccache --start-server # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding addtional GHA cache-related env vars @@ -153,6 +149,7 @@ jobs: output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_CONTAINER_ENGINE: "docker; create_args: --network=host" # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} From a56abde12c505a990b7d17b06301f03a6d7e22bc Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 21:36:39 +0000 Subject: [PATCH 32/50] Revert "start server on host and make container aware of the ports" This reverts commit 93b92b7ea5d9629f052c7fb1710b3009da3de5a7. --- .github/workflows/build-wheel.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 5b701b6cac..d2299269ab 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -54,10 +54,14 @@ jobs: - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 - - name: Start sccache - # Since we actually /use/ this from a container, we need to start the server - # in the host first. - run: sccache --start-server +# - name: Start sccache +# # Since we actually /use/ this from a container, we need to start the server +# # in the host first. +# run: sccache --start-server +# +# - name: Expose Cache URL +# run: | +# echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding addtional GHA cache-related env vars @@ -149,7 +153,6 @@ jobs: output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} - CIBW_CONTAINER_ENGINE: "docker; create_args: --network=host" # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} From cf6a47643f4c0776c2c429ce4148bd238b641953 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 20 Oct 2025 21:38:29 +0000 Subject: [PATCH 33/50] try local build approach with all env vars passed to container --- .github/workflows/build-wheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d2299269ab..1e690b6a20 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -161,8 +161,10 @@ jobs: CXX="/host/${{ env.SCCACHE_PATH }} c++" SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug From c10dc6054bda434313104252c191e4c0c9e9fa07 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Tue, 21 Oct 2025 16:10:55 +0000 Subject: [PATCH 34/50] clean up & apply sccache to cuda.core builds --- .github/workflows/build-wheel.yml | 54 +++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 1e690b6a20..726f7ea6fb 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -40,9 +40,6 @@ jobs: runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} - env: - SCCACHE_GHA_ENABLED: "true" - steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -54,20 +51,9 @@ jobs: - name: Enable sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 -# - name: Start sccache -# # Since we actually /use/ this from a container, we need to start the server -# # in the host first. -# run: sccache --start-server -# -# - name: Expose Cache URL -# run: | -# echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_RUNTIME_TOKEN" >> $GITHUB_ENV - # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding addtional GHA cache-related env vars uses: actions/github-script@v7 - env: - github-token: ${{ secrets.GITHUB_TOKEN }} with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) @@ -167,8 +153,6 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} - SCCACHE_LOG=debug -# SCCACHE_NO_DAEMON=1 CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} @@ -185,7 +169,7 @@ jobs: "${{ env.SCCACHE_PATH }}" --show-stats # force the test stage to be run (so that before-test is not skipped) # TODO: we might want to think twice on adding this, it does a lot of - # steps. + # things before reaching this command. CIBW_TEST_COMMAND: > echo "ok!" @@ -223,11 +207,29 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }} PIP_FIND_LINKS=/host/${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + CC="/host/${{ env.SCCACHE_PATH }} cc" + CXX="/host/${{ env.SCCACHE_PATH }} c++" + SCCACHE_GHA_ENABLED=true + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }} PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})" + # check cache stats before leaving cibuildwheel + CIBW_BEFORE_TEST_LINUX: > + "/host${{ env.SCCACHE_PATH }}" --show-stats + # force the test stage to be run (so that before-test is not skipped) + # TODO: we might want to think twice on adding this, it does a lot of + # things before reaching this command. + CIBW_TEST_COMMAND: > + echo "ok!" - name: List the cuda.core artifacts directory and rename run: | @@ -388,11 +390,29 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }} PIP_FIND_LINKS=/host/${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + CC="/host/${{ env.SCCACHE_PATH }} cc" + CXX="/host/${{ env.SCCACHE_PATH }} c++" + SCCACHE_GHA_ENABLED=true + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} + ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }} PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})" + # check cache stats before leaving cibuildwheel + CIBW_BEFORE_TEST_LINUX: > + "/host${{ env.SCCACHE_PATH }}" --show-stats + # force the test stage to be run (so that before-test is not skipped) + # TODO: we might want to think twice on adding this, it does a lot of + # things before reaching this command. + CIBW_TEST_COMMAND: > + echo "ok!" - name: List the cuda.core artifacts directory and rename run: | From 3ad2235d7706de1f684e2d3a11e6532acc4734c4 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 21:28:36 -0400 Subject: [PATCH 35/50] Add steps to find cl.exe and generate wrapper script --- .github/workflows/build-wheel.yml | 33 +++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 726f7ea6fb..b57e460c33 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -77,6 +77,32 @@ jobs: if: ${{ startsWith(inputs.host-platform, 'win') }} uses: ilammy/msvc-dev-cmd@v1 # TODO: ask admin to allow pinning commits + # at this point, cl.exe already exists in PATH + - name: Find cl.exe and set CL_EXE environment variable + if: ${{ startsWith(inputs.host-platform, 'win') }} + run: | + # Find the full path of cl.exe + CL_EXE=$(which cl.exe) + if [ -z "${CL_EXE}" ]; then + echo "Error: cl.exe not found in PATH" + exit 1 + fi + echo "Found cl.exe at: ${CL_EXE}" + echo "CL_EXE=${CL_EXE}" >> $GITHUB_ENV + + - name: Generate sccache wrapper script + if: ${{ startsWith(inputs.host-platform, 'win') }} + run: | + # Create a wrapper directory + mkdir -p sccache_wrapper + # Generate the wrapper script named cl.exe + cat > sccache_wrapper/cl.exe <<'EOF' + @echo off + sccache "%CL_EXE%" %* + EOF + # Prepend the wrapper directory to PATH + echo "$(cygpath -w $(pwd)/sccache_wrapper)" >> $GITHUB_PATH + - name: Set environment variables env: CUDA_VER: ${{ inputs.cuda-version }} @@ -156,11 +182,14 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - CC="${{ env.SCCACHE_PATH }} cl" - CXX="${{ env.SCCACHE_PATH }} cl" SCCACHE_GHA_ENABLED=true ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} + SCCACHE_DIR=${{ env.SCCACHE_DIR }} + SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > From d5243c1ba0ed01090c6edda8619c1c2bfc1e7ba5 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 21:39:38 -0400 Subject: [PATCH 36/50] fix --- .github/workflows/build-wheel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index afbb137252..50892ea008 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -81,7 +81,7 @@ jobs: if: ${{ startsWith(inputs.host-platform, 'win') }} run: | # Find the full path of cl.exe - CL_EXE=$(which cl.exe) + CL_EXE=$(cygpath -w $(which cl.exe)) if [ -z "${CL_EXE}" ]; then echo "Error: cl.exe not found in PATH" exit 1 @@ -99,6 +99,7 @@ jobs: @echo off sccache "%CL_EXE%" %* EOF + cat sccache_wrapper/cl.exe # Prepend the wrapper directory to PATH echo "$(cygpath -w $(pwd)/sccache_wrapper)" >> $GITHUB_PATH @@ -189,6 +190,7 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} + CL_EXE=${{ env.CL_EXE }} SCCACHE_LOG=debug # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > From 20e0ce3c606001ab71ec56f540f373d49320d4dd Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 21:45:27 -0400 Subject: [PATCH 37/50] defer format normalization --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 50892ea008..53f0d0eea8 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -81,13 +81,13 @@ jobs: if: ${{ startsWith(inputs.host-platform, 'win') }} run: | # Find the full path of cl.exe - CL_EXE=$(cygpath -w $(which cl.exe)) + CL_EXE=$(which cl.exe) if [ -z "${CL_EXE}" ]; then echo "Error: cl.exe not found in PATH" exit 1 fi echo "Found cl.exe at: ${CL_EXE}" - echo "CL_EXE=${CL_EXE}" >> $GITHUB_ENV + echo "CL_EXE=$(cygpath -w ${CL_EXE})" >> $GITHUB_ENV - name: Generate sccache wrapper script if: ${{ startsWith(inputs.host-platform, 'win') }} From ce6c03d90054ceff71b8d6ddc2fe74dc434ae146 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 21:50:51 -0400 Subject: [PATCH 38/50] debug --- .github/workflows/build-wheel.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 53f0d0eea8..f54d86f41d 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -86,8 +86,11 @@ jobs: echo "Error: cl.exe not found in PATH" exit 1 fi + function normpath() { + echo "$(echo $(cygpath -w $1) | sed 's/\\/\\\\/g')" + } echo "Found cl.exe at: ${CL_EXE}" - echo "CL_EXE=$(cygpath -w ${CL_EXE})" >> $GITHUB_ENV + echo "CL_EXE=$(normpath ${CL_EXE})" >> $GITHUB_ENV - name: Generate sccache wrapper script if: ${{ startsWith(inputs.host-platform, 'win') }} @@ -101,7 +104,7 @@ jobs: EOF cat sccache_wrapper/cl.exe # Prepend the wrapper directory to PATH - echo "$(cygpath -w $(pwd)/sccache_wrapper)" >> $GITHUB_PATH + echo "$(normpath $(pwd)/sccache_wrapper)" >> $GITHUB_PATH - name: Set environment variables env: From 814fb8232bf697e744d5c7d65df163500c6ab352 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 21:55:45 -0400 Subject: [PATCH 39/50] debug --- .github/workflows/build-wheel.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index f54d86f41d..f1139f1c60 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -87,7 +87,7 @@ jobs: exit 1 fi function normpath() { - echo "$(echo $(cygpath -w $1) | sed 's/\\/\\\\/g')" + echo "$(echo $(cygpath -w "$1") | sed 's/\\/\\\\/g')" } echo "Found cl.exe at: ${CL_EXE}" echo "CL_EXE=$(normpath ${CL_EXE})" >> $GITHUB_ENV @@ -103,6 +103,9 @@ jobs: sccache "%CL_EXE%" %* EOF cat sccache_wrapper/cl.exe + function normpath() { + echo "$(echo $(cygpath -w "$1") | sed 's/\\/\\\\/g')" + } # Prepend the wrapper directory to PATH echo "$(normpath $(pwd)/sccache_wrapper)" >> $GITHUB_PATH From b9cc2b3a6a39411f49b73fc36e86cf5e5810707f Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 22:11:54 -0400 Subject: [PATCH 40/50] debug --- .github/workflows/build-wheel.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index f1139f1c60..47ed96b6f8 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -86,11 +86,8 @@ jobs: echo "Error: cl.exe not found in PATH" exit 1 fi - function normpath() { - echo "$(echo $(cygpath -w "$1") | sed 's/\\/\\\\/g')" - } echo "Found cl.exe at: ${CL_EXE}" - echo "CL_EXE=$(normpath ${CL_EXE})" >> $GITHUB_ENV + echo "CL_EXE=$(cygpath -w $(realpath "${CL_EXE}"))" >> $GITHUB_ENV - name: Generate sccache wrapper script if: ${{ startsWith(inputs.host-platform, 'win') }} @@ -103,11 +100,8 @@ jobs: sccache "%CL_EXE%" %* EOF cat sccache_wrapper/cl.exe - function normpath() { - echo "$(echo $(cygpath -w "$1") | sed 's/\\/\\\\/g')" - } # Prepend the wrapper directory to PATH - echo "$(normpath $(pwd)/sccache_wrapper)" >> $GITHUB_PATH + echo "$(cygpath -w $(realpath "$(pwd)/sccache_wrapper"))" >> $GITHUB_PATH - name: Set environment variables env: From d1d804f0935afce70fcd87b963a79b9233f2b6d8 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 22:26:10 -0400 Subject: [PATCH 41/50] debug --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 47ed96b6f8..2f0d746287 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -87,7 +87,7 @@ jobs: exit 1 fi echo "Found cl.exe at: ${CL_EXE}" - echo "CL_EXE=$(cygpath -w $(realpath "${CL_EXE}"))" >> $GITHUB_ENV + echo "CL_EXE=$(cygpath -w "${CL_EXE}")" >> $GITHUB_ENV - name: Generate sccache wrapper script if: ${{ startsWith(inputs.host-platform, 'win') }} @@ -101,7 +101,7 @@ jobs: EOF cat sccache_wrapper/cl.exe # Prepend the wrapper directory to PATH - echo "$(cygpath -w $(realpath "$(pwd)/sccache_wrapper"))" >> $GITHUB_PATH + echo "$(cygpath -w "$(pwd)/sccache_wrapper")" >> $GITHUB_PATH - name: Set environment variables env: From 7de169be0ad095c5432d78f587b472fac98d9927 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 22:34:53 -0400 Subject: [PATCH 42/50] debug --- .github/workflows/build-wheel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 2f0d746287..379fbde6fa 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -101,7 +101,7 @@ jobs: EOF cat sccache_wrapper/cl.exe # Prepend the wrapper directory to PATH - echo "$(cygpath -w "$(pwd)/sccache_wrapper")" >> $GITHUB_PATH + echo "$(realpath "./sccache_wrapper")" >> $GITHUB_PATH - name: Set environment variables env: @@ -190,7 +190,7 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} - CL_EXE=${{ env.CL_EXE }} + CL_EXE="${{ env.CL_EXE }}" SCCACHE_LOG=debug # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > From 541a9b24712730f0e3a494443c56ef8321fd6a5c Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 22:49:08 -0400 Subject: [PATCH 43/50] debug --- .github/workflows/build-wheel.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 379fbde6fa..9d29054435 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -100,8 +100,8 @@ jobs: sccache "%CL_EXE%" %* EOF cat sccache_wrapper/cl.exe - # Prepend the wrapper directory to PATH - echo "$(realpath "./sccache_wrapper")" >> $GITHUB_PATH + # Record the wrapper path for later use + echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV - name: Set environment variables env: @@ -190,6 +190,7 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} + PATH="$(cygpath -w ${{ env.SCCACHE_WRAPPER_DIR }});$PATH" CL_EXE="${{ env.CL_EXE }}" SCCACHE_LOG=debug # check cache stats before leaving cibuildwheel From 098feebffb52dab4b8b52c83492d101049fb437f Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:02:53 -0400 Subject: [PATCH 44/50] debug --- .github/workflows/build-wheel.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 9d29054435..72711972ca 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -190,9 +190,12 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} - PATH="$(cygpath -w ${{ env.SCCACHE_WRAPPER_DIR }});$PATH" + PATH="$(cygpath -w "${{ env.SCCACHE_WRAPPER_DIR }}");$PATH" CL_EXE="${{ env.CL_EXE }}" SCCACHE_LOG=debug + CIBW_BEFORE_ALL_WINDOWS: > + echo $PATH + echo $(which cl.exe) # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > "/host${{ env.SCCACHE_PATH }}" --show-stats From 8f6f008f5365ca2db2e28b4b31df313eaf61dd65 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:13:27 -0400 Subject: [PATCH 45/50] debug --- .github/workflows/build-wheel.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 72711972ca..04425267fd 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -194,11 +194,10 @@ jobs: CL_EXE="${{ env.CL_EXE }}" SCCACHE_LOG=debug CIBW_BEFORE_ALL_WINDOWS: > - echo $PATH - echo $(which cl.exe) + echo %PATH% # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > - "/host${{ env.SCCACHE_PATH }}" --show-stats + "/host/${{ env.SCCACHE_PATH }}" --show-stats CIBW_BEFORE_TEST_WINDOWS: > "${{ env.SCCACHE_PATH }}" --show-stats # force the test stage to be run (so that before-test is not skipped) From 65beac0413297c5532aea652472a105e83e20cee Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:22:38 -0400 Subject: [PATCH 46/50] use big gun --- .github/workflows/build-wheel.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 04425267fd..3a91bdf896 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -89,19 +89,24 @@ jobs: echo "Found cl.exe at: ${CL_EXE}" echo "CL_EXE=$(cygpath -w "${CL_EXE}")" >> $GITHUB_ENV - - name: Generate sccache wrapper script + #- name: Generate sccache wrapper script + # if: ${{ startsWith(inputs.host-platform, 'win') }} + # run: | + # # Create a wrapper directory + # mkdir -p sccache_wrapper + # # Generate the wrapper script named cl.exe + # cat > sccache_wrapper/cl.exe <<'EOF' + # @echo off + # sccache "%CL_EXE%" %* + # EOF + # cat sccache_wrapper/cl.exe + # # Record the wrapper path for later use + # echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV + + - name: Replace cl.exe by sccache.exe if: ${{ startsWith(inputs.host-platform, 'win') }} run: | - # Create a wrapper directory - mkdir -p sccache_wrapper - # Generate the wrapper script named cl.exe - cat > sccache_wrapper/cl.exe <<'EOF' - @echo off - sccache "%CL_EXE%" %* - EOF - cat sccache_wrapper/cl.exe - # Record the wrapper path for later use - echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV + cp "${{ env.SCCACHE_PATH }}" "{{ env.CL_EXE }}" - name: Set environment variables env: @@ -190,9 +195,9 @@ jobs: ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} SCCACHE_DIR=${{ env.SCCACHE_DIR }} SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} - PATH="$(cygpath -w "${{ env.SCCACHE_WRAPPER_DIR }}");$PATH" - CL_EXE="${{ env.CL_EXE }}" SCCACHE_LOG=debug + #CL_EXE="${{ env.CL_EXE }}" + #PATH="$(cygpath -w "${{ env.SCCACHE_WRAPPER_DIR }}");$PATH" CIBW_BEFORE_ALL_WINDOWS: > echo %PATH% # check cache stats before leaving cibuildwheel From 7cac30df6d991ed122bcd390848e363a35426e90 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:25:54 -0400 Subject: [PATCH 47/50] fix --- .github/workflows/build-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 3a91bdf896..5a5c0fdccc 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -106,7 +106,7 @@ jobs: - name: Replace cl.exe by sccache.exe if: ${{ startsWith(inputs.host-platform, 'win') }} run: | - cp "${{ env.SCCACHE_PATH }}" "{{ env.CL_EXE }}" + cp "${{ env.SCCACHE_PATH }}" "${{ env.CL_EXE }}" - name: Set environment variables env: From 6be8df7e6272d7817bc888c5964bd842f866c131 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:36:39 -0400 Subject: [PATCH 48/50] debug --- .github/workflows/build-wheel.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 5a5c0fdccc..92c4ead6d4 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -106,7 +106,10 @@ jobs: - name: Replace cl.exe by sccache.exe if: ${{ startsWith(inputs.host-platform, 'win') }} run: | + ls -lt "${{ env.CL_EXE }}" cp "${{ env.SCCACHE_PATH }}" "${{ env.CL_EXE }}" + ls -lt "${{ env.CL_EXE }}" + "${{ env.SCCACHE_PATH }}" --start-server - name: Set environment variables env: From 1eb6a1b03c78c51f50dc95b7ba900bfeed26d5cc Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Wed, 22 Oct 2025 23:53:54 -0400 Subject: [PATCH 49/50] fix sccache dir --- .github/workflows/build-wheel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 92c4ead6d4..47f8a12c11 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -196,7 +196,7 @@ jobs: ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} - SCCACHE_DIR=${{ env.SCCACHE_DIR }} + SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})" SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} SCCACHE_LOG=debug #CL_EXE="${{ env.CL_EXE }}" From 6cfe70dd4e1b2714c53b235c8d1e8b22efea8b91 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 23 Oct 2025 11:30:37 -0400 Subject: [PATCH 50/50] Remove windows experimentations --- .github/workflows/build-wheel.yml | 50 ------------------------------- 1 file changed, 50 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 47f8a12c11..57a8581f15 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -76,41 +76,6 @@ jobs: if: ${{ startsWith(inputs.host-platform, 'win') }} uses: ilammy/msvc-dev-cmd@v1 # TODO: ask admin to allow pinning commits - # at this point, cl.exe already exists in PATH - - name: Find cl.exe and set CL_EXE environment variable - if: ${{ startsWith(inputs.host-platform, 'win') }} - run: | - # Find the full path of cl.exe - CL_EXE=$(which cl.exe) - if [ -z "${CL_EXE}" ]; then - echo "Error: cl.exe not found in PATH" - exit 1 - fi - echo "Found cl.exe at: ${CL_EXE}" - echo "CL_EXE=$(cygpath -w "${CL_EXE}")" >> $GITHUB_ENV - - #- name: Generate sccache wrapper script - # if: ${{ startsWith(inputs.host-platform, 'win') }} - # run: | - # # Create a wrapper directory - # mkdir -p sccache_wrapper - # # Generate the wrapper script named cl.exe - # cat > sccache_wrapper/cl.exe <<'EOF' - # @echo off - # sccache "%CL_EXE%" %* - # EOF - # cat sccache_wrapper/cl.exe - # # Record the wrapper path for later use - # echo "SCCACHE_WRAPPER_DIR=$(realpath "./sccache_wrapper")" >> $GITHUB_ENV - - - name: Replace cl.exe by sccache.exe - if: ${{ startsWith(inputs.host-platform, 'win') }} - run: | - ls -lt "${{ env.CL_EXE }}" - cp "${{ env.SCCACHE_PATH }}" "${{ env.CL_EXE }}" - ls -lt "${{ env.CL_EXE }}" - "${{ env.SCCACHE_PATH }}" --start-server - - name: Set environment variables env: CUDA_VER: ${{ inputs.cuda-version }} @@ -190,24 +155,9 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: > CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} - SCCACHE_GHA_ENABLED=true - ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} - ACTIONS_RUNTIME_URL=${{ env.ACTIONS_RUNTIME_URL }} - ACTIONS_RESULTS_URL=${{ env.ACTIONS_RESULTS_URL }} - ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} - ACTIONS_CACHE_SERVICE_V2=${{ env.ACTIONS_CACHE_SERVICE_V2 }} - SCCACHE_DIR="$(cygpath -w ${{ env.SCCACHE_DIR }})" - SCCACHE_CACHE_SIZE=${{ env.SCCACHE_CACHE_SIZE }} - SCCACHE_LOG=debug - #CL_EXE="${{ env.CL_EXE }}" - #PATH="$(cygpath -w "${{ env.SCCACHE_WRAPPER_DIR }}");$PATH" - CIBW_BEFORE_ALL_WINDOWS: > - echo %PATH% # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > "/host/${{ env.SCCACHE_PATH }}" --show-stats - CIBW_BEFORE_TEST_WINDOWS: > - "${{ env.SCCACHE_PATH }}" --show-stats # force the test stage to be run (so that before-test is not skipped) # TODO: we might want to think twice on adding this, it does a lot of # things before reaching this command.