Skip to content

[feat] Add sd15 support for VitisAI.#2359

Open
liujij wants to merge 7 commits intomicrosoft:mainfrom
liujij:feat-sd-models
Open

[feat] Add sd15 support for VitisAI.#2359
liujij wants to merge 7 commits intomicrosoft:mainfrom
liujij:feat-sd-models

Conversation

@liujij
Copy link

@liujij liujij commented Mar 17, 2026

Describe your changes

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link


@classmethod
def _default_config(cls, accelerator_spec):
registry = _get_sd_registry()

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable registry is not used.
@@ -0,0 +1,169 @@
#

Check warning

Code scanning / lintrunner

RUFF-FORMAT/format Warning

Run lintrunner -a to apply this patch.
# SPDX-License-Identifier: MIT
#

"""Olive Pass for Vitis NPU Stable Diffusion submodel generation (UNet / VAE decoder).

Check warning

Code scanning / lintrunner

RUFF/D205 Warning

1 blank line required between summary line and description.
See https://docs.astral.sh/ruff/rules/missing-blank-line-after-summary
return _SD_CONFIG_REGISTRY


def _build_fixed_shapes(dim_param: Optional[list], dim_value: Optional[list]) -> Optional[list[str]]:

Check warning

Code scanning / lintrunner

RUFF/UP007 Warning

return _SD_CONFIG_REGISTRY


def _build_fixed_shapes(dim_param: Optional[list], dim_value: Optional[list]) -> Optional[list[str]]:

Check warning

Code scanning / lintrunner

RUFF/UP007 Warning

return _SD_CONFIG_REGISTRY


def _build_fixed_shapes(dim_param: Optional[list], dim_value: Optional[list]) -> Optional[list[str]]:

Check warning

Code scanning / lintrunner

RUFF/UP007 Warning



class VitisGenerateModelSD(Pass):
"""Generate Vitis NPU-ready SD submodel (unet or vae_decoder) from ONNX input.

Check warning

Code scanning / lintrunner

RUFF/D205 Warning

1 blank line required between summary line and description.
See https://docs.astral.sh/ruff/rules/missing-blank-line-after-summary

@classmethod
def _default_config(cls, accelerator_spec):
registry = _get_sd_registry()

Check warning

Code scanning / lintrunner

PYLINT/W0612 Warning

Unused variable 'registry' (unused-variable)
See unused-variable.

@classmethod
def _default_config(cls, accelerator_spec):
registry = _get_sd_registry()

Check warning

Code scanning / lintrunner

RUFF/F841 Warning

Local variable registry is assigned to but never used.
See https://docs.astral.sh/ruff/rules/unused-variable
@liujij
Copy link
Author

liujij commented Mar 26, 2026

@microsoft-github-policy-service agree company="AMD"

@liujij liujij changed the title [feat] add sd15 supported for NPU. [feat] add sd15 supported with VitisAI EP. Mar 26, 2026
@liujij liujij changed the title [feat] add sd15 supported with VitisAI EP. [feat] Add sd15 supported for vitisai. Mar 26, 2026
@liujij liujij changed the title [feat] Add sd15 supported for vitisai. [feat] Add sd15 supported for VitisAI. Mar 26, 2026
@liujij liujij changed the title [feat] Add sd15 supported for VitisAI. [feat] Add sd15 support for VitisAI. Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant