From 6edb2c8731128908e9e0d53610e00b3c330c7a5b Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 31 Jan 2025 12:48:24 +0000 Subject: [PATCH 1/4] Try sccache on ci for windows --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c02dd6a81588b..cc227fcfa02cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -688,6 +688,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: windows-msys2 evict-old-files: 1d @@ -762,6 +763,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: windows-latest-cmake-${{ matrix.build }} evict-old-files: 1d @@ -948,6 +950,7 @@ jobs: - name: Install ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: ${{ github.job }}-${{ matrix.cuda }}-${{ matrix.build }} evict-old-files: 1d @@ -1089,6 +1092,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: windows-latest-cmake-sycl evict-old-files: 1d @@ -1173,6 +1177,7 @@ jobs: - name: Install ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: ${{ github.job }} evict-old-files: 1d @@ -1207,6 +1212,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: + variant: sccache key: windows-latest-cmake-hip-release evict-old-files: 1d From fba6cb6ed17e36375052b5ffeb20216739acec0f Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 31 Jan 2025 13:09:40 +0000 Subject: [PATCH 2/4] shuffle ccache vars --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc227fcfa02cd..022b9bd031a14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -688,8 +688,8 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: windows-msys2 + variant: sccache evict-old-files: 1d - name: Setup ${{ matrix.sys }} @@ -763,8 +763,8 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: windows-latest-cmake-${{ matrix.build }} + variant: sccache evict-old-files: 1d - name: Clone Kompute submodule @@ -950,8 +950,8 @@ jobs: - name: Install ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: ${{ github.job }}-${{ matrix.cuda }}-${{ matrix.build }} + variant: sccache evict-old-files: 1d - name: Install Cuda Toolkit 11.7 @@ -1092,8 +1092,8 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: windows-latest-cmake-sycl + variant: sccache evict-old-files: 1d - name: Install @@ -1177,8 +1177,8 @@ jobs: - name: Install ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: ${{ github.job }} + variant: sccache evict-old-files: 1d - name: Build @@ -1212,8 +1212,8 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2.16 with: - variant: sccache key: windows-latest-cmake-hip-release + variant: sccache evict-old-files: 1d - name: Install From 4156384967ee19ece5e1f7408d7018295309a531 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 31 Jan 2025 13:21:25 +0000 Subject: [PATCH 3/4] Detect sccache in cmake --- ggml/src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index 5667091352173..b65a1a1628d27 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -93,12 +93,14 @@ endif() if (GGML_CCACHE) find_program(GGML_CCACHE_FOUND ccache) + find_program(GGML_SCCACHE_FOUND sccache) - if (GGML_CCACHE_FOUND) + if (GGML_CCACHE_FOUND OR GGML_SCCACHE_FOUND) + set(GGML_CCACHE_VARIANT $,ccache,sccache>) # TODO: should not be set globally - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${GGML_CCACHE_VARIANT}) set(ENV{CCACHE_SLOPPINESS} time_macros) - message(STATUS "ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.") + message(STATUS "${GGML_CCACHE_VARIANT} found, compilation results will be cached. Disable with GGML_CCACHE=OFF.") else() message(STATUS "Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF") endif () From e6c6ee385f4af20fd15c37e3f0094aa69a2b54c6 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 31 Jan 2025 13:57:22 +0000 Subject: [PATCH 4/4] Update CMakeLists.txt --- ggml/src/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index b65a1a1628d27..0002ac18a3378 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -96,9 +96,13 @@ if (GGML_CCACHE) find_program(GGML_SCCACHE_FOUND sccache) if (GGML_CCACHE_FOUND OR GGML_SCCACHE_FOUND) - set(GGML_CCACHE_VARIANT $,ccache,sccache>) + if(GGML_CCACHE_FOUND) + set(GGML_CCACHE_VARIANT ccache) + else() + set(GGML_CCACHE_VARIANT sccache) + endif() # TODO: should not be set globally - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${GGML_CCACHE_VARIANT}) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${GGML_CCACHE_VARIANT}") set(ENV{CCACHE_SLOPPINESS} time_macros) message(STATUS "${GGML_CCACHE_VARIANT} found, compilation results will be cached. Disable with GGML_CCACHE=OFF.") else()