Skip to content
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

Adding Multi-Image generation usecase app #3356

Merged
merged 45 commits into from
Nov 23, 2024

Conversation

ravi9
Copy link
Contributor

@ravi9 ravi9 commented Nov 4, 2024

Description

This Streamlit app is designed to generate multiple images based on a provided text prompt. It leverages TorchServe for efficient model serving and management, and utilizes Meta-LLaMA-3.2 for prompt generation, and Stable Diffusion with latent-consistency/lcm-sdxl and Torch.compile using OpenVINO backend for image generation.

Copy link
Collaborator

@agunapal agunapal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me,

I think the intro section needs more highlighting of what is the differentiated solution here vs using Stable diffusion. There is a lot happening under the hood, which needs to be shown & explained.

Also please check the changes in the docs folder in this PR

#3276

You need to add this to make it show up in https://pytorch.org/serve/genai_use_cases.html

Copy link
Collaborator

@agunapal agunapal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall. minor edits needed for Llama vs LLaMA

docs/genai_use_cases.md Outdated Show resolved Hide resolved
docs/genai_use_cases.md Outdated Show resolved Hide resolved
examples/usecases/llm_diffusion_serving_app/README.md Outdated Show resolved Hide resolved
examples/usecases/llm_diffusion_serving_app/README.md Outdated Show resolved Hide resolved
print(f"\nResults and Images saved at {out_dir} which is a Docker container mount, corresponds to 'serve/model-store-local/' on the host machine.\n")

if __name__ == "__main__":
main()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool and comprehensive script for benchmarking!

logger.info("Compiling UNet.")
if compile_mode == "max-autotune" and change_comp_config:
pipe.unet.to(memory_format=torch.channels_last)
torch._inductor.config.conv_1x1_as_mm = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these configs? Are these missing in the benchmarking script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These settings provide better perf on GPUs.
These settings are not used in our app.
In SD model-config.yaml for this app, we set change_comp_config=False.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. In the blog , we can add a note about these configs for GPU and what benefit they provide

examples/usecases/llm_diffusion_serving_app/README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@agunapal agunapal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@agunapal agunapal added this pull request to the merge queue Nov 23, 2024
Merged via the queue into pytorch:master with commit 55c2f6b Nov 23, 2024
12 of 14 checks passed
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.

4 participants