-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Resolution Compilation #94
Comments
Compiling a dynamic shape graph is not supported right now. We use some optimization skills which are related to static input shape:
Have you met some problems with static shapes? |
No, but we are building a service that plans to offer dynamic resolutions. |
Please let me know if this feature is ever implemented. Thanks |
We provide an offline-compile mode to reduce online-compile time for scenarios where the input shapes of online inference is limited. Hope this will help: https://github.com/Oneflow-Inc/diffusers/wiki/How-to-Run-OneFlow-Stable-Diffusion#optimization-for-multi-resolution-picture |
Thanks. First I call pipe.enable_graph_share_mem()
prompt = "a photo of an astronaut riding a horse on mars, red sky, (green sky:1.5)"
with torch.autocast("cuda"):
images = pipe(prompt, height=1024).images
images = pipe(prompt, height=768).images
images = pipe(prompt, height=512).images
images = pipe(prompt, height=256).images
I see that it takes 1 second to load when it changes resolution: images = pipe(prompt, height=256).images
images = pipe(prompt, height=256).images
images = pipe(prompt, height=512).images
images = pipe(prompt, height=512).images
images = pipe(prompt, height=768).images
images = pipe(prompt, height=768).images
images = pipe(prompt, height=1024).images
images = pipe(prompt, height=1024).images
images = pipe(prompt, height=768).images
images = pipe(prompt, height=768).images
images = pipe(prompt, height=512).images
images = pipe(prompt, height=512).images
images = pipe(prompt, height=256).images
images = pipe(prompt, height=256).images Is there anyway to speed this up? or maybe mantain all of them active? I don't mind having to use more vram. |
You can run and read this test to be familiar with these two features: https://github.com/Oneflow-Inc/diffusers/blob/oneflow-fork/tests/test_pipelines_oneflow_graph_load.py |
Hello, is it possible to compile the model for dynamic resolution generation rather than static? Similar to TensorRT's?
I see in the code that the compilation call is made either if the model hasn't been compiled already OR the request is for a different resolution than the already compilated one.
The text was updated successfully, but these errors were encountered: