SDXL E2E Pipeline CI #390
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SDXL E2E Pipeline CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
schedule: | |
- cron: "*/50 * * * *" | |
concurrency: | |
# A PR number if a pull request and otherwise the commit hash. This cancels | |
# queued and in-progress runs for the same PR (presubmit) or commit | |
# (postsubmit). The workflow name is prepended to avoid conflicts between | |
# different workflows. | |
group: ${{ github.workflow }}-${{ github.event.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
test-sdxl-models: | |
strategy: | |
matrix: | |
version: [3.11] | |
os: [nodai-amdgpu-mi300-x86-64] | |
runs-on: ${{matrix.os}} | |
env: | |
IREE_TOKEN: ${{ secrets.IREE_TOKEN }} | |
steps: | |
- name: "Setting up Python" | |
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3 | |
with: | |
python-version: ${{matrix.version}} | |
- name: "Checkout SHARK-ModelDev" | |
uses: actions/checkout@v4 | |
with: | |
ref: bump-punet-tom | |
- name: "Checkout iree-turbine" | |
uses: actions/checkout@v4 | |
with: | |
repository: iree-org/iree-turbine | |
path: iree-turbine | |
- name: "Checkout iree" | |
uses: actions/checkout@v4 | |
with: | |
repository: iree-org/iree | |
path: iree | |
- name: Python deps | |
run: | | |
python3.11 -m venv sdxl_venv | |
source sdxl_venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install --no-compile -r ${{ github.workspace }}/iree-turbine/pytorch-cpu-requirements.txt | |
pip install --pre --upgrade -r ${{ github.workspace }}/iree-turbine/requirements.txt | |
pip install --no-compile --pre --upgrade -e models -r models/requirements.txt | |
pip uninstall torch torchvision torchaudio -y | |
pip install https://download.pytorch.org/whl/nightly/pytorch_triton_rocm-3.0.0%2B21eae954ef-cp311-cp311-linux_x86_64.whl | |
pip install https://download.pytorch.org/whl/nightly/rocm6.1/torch-2.5.0.dev20240710%2Brocm6.1-cp311-cp311-linux_x86_64.whl | |
pip install https://download.pytorch.org/whl/nightly/rocm6.1/torchvision-0.20.0.dev20240711%2Brocm6.1-cp311-cp311-linux_x86_64.whl | |
pip install https://download.pytorch.org/whl/nightly/rocm6.1/torchaudio-2.4.0.dev20240711%2Brocm6.1-cp311-cp311-linux_x86_64.whl | |
pip uninstall iree-compiler iree-runtime iree-base-compiler iree-base-runtime -y | |
python ci-tools/latest-pkgci.py | |
cd wheels | |
unzip *.zip | |
pip install *.whl | |
cd .. | |
rm -rf wheels | |
- name: Show current free memory | |
run: | | |
free -mh | |
- name: Run sdxl tests | |
run: | | |
source sdxl_venv/bin/activate | |
python3 models/turbine_models/custom_models/sd_inference/sd_pipeline.py --device=hip --precision=fp16 --iree_target_triple=gfx942 --external_weights=safetensors --hf_model_name=stabilityai/stable-diffusion-xl-base-1.0 --width=1024 --height=1024 --batch_size=1 --use_i8_punet --attn_spec=punet --vae_decomp_attn --external_weights=safetensors --num_inference_steps=20 --benchmark=all --verbose |