Skip to content

Add CUDA and Core AI backends to the Diffusers export - #25724

Open
kiymetakdemir wants to merge 1 commit into
mainfrom
diffusers-export-backends
Open

kiymetakdemir wants to merge 1 commit into
mainfrom
diffusers-export-backends

Conversation

@kiymetakdemir

Copy link
Copy Markdown
Contributor

Summary

Adds --backend cuda and --backend coreai to the Diffusers export.

export_to_cuda lowers each method with CudaPartitioner and writes the weights to a .ptd file. --qlinear quantizes the denoiser as for MLX; 4w packs the weights for the INT4 kernels. export_to_coreai lowers each method with CoreAIPartitioner and Core AI's default passes. It requires static shapes and float16 or float32 components, and rejects --qlinear.

This PR was authored with the help of Claude Code.

Test plan

export/tests/test_diffusers.py covers dispatch to both backends and the Core AI option checks.

python -m pytest export/tests/test_diffusers.py

SD1.5 and FLUX.1-schnell (--qlinear 4w) exported to CUDA, and SD1.5 exported to Core AI, generate correct images.

@pytorch-bot

pytorch-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25724

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 70fffb8 with merge base 0986bc8 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

This branch was previously deployed

1 inactive deployment
cadence — 70fffb8c Deployed Nov 25, 2026 by kiymetakdemir via hifi-op-test / hifi4 #40975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant