Skip to content

Commit 86ebc19

Browse files
fix te wheel selection
(cherry picked from commit a2f9860) fix rocm version finding
1 parent 63f59dd commit 86ebc19

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/build_rocm_transformer_engine_wheel_weekly.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
env:
2424
XLA_PYTHON_CLIENT_MEM_FRACTION: "0.9"
2525
NVTE_FUSED_ATTN_AOTRITON: "0"
26+
env:
27+
TE_WHEELS_KEEP_DAYS: "21"
2628

2729
steps:
2830
- name: Checkout
@@ -53,7 +55,7 @@ jobs:
5355
source .venv/bin/activate
5456
5557
# Detect ROCm version number from JAX backend string when available (e.g. 'rocm 70200').
56-
ROCM_NUM="$(python3 -c 'import re, jax; s=str(jax.devices()[0].client.platform_version); m=re.search(r"rocm\\s+([0-9]+)", s); print(m.group(1) if m else "unknown")')"
58+
ROCM_NUM="$([ -f /opt/rocm/.info/version ] && head -n1 /opt/rocm/.info/version | tr -d ' \t\r' || echo unknown)"
5759
echo "Detected ROCm version: ${ROCM_NUM}"
5860
echo "ROCM_NUM=${ROCM_NUM}" >> "${GITHUB_ENV}"
5961
@@ -160,7 +162,8 @@ jobs:
160162
run: |
161163
set -euo pipefail
162164
source .venv/bin/activate
163-
python3 "${REL_SCRIPT}" prune-assets --tag "te-rocm-wheels" --keep-days 21
165+
echo "Pruning rolling-tag assets older than ${TE_WHEELS_KEEP_DAYS} days"
166+
python3 "${REL_SCRIPT}" prune-assets --tag "te-rocm-wheels" --keep-days "${TE_WHEELS_KEEP_DAYS}"
164167
165168
- name: Publish wheel to dated weekly release tag
166169
shell: bash
@@ -189,4 +192,5 @@ jobs:
189192
run: |
190193
set -euo pipefail
191194
source .venv/bin/activate
192-
python3 "${REL_SCRIPT}" prune-releases --prefix "te-rocm-wheels-" --keep-days 21
195+
echo "Pruning weekly release pages older than ${TE_WHEELS_KEEP_DAYS} days"
196+
python3 "${REL_SCRIPT}" prune-releases --prefix "te-rocm-wheels-" --keep-days "${TE_WHEELS_KEEP_DAYS}"

.github/workflows/utils/install_te_rocm_wheel.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,18 @@ def try_download_from_te_rocm_wheels(repo: str, arch: str) -> bool:
9292

9393
assets = rel.get("assets", [])
9494
name_re = re.compile(rf"^transformer_engine-.*-1\.{arch}-cp312-cp312-linux_x86_64\.whl$")
95-
hit = next((a for a in assets if name_re.match(a.get("name", ""))), None)
96-
if not hit:
95+
matches = [a for a in assets if name_re.match(a.get("name", ""))]
96+
if not matches:
9797
return False
9898

99+
# Rolling tag keeps many wheels; select newest matching asset.
100+
hit = max(matches, key=lambda a: a.get("created_at", ""))
101+
print(
102+
"[te wheel] selected latest te-rocm-wheels asset: "
103+
f"{hit.get('name', '<unknown>')} (created_at={hit.get('created_at', 'unknown')})",
104+
flush=True,
105+
)
106+
99107
download(hit["browser_download_url"], hit["name"])
100108
return True
101109

0 commit comments

Comments
 (0)