Add SDXL example#44
Conversation
Creates models/sdxl and adds scripts to run SDXL through the EP. Signed-off-by: Abhishek Varma <abhvarma@amd.com>
014959d to
e641997
Compare
|
|
||
| MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0" | ||
|
|
||
| _INT8_UNET_AZURE_BASE = ( |
There was a problem hiding this comment.
I would go for one approach and just put all onnx files (i8, f16) on azure and then download them. No need to include the files used to generate them.
There was a problem hiding this comment.
Done. Can you check now?
| continue | ||
| url = f"{_INT8_UNET_AZURE_BASE}/{fname}" | ||
| logger.info(" Downloading %s ...", fname) | ||
| urllib.request.urlretrieve(url, dest) |
There was a problem hiding this comment.
Let's add timeout, retry and hash verification here.
There was a problem hiding this comment.
Done. Can you check ?
| betas = np.linspace(0.00085**0.5, 0.012**0.5, 1000) ** 2 | ||
| alphas_cumprod = np.cumprod(1.0 - betas) | ||
| sigmas = ((1 - alphas_cumprod) / alphas_cumprod) ** 0.5 | ||
| step_ratio = 1000 // args.steps | ||
| timesteps = (np.arange(args.steps) * step_ratio)[::-1].copy() |
There was a problem hiding this comment.
Claude says we should be using karras sigmas instead?
There was a problem hiding this comment.
So the current linear schedule matches SDXL's default EulerDiscreteScheduler config (the default scheduler that ships with SDXL in HuggingFace diffusers (EulerDiscreteScheduler with use_karras_sigmas=False)).
I'd prefer keeping the default scheduler and matching the model's training config as is.
|
|
||
| torch-mlir's ONNX importer expects Slice parameters (starts, ends, axes, | ||
| steps) as ``onnx.Constant`` ops, not graph initializers. | ||
| """ |
There was a problem hiding this comment.
@Abhishek-Varma could you post a reproducer for this?
There was a problem hiding this comment.
Hi @IanWood1 - seems like this was needed previously but we can now do away with this. I've anyway removed this file in the latest push. Can you check now ?
| """Patch Resize ops to 4-input format (X, roi, scales, sizes) for IREE. | ||
|
|
||
| The dynamo exporter produces ``Resize(X, "", scales)`` with an empty-string | ||
| roi input. The EP's MLIR generator skips empty-name inputs, producing only | ||
| 2 inputs in MLIR. IREE needs all 4 positional inputs. | ||
| """ |
There was a problem hiding this comment.
Seems like a bug in the EP, right?
Signed-off-by: Abhishek Varma <abhvarma@amd.com>
fc14338 to
20f2494
Compare
Groverkss
left a comment
There was a problem hiding this comment.
Will have a look again, but on an initial look, looks very nice! Well done!
Signed-off-by: Abhishek Varma <abhvarma@amd.com>
Creates models/sdxl and adds scripts to run SDXL through the EP.