Skip to content

Commit 4e84e1f

Browse files
committed
ci : add nvcc compilation cache to windows-cublas
This commit adds a directory to store the cuda compilation cache and also caches this directory in github actions. The motivation is to reduce the compilation time of the CUDA code. The ccache should still help with the host part of the compilation but it did not help with the CUDA code. This also addes the --parallel (-j) flag to the cmake build command to use all the available cores.
1 parent 940f6e8 commit 4e84e1f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,20 @@ jobs:
597597
variant: sccache
598598
evict-old-files: 1d
599599

600+
- name: Configure CUDA compilation cache
601+
run: |
602+
New-Item -Path "${{ github.workspace }}/cuda_cache" -ItemType Directory -Force
603+
echo "CUDA_CACHE_PATH=${{ github.workspace }}/cuda_cache" | Out-File -FilePath $env:GITHUB_ENV -Append
604+
echo "CUDA_CACHE_MAXSIZE=4294967296" | Out-File -FilePath $env:GITHUB_ENV -Append
605+
606+
- name: Cache CUDA compilation results
607+
uses: actions/cache@v3
608+
with:
609+
path: ${{ github.workspace }}/cuda_cache
610+
key: cuda-cache-${{ runner.os }}-${{ matrix.cuda-toolkit }}-${{ hashFiles('**/*.cu', '**/*.cuh') }}
611+
restore-keys: |
612+
cuda-cache-${{ runner.os }}-${{ matrix.cuda-toolkit }}-
613+
600614
- name: Add msbuild to PATH
601615
uses: microsoft/setup-msbuild@v2
602616

@@ -631,7 +645,7 @@ jobs:
631645
shell: cmd
632646
run: |
633647
cd ./build
634-
cmake --build . --config ${{ matrix.build }}
648+
cmake --build . --config ${{ matrix.build }} -j %NUMBER_OF_PROCESSORS%
635649
636650
- name: Copy CUDA DLLs
637651
run: |

0 commit comments

Comments
 (0)