[AMD] support sd with VitisAIExecutionProvider.#263
[AMD] support sd with VitisAIExecutionProvider.#263liujij wants to merge 29 commits intomicrosoft:mainfrom
Conversation
@microsoft-github-policy-service agree company="AMD" |
There was a problem hiding this comment.
Pull request overview
This PR adds an AMD NPU (VitisAI Execution Provider) optimization + inference path for the sd-legacy/stable-diffusion-v1-5 recipe, integrating Olive workflows/configs and a runnable end-to-end stable_diffusion.py entrypoint.
Changes:
- Introduces a VitisAI-specific pipeline save/load implementation (
sd_utils/vai.py) and wires a--provider vitisaioption into the main Stable Diffusion optimization/inference script. - Adds Olive JSON configs and model loading/dataloader utilities needed to convert/optimize SD v1.5 submodels.
- Adds documentation and a dependency list for running the VitisAI workflow.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| sd-legacy-stable-diffusion-v1-5/VitisAI/user_script.py | Model loaders + dataloaders for SD submodels (UNet/VAE/Text encoder/Safety checker), plus LoRA merge helper. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/stable_diffusion.py | CLI entrypoint to optimize and run inference across providers incl. VitisAI. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/vai.py | VitisAI pipeline save/load and provider-specific Olive config mutation. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/qdq.py | QDQ pipeline utilities (including a pipeline variant that saves calibration data). |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/qdq_xl.py | SDXL QDQ helpers (ORT/Optimum based) with data capture. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/ov.py | OpenVINO pipeline implementation and helpers. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/ort.py | ORT pipeline save/load + Olive footprint extraction. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/sd_utils/config.py | Shared mutable config for sample sizes, flags, and data dir. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/requirements_vitisai_sd.txt | Python dependencies for VitisAI SD workflow. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/README.md | Setup + usage documentation for VitisAI SD v1.5 optimization/inference. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/model_adaptations.py | UNet monkeypatching utilities (attention/FFN/norm replacements). |
| sd-legacy-stable-diffusion-v1-5/VitisAI/config_unet.json | Olive config for UNet conversion/model generation. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/config_vae_decoder.json | Olive config for VAE decoder conversion/model generation. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/config_vae_encoder.json | Olive config for VAE encoder conversion/optimization/fixed-shape. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/config_text_encoder.json | Olive config for CLIP text encoder conversion/optimization/fixed-shape. |
| sd-legacy-stable-diffusion-v1-5/VitisAI/config_safety_checker.json | Olive config for safety checker conversion/optimization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@devang-ml / @xieofxie can you please review this? |
|
Hi @devang-ml @xieofxie Just a friendly reminder in case you missed the previous message. Could you please help review this? We have already completed the legal scan and would like to move this forward soon. If everything looks good, could you kindly help merge it? Thanks! |
|
Corresponding Olive PR: microsoft/Olive#2359 |
|
please also fix from pre commit test |
Done. @xieofxie |
Summary
This PR adds AMD NPU (Vitis AI Execution Provider) support for sd-legacy/stable-diffusion-v1-5, enabling optimized model generation and end-to-end inference via stable_diffusion.py.
Changes