@@ -77,15 +77,15 @@ runs:
7777 path : ${{ steps.llvm-cache.outputs.path }}
7878 dest : ${{ steps.llvm-cache.outputs.dest }}
7979
80- - name : Prepare Triton cache
80+ - name : Prepare Triton cache for nvidia deps
8181 shell : bash
8282 run : |
8383 mkdir -p ~/.triton
8484 TRITON_CACHE_KEY="$(sha256sum setup.py | cut -d\ -f1)"
8585 echo "TRITON_CACHE_KEY=$TRITON_CACHE_KEY" | tee -a $GITHUB_ENV
8686
87- - name : Load Triton cache
88- id : triton-cache
87+ - name : Load nvidia deps from Triton cache
88+ id : triton-cache-nvidia
8989 uses : ./.github/actions/load
9090 env :
9191 # Increase this value to reset cache
@@ -94,15 +94,41 @@ runs:
9494 path : $HOME/.triton/nvidia
9595 key : triton-nvidia-${{ env.TRITON_CACHE_KEY }}-${{ env.CACHE_NUMBER }}
9696
97+ - name : Prepare Triton cache for llvm
98+ if : inputs.build_llvm == 'false'
99+ shell : bash
100+ run : |
101+ LLVM_HASH="$(<cmake/llvm-hash.txt)"
102+ TRITON_LLVM_CACHE_KEY=$(echo $LLVM_HASH ${{ hashFiles('setup.py') }} | sha256sum - | cut -d\ -f1)
103+ echo "TRITON_LLVM_CACHE_KEY=$TRITON_LLVM_CACHE_KEY" | tee -a $GITHUB_ENV
104+
105+ - name : Load llvm from Triton cache
106+ if : inputs.build_llvm == 'false'
107+ id : triton-cache-llvm
108+ uses : ./.github/actions/load
109+ env :
110+ # Increase this value to reset cache
111+ CACHE_NUMBER : 1
112+ with :
113+ path : $HOME/.triton/llvm
114+ key : triton-llvm-${{ env.TRITON_LLVM_CACHE_KEY }}-${{ env.CACHE_NUMBER }}
115+
97116 - name : Build Triton
98117 shell : bash
99118 run : |
100119 pip install -r python/requirements.txt
101120 ${{ inputs.command }}
102121
103- - name : Save Triton cache
104- if : steps.triton-cache.outputs.status == 'miss'
122+ - name : Save nvidia deps in Triton cache
123+ if : steps.triton-cache-nvidia.outputs.status == 'miss'
124+ uses : ./.github/actions/save
125+ with :
126+ path : ${{ steps.triton-cache-nvidia.outputs.path }}
127+ dest : ${{ steps.triton-cache-nvidia.outputs.dest }}
128+
129+ - name : Save llvm in Triton cache
130+ if : steps.triton-cache-llvm.outputs.status == 'miss' && inputs.build_llvm == 'false'
105131 uses : ./.github/actions/save
106132 with :
107- path : ${{ steps.triton-cache.outputs.path }}
108- dest : ${{ steps.triton-cache.outputs.dest }}
133+ path : ${{ steps.triton-cache-llvm .outputs.path }}
134+ dest : ${{ steps.triton-cache-llvm .outputs.dest }}
0 commit comments