Skip to content

Commit 6a579b7

Browse files
committed
fix wheel lookup
Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com>
1 parent 76c0b1b commit 6a579b7

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

scripts/ci/build/pytorch_runtime/lib/fetch_wheels.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
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

1112
set -euo pipefail
1213

@@ -33,6 +34,11 @@ if [[ -z "$BUCKET" ]]; then
3334
exit 1
3435
fi
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+
3642
mkdir -p "${DEST_DIR}"
3743

3844
ALL_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}"

scripts/ci/build/pytorch_runtime/lib/upload_wheels.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ done
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+
3237
EXPORT_DIR=$(mktemp -d)
3338

3439
docker 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}"

0 commit comments

Comments
 (0)