Skip to content

Commit fa0e0fe

Browse files
committed
CI: switch ATOM validation to nightly wheel test
Convert the FlyDSL ATOM workflow into a nightly validation job that resolves the latest promoted FlyDSL wheel from S3 and installs it into atom-dev before running accuracy checks. This removes the in-workflow FlyDSL build path and aligns the test with the published nightly artifact that downstream users consume.
1 parent a97e276 commit fa0e0fe

1 file changed

Lines changed: 90 additions & 78 deletions

File tree

.github/workflows/flydsl-atom-integration.yaml

Lines changed: 90 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
name: FlyDSL ATOM integration
1+
name: FlyDSL ATOM nightly
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- pre_v0.1
8-
pull_request:
9-
branches:
10-
- main
11-
- pre_v0.1
4+
schedule:
5+
# Run after the FlyDSL nightly wheel publish/promote flow.
6+
- cron: '0 4 * * *'
127
workflow_dispatch:
138

149
concurrency:
1510
group: ${{ github.workflow }}-${{ github.ref }}
16-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
11+
cancel-in-progress: true
1712

1813
env:
1914
ATOM_BASE_IMAGE: rocm/atom-dev:latest
2015
ATOM_REPOSITORY: ROCm/ATOM
2116
ATOM_REF: main
22-
GITHUB_REPO_NAME: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
23-
GITHUB_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
17+
FLYDSL_WHEEL_BUCKET: framework-whls-nightlies
18+
FLYDSL_WHEEL_PREFIX: whl/gfx942-gfx950
2419

2520
jobs:
2621
atom-accuracy:
2722
name: ATOM accuracy / ${{ matrix.model_name }}
2823
timeout-minutes: 180
24+
runs-on: ${{ matrix.runner }}
25+
permissions:
26+
id-token: write
27+
contents: read
2928
strategy:
3029
fail-fast: false
3130
matrix:
@@ -43,18 +42,16 @@ jobs:
4342
runner: linux-flydsl-mi355-1
4443
env_vars: ""
4544

46-
runs-on: ${{ matrix.runner }}
47-
4845
env:
4946
CONTAINER_NAME: flydsl_atom_${{ strategy.job-index }}
5047

5148
steps:
52-
- name: Checkout FlyDSL code
49+
- name: Checkout FlyDSL utility scripts
5350
uses: actions/checkout@v4
5451
with:
55-
repository: ${{ env.GITHUB_REPO_NAME }}
56-
ref: ${{ env.GITHUB_COMMIT_SHA }}
57-
path: flydsl-test
52+
sparse-checkout: |
53+
scripts/install_awscli.sh
54+
path: flydsl
5855

5956
- name: Checkout upstream ATOM repo
6057
uses: actions/checkout@v4
@@ -63,12 +60,14 @@ jobs:
6360
ref: ${{ env.ATOM_REF }}
6461
path: atom-upstream
6562

66-
- name: Restore cached MLIR install tarball
67-
id: mlir-cache
68-
uses: actions/cache@v4
63+
- name: Configure AWS credentials
64+
uses: aws-actions/configure-aws-credentials@v4
6965
with:
70-
path: mlir_install.tgz
71-
key: flydsl-mlir-install-${{ hashFiles('flydsl-test/cmake/llvm-hash.txt', 'flydsl-test/scripts/build_llvm.sh', 'flydsl-test/.github/workflows/flydsl-atom-integration.yaml') }}
66+
aws-region: us-east-1
67+
role-to-assume: arn:aws:iam::661452401056:role/framework-flydsl-nightlies
68+
69+
- name: Install AWS CLI
70+
run: bash ./flydsl/scripts/install_awscli.sh
7271

7372
- name: Start CI container
7473
run: |
@@ -119,79 +118,92 @@ jobs:
119118
run: |
120119
docker exec "${CONTAINER_NAME}" bash -lc "
121120
set -euo pipefail
122-
command -v git curl cmake python3
121+
command -v git curl python3
123122
git --version
124-
cmake --version
125123
python3 --version
126124
python3 -m pip install --timeout 60 --retries 10 -U pip setuptools wheel
127-
python3 -m pip install --timeout 60 --retries 10 'ninja>=1.11.1' 'pybind11>=3.0.1' 'lm-eval[api]' hf_transfer 'huggingface_hub[cli]'
128-
git config --global --add safe.directory /workspace/flydsl-test
125+
python3 -m pip install --timeout 60 --retries 10 'lm-eval[api]' hf_transfer 'huggingface_hub[cli]'
129126
chmod +x /workspace/atom-upstream/.github/scripts/atom_test.sh
130-
cd /workspace/flydsl-test
131-
git submodule sync
132-
git submodule update --init --recursive
133-
"
134-
135-
- name: Restore cached MLIR install into container
136-
if: steps.mlir-cache.outputs.cache-hit == 'true'
137-
run: |
138-
docker cp mlir_install.tgz "${CONTAINER_NAME}:/tmp/mlir_install.tgz"
139-
docker exec "${CONTAINER_NAME}" bash -lc "
140-
set -euo pipefail
141-
rm -rf /workspace/llvm-project/build-flydsl/mlir_install
142-
mkdir -p /workspace/llvm-project/build-flydsl
143-
tar -xzf /tmp/mlir_install.tgz -C /workspace/llvm-project/build-flydsl
144-
ls -la /workspace/llvm-project/build-flydsl/mlir_install/lib/cmake/mlir
145127
"
146128
147-
- name: Build LLVM and cache MLIR install
148-
if: steps.mlir-cache.outputs.cache-hit != 'true'
129+
- name: Download latest FlyDSL nightly wheel
149130
run: |
150131
set -euo pipefail
151-
docker exec "${CONTAINER_NAME}" bash -lc "
152-
set -euo pipefail
153-
cd /workspace/flydsl-test
154-
bash scripts/build_llvm.sh
155-
ls -la /workspace/llvm-project/build-flydsl/mlir_install/lib/cmake/mlir
156-
"
157-
docker cp "${CONTAINER_NAME}:/workspace/llvm-project/build-flydsl/mlir_install.tgz" ./mlir_install.tgz
158132
159-
- name: Reinstall aiter main and FlyDSL PR commit
133+
PY_TAG=$(docker exec "${CONTAINER_NAME}" python3 - <<'PY'
134+
import sys
135+
print(f"cp{sys.version_info.major}{sys.version_info.minor}")
136+
PY
137+
)
138+
echo "Detected Python tag inside atom-dev image: ${PY_TAG}"
139+
140+
aws s3api list-objects-v2 \
141+
--bucket "${{ env.FLYDSL_WHEEL_BUCKET }}" \
142+
--prefix "${{ env.FLYDSL_WHEEL_PREFIX }}/" \
143+
--output json > /tmp/flydsl-nightly-wheels.json
144+
145+
LATEST_KEY=$(PY_TAG="${PY_TAG}" S3_PREFIX="${{ env.FLYDSL_WHEEL_PREFIX }}" python3 - <<'PY'
146+
import datetime as dt
147+
import json
148+
import os
149+
import posixpath
150+
151+
py_tag = os.environ["PY_TAG"]
152+
s3_prefix = os.environ["S3_PREFIX"]
153+
with open("/tmp/flydsl-nightly-wheels.json", encoding="utf-8") as f:
154+
data = json.load(f)
155+
156+
candidates = []
157+
for obj in data.get("Contents", []):
158+
key = obj["Key"]
159+
name = posixpath.basename(key)
160+
if not (name.startswith("flydsl-") and name.endswith(".whl")):
161+
continue
162+
if py_tag not in name:
163+
continue
164+
timestamp = dt.datetime.fromisoformat(obj["LastModified"].replace("Z", "+00:00"))
165+
candidates.append((timestamp, key))
166+
167+
if not candidates:
168+
raise SystemExit(f"No FlyDSL wheel found for {py_tag} under s3://framework-whls-nightlies/{s3_prefix}/")
169+
170+
print(max(candidates, key=lambda item: item[0])[1])
171+
PY
172+
)
173+
174+
WHEEL_NAME=$(basename "${LATEST_KEY}")
175+
WHEEL_S3_URI="s3://${{ env.FLYDSL_WHEEL_BUCKET }}/${LATEST_KEY}"
176+
echo "Selected FlyDSL wheel: ${WHEEL_S3_URI}"
177+
aws s3 cp "${WHEEL_S3_URI}" "./${WHEEL_NAME}"
178+
179+
printf 'Wheel S3 URI: %s\n' "${WHEEL_S3_URI}" | tee selected-flydsl-wheel.txt
180+
echo "FLYDSL_WHEEL_NAME=${WHEEL_NAME}" >> "${GITHUB_ENV}"
181+
echo "FLYDSL_WHEEL_S3_URI=${WHEEL_S3_URI}" >> "${GITHUB_ENV}"
182+
183+
- name: Install latest FlyDSL nightly wheel
160184
run: |
185+
set -euo pipefail
186+
docker cp "${FLYDSL_WHEEL_NAME}" "${CONTAINER_NAME}:/tmp/${FLYDSL_WHEEL_NAME}"
161187
docker exec "${CONTAINER_NAME}" bash -lc "
162188
set -euo pipefail
163-
164-
echo '=== Reinstalling aiter from main ==='
165-
pip uninstall -y amd-aiter aiter || true
166-
rm -rf /tmp/aiter-main
167-
git clone --depth 1 -b main https://github.com/ROCm/aiter.git /tmp/aiter-main
168-
cd /tmp/aiter-main
169-
git submodule sync
170-
git submodule update --init --recursive
171-
MAX_JOBS=64 PREBUILD_KERNELS=0 GPU_ARCHS=gfx950 python3 setup.py develop
172-
173-
echo '=== Installing FlyDSL from the checked out PR commit ==='
174189
pip uninstall -y flydsl || true
175-
cd /workspace/flydsl-test
176-
MLIR_PATH=/workspace/llvm-project/build-flydsl/mlir_install python3 -m pip install -e . --use-pep517
177-
190+
python3 -m pip install --force-reinstall /tmp/${FLYDSL_WHEEL_NAME}
178191
python3 - <<'PY'
179-
import pathlib
180-
import atom
181192
import flydsl
182-
183-
repo_root = pathlib.Path('/workspace/flydsl-test').resolve()
184-
flydsl_path = pathlib.Path(flydsl.__file__).resolve()
185-
186-
print(f'atom package: {atom.__file__}')
187-
print(f'flydsl package: {flydsl_path}')
193+
print(f'flydsl package: {flydsl.__file__}')
188194
print(f'flydsl version: {getattr(flydsl, "__version__", "unknown")}')
189-
190-
if repo_root not in flydsl_path.parents:
191-
raise SystemExit(f'FlyDSL is not loaded from the checked out PR commit: {flydsl_path}')
192195
PY
193196
"
194197
198+
- name: Record nightly wheel
199+
run: |
200+
{
201+
echo "## Nightly Wheel"
202+
echo
203+
echo "- S3 URI: \`${FLYDSL_WHEEL_S3_URI}\`"
204+
echo "- Local file: \`${FLYDSL_WHEEL_NAME}\`"
205+
} >> "${GITHUB_STEP_SUMMARY}"
206+
195207
- name: Pre-download model when cache mount exists
196208
run: |
197209
set -euo pipefail
@@ -283,6 +295,7 @@ jobs:
283295
with:
284296
name: flydsl-atom-${{ matrix.model_name }}
285297
path: |
298+
selected-flydsl-wheel.txt
286299
atom_accuracy_output.txt
287300
atom_server.log
288301
atom_client.log
@@ -297,7 +310,6 @@ jobs:
297310
set -euo pipefail
298311
cd /workspace/atom-upstream
299312
bash .github/scripts/atom_test.sh stop || true
300-
rm -rf /workspace/llvm-project /workspace/flydsl-test/build-fly /workspace/flydsl-test/python/flydsl/_mlir
301313
" || true
302314
docker stop "${CONTAINER_NAME}" || true
303315
docker rm "${CONTAINER_NAME}" || true

0 commit comments

Comments
 (0)