File tree Expand file tree Collapse file tree
scripts/ci/build/pytorch_runtime/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# --packages "flash-attn:2.8.3,transformer-engine-torch:2.12.0"
77#
88# Exit code: 0 if all wheels found, 1 if any cache miss.
9- # Cache key: s3://<bucket>/wheels/<cuda>/<pkg_underscore>/<wheel_filename>
9+ # Cache key: s3://<bucket>/wheels/<cuda_short>/<pkg_underscore>/<wheel_filename>
10+ # Example: s3://dlc-cicd-wheels/wheels/cu130/flash_attn/flash_attn-2.8.3-cp312-cp312-linux_x86_64.whl
1011
1112set -euo pipefail
1213
@@ -33,6 +34,11 @@ if [[ -z "$BUCKET" ]]; then
3334 exit 1
3435fi
3536
37+ # Derive short CUDA string: 13.0.2 → cu130
38+ CUDA_MAJOR=$( echo " $CUDA " | cut -d. -f1)
39+ CUDA_MINOR=$( echo " $CUDA " | cut -d. -f2)
40+ CUDA_SHORT=" cu${CUDA_MAJOR}${CUDA_MINOR} "
41+
3642mkdir -p " ${DEST_DIR} "
3743
3844ALL_HIT=true
@@ -42,9 +48,9 @@ for spec in "${SPECS[@]}"; do
4248 PKG=" ${spec%%:* } "
4349 VER=" ${spec##*: } "
4450 PKG_UNDER=" ${PKG// -/ _} "
45- PREFIX=" wheels/${CUDA } /${PKG_UNDER} /"
51+ PREFIX=" wheels/${CUDA_SHORT } /${PKG_UNDER} /"
4652
47- echo " Looking for ${PKG} ==${VER} (${CUDA } ) in s3://${BUCKET} /${PREFIX} ..."
53+ echo " Looking for ${PKG} ==${VER} (${CUDA_SHORT } ) in s3://${BUCKET} /${PREFIX} ..."
4854 aws s3 cp " s3://${BUCKET} /${PREFIX} " " ${DEST_DIR} /" --recursive --exclude " *" --include " *.whl" 2> /dev/null || true
4955 if ls " ${DEST_DIR} " /${PKG_UNDER} * .whl > /dev/null 2>&1 ; then
5056 echo " Cache hit: ${PKG} ==${VER} "
Original file line number Diff line number Diff line change 2929[[ -n " $IMAGE " ]] || { echo " ERROR: --image-uri is required" >&2 ; exit 1; }
3030[[ -n " $DOCKERFILE " ]] || { echo " ERROR: --dockerfile is required" >&2 ; exit 1; }
3131
32+ # Derive short CUDA string: 13.0.2 → cu130
33+ CUDA_MAJOR=$( echo " $CUDA " | cut -d. -f1)
34+ CUDA_MINOR=$( echo " $CUDA " | cut -d. -f2)
35+ CUDA_SHORT=" cu${CUDA_MAJOR}${CUDA_MINOR} "
36+
3237EXPORT_DIR=$( mktemp -d)
3338
3439docker buildx build --progress=plain --target wheel-export --output " type=local,dest=${EXPORT_DIR} " \
@@ -52,7 +57,7 @@ for spec in "${SPECS[@]}"; do
5257 fi
5358
5459 FNAME=$( basename " ${WHL} " )
55- S3_KEY=" wheels/${CUDA } /${PKG_UNDER} /${FNAME} "
60+ S3_KEY=" wheels/${CUDA_SHORT } /${PKG_UNDER} /${FNAME} "
5661
5762 if aws s3 ls " s3://${BUCKET} /${S3_KEY} " & > /dev/null; then
5863 echo " Already cached: ${S3_KEY} "
You can’t perform that action at this time.
0 commit comments