Skip to content

Commit

Permalink
Add ROCm SDXL testing and benchmarking. (#17183)
Browse files Browse the repository at this point in the history
ci-exactly: build_packages, regression_test_cpu,
regression_test_amdgpu_vulkan, regression_test_amdgpu_rocm,
regression_test_nvidiagpu_vulkan, regression_test_nvidiagpu_cuda
  • Loading branch information
saienduri authored Apr 26, 2024
1 parent ab54a60 commit 8735b2e
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 24 deletions.
89 changes: 88 additions & 1 deletion .github/workflows/pkgci_regression_test_amdgpu_rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
- name: Installing external TestSuite Python requirements
Expand All @@ -75,3 +75,90 @@ jobs:
-rpfE --timeout=30 --retries=2 --durations=20 \
--config-files=build_tools/pkgci/external_test_suite/onnx_gpu_rocm_rdna3.json \
--no-skip-tests-missing-files
linux_x86_64_rocm_models:
name: MI250 - Models
runs-on: nodai-amdgpu-mi250-x86-64
env:
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
IREERS_ARTIFACT_DIR: ${{ github.workspace }}/artifacts
VENV_DIR: ${{ github.workspace }}/venv
IREE_TEST_FILES: ~/iree_tests_cache
steps:
- name: Checking out IREE repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
submodules: false
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
# Must match the subset of versions built in pkgci_build_packages.
python-version: '3.11'
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: linux_x86_64_release_packages
path: ${{ env.PACKAGE_DOWNLOAD_DIR }}
- name: Setup venv
run: |
./build_tools/pkgci/setup_venv.py ${VENV_DIR} \
--artifact-path=${PACKAGE_DOWNLOAD_DIR} \
--fetch-gh-workflow=${{ inputs.artifact_run_id }}
# Out of tree tests
- name: Check out external TestSuite repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
lfs: true
- name: Install external TestSuite Python requirements
run: |
source ${VENV_DIR}/bin/activate
python -m pip install -r SHARK-TestSuite/iree_tests/requirements.txt
- name: Download remote files for real weight model tests
run: |
source ${VENV_DIR}/bin/activate
python SHARK-TestSuite/iree_tests/download_remote_files.py --root-dir pytorch/models
- name: Run external tests - Models with real weights
run: |
source ${VENV_DIR}/bin/activate
pytest SHARK-TestSuite/iree_tests/pytorch/models \
-rpfE \
-k real_weights \
--no-skip-tests-missing-files \
--capture=no \
--timeout=1200 \
--retries 2 \
--retry-delay 5 \
--durations=0 \
--config-files=build_tools/pkgci/external_test_suite/gpu_rocm_models_gfx90a.json
- name: Run external tests - Models with real weights and additional flags
run: |
source ${VENV_DIR}/bin/activate
pytest SHARK-TestSuite/iree_tests/pytorch/models \
-rpfE \
-k real_weights \
--no-skip-tests-missing-files \
--capture=no \
--timeout=1200 \
--retries 2 \
--retry-delay 5 \
--durations=0 \
--config-files=build_tools/pkgci/external_test_suite/gpu_rocm_models_additional_flags_gfx90a.json
- name: "Running real weight model tests scheduled unet"
run: |
source ${VENV_DIR}/bin/activate
pytest SHARK-TestSuite/iree_tests/pytorch/models/sdxl-scheduled-unet-3-tank \
-rpfE \
-k real_weights \
--no-skip-tests-missing-files \
--capture=no \
--timeout=1200 \
--retries 2 \
--retry-delay 5 \
--durations=0 \
--config-files=build_tools/pkgci/external_test_suite/sdxl_scheduled_unet_gpu_rocm_gfx90a.json
- name: "Running SDXL rocm pipeline benchmark"
run: |
source ${VENV_DIR}/bin/activate
bash SHARK-TestSuite/iree_tests/benchmarks/benchmark_sdxl_rocm.sh
4 changes: 2 additions & 2 deletions .github/workflows/pkgci_regression_test_amdgpu_vulkan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
- name: Installing external TestSuite Python requirements
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
lfs: true
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/pkgci_regression_test_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
lfs: true
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
lfs: true
Expand All @@ -122,7 +122,27 @@ jobs:
- name: Run external tests - Models with real weights
run: |
source ${VENV_DIR}/bin/activate
pytest SHARK-TestSuite/iree_tests/pytorch/models -k real_weights \
-rpfE --timeout=600 --durations=0 \
--config-files=build_tools/pkgci/external_test_suite/pytorch_models_cpu_llvm_task.json \
--no-skip-tests-missing-files
pytest SHARK-TestSuite/iree_tests/pytorch/models \
-n 4 \
-rpfE \
-k real_weights \
--no-skip-tests-missing-files \
--capture=no \
--timeout=1200 \
--retries 2 \
--retry-delay 5 \
--durations=0 \
--config-files=build_tools/pkgci/external_test_suite/pytorch_models_cpu_llvm_task.json
- name: "Running real weight model tests scheduled unet cpu"
run: |
source ${VENV_DIR}/bin/activate
pytest SHARK-TestSuite/iree_tests/pytorch/models/sdxl-scheduled-unet-3-tank \
-rpfE \
-k real_weights \
--no-skip-tests-missing-files \
--capture=no \
--timeout=1200 \
--retries 2 \
--retry-delay 5 \
--durations=0 \
--config-files=build_tools/pkgci/external_test_suite/sdxl_scheduled_unet_cpu_llvm_task.json
2 changes: 1 addition & 1 deletion .github/workflows/pkgci_regression_test_nvidiagpu_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
- name: Installing external TestSuite Python requirements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
repository: nod-ai/SHARK-TestSuite
ref: d83c02dbecf7963320b5773ceb8ac3b3b7d90831
ref: 320edabdfba7f5cf46e5cd88569fca52308d8988
path: SHARK-TestSuite
submodules: false
- name: Installing external TestSuite Python requirements
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"config_name": "gpu_rocm",
"iree_compile_flags" : [
"--iree-hal-target-backends=rocm",
"--iree-rocm-target-chip=gfx90a",
"--iree-opt-const-eval=false",
"--iree-codegen-transform-dialect-library=attention_and_matmul_spec.mlir"
],
"iree_run_module_flags": [
"--device=hip"
],
"skip_compile_tests": [
"sdxl-scheduled-unet-3-tank"
],
"skip_run_tests": [],
"expected_compile_failures": [
"resnet50"
],
"expected_run_failures": []
}
19 changes: 19 additions & 0 deletions build_tools/pkgci/external_test_suite/gpu_rocm_models_gfx90a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"config_name": "gpu_rocm",
"iree_compile_flags" : [
"--iree-hal-target-backends=rocm",
"--iree-rocm-target-chip=gfx90a"
],
"iree_run_module_flags": [
"--device=hip"
],
"skip_compile_tests": [
"sdxl-scheduled-unet-3-tank"
],
"skip_run_tests": [],
"expected_compile_failures": [
"resnet50",
"sdxl-vae-decode-tank"
],
"expected_run_failures": []
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"config_name": "cpu_llvm_task",
"iree_compile_flags" : [
"--iree-hal-target-backends=llvm-cpu",
"--iree-llvmcpu-target-cpu-features=host",
"--iree-llvmcpu-distribution-size=32"
],
"iree_run_module_flags": [
"--device=local-task"
],
"skip_compile_tests": [],
"skip_run_tests": [],
"expected_compile_failures": [],
"expected_run_failures": []
"config_name": "cpu_llvm_task",
"iree_compile_flags" : [
"--iree-hal-target-backends=llvm-cpu",
"--iree-llvmcpu-target-cpu-features=host",
"--iree-llvmcpu-distribution-size=32"
],
"iree_run_module_flags": [
"--device=local-task"
],
"skip_compile_tests": [
"sdxl-scheduled-unet-3-tank"
],
"skip_run_tests": [],
"expected_compile_failures": [],
"expected_run_failures": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"config_name": "cpu_llvm_task",
"iree_compile_flags" : [
"--iree-hal-target-backends=llvm-cpu",
"--iree-llvmcpu-target-cpu-features=host",
"--iree-llvmcpu-distribution-size=32"
],
"iree_run_module_flags": [
"--device=local-task",
"--parameters=model=real_weights.irpa",
"--module=sdxl_scheduled_unet_pipeline_fp16_cpu.vmfb",
"--input=1x4x128x128xf16=@inference_input.0.bin",
"--input=2x64x2048xf16=@inference_input.1.bin",
"--input=2x1280xf16=@inference_input.2.bin",
"--input=1xf16=@inference_input.3.bin",
"--expected_output=1x4x128x128xf16=@inference_output.0.bin",
"--expected_f16_threshold=0.8f"
],
"skip_compile_tests": [],
"skip_run_tests": [],
"expected_compile_failures": [],
"expected_run_failures": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"config_name": "gpu_rocm",
"iree_compile_flags" : [
"--iree-hal-target-backends=rocm",
"--iree-rocm-target-chip=gfx90a",
"--iree-opt-const-eval=false",
"--iree-codegen-transform-dialect-library=attention_and_matmul_spec.mlir",
"--iree-global-opt-propagate-transposes=true",
"--iree-opt-outer-dim-concat=true",
"--iree-vm-target-truncate-unsupported-floats",
"--iree-llvmgpu-enable-prefetch=true",
"--iree-opt-data-tiling=false",
"--iree-codegen-gpu-native-math-precision=true",
"--iree-codegen-llvmgpu-use-vector-distribution",
"--iree-preprocessing-pass-pipeline=builtin.module(iree-preprocessing-transpose-convolution-pipeline, util.func(iree-preprocessing-pad-to-intrinsics))"
],
"iree_run_module_flags": [
"--device=hip",
"--parameters=model=real_weights.irpa",
"--module=sdxl_scheduled_unet_pipeline_fp16_rocm.vmfb",
"--input=1x4x128x128xf16=@inference_input.0.bin",
"--input=2x64x2048xf16=@inference_input.1.bin",
"--input=2x1280xf16=@inference_input.2.bin",
"--input=1xf16=@inference_input.3.bin",
"--expected_output=1x4x128x128xf16=@inference_output.0.bin",
"--expected_f16_threshold=0.8f"
],
"skip_compile_tests": [],
"skip_run_tests": [],
"expected_compile_failures": [],
"expected_run_failures": []
}

0 comments on commit 8735b2e

Please sign in to comment.