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

Accelerating the inference of Hunyuan-DiT with its skip-branches #217

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

guanjiechen118
Copy link

Hi, I'm the first author of the paper Accelerating Vision Diffusion Transformers with Skip Branches. In this work, we proposed Skip-DiT and Skip-Cache. Skip-DiT demonstrates superior feature smoothness and improved training efficiency, while Skip-Cache achieves a 2x acceleration during inference. Notably, Skip-DiT is inspired by Hunyuan-DiT, making it particularly well-suited for integration with Hunyuan-DiT. We successfully accelerated Hunyuan-DiT inference by 1.5x without any quality degradation and achieved up to 2.0x acceleration with minimal overhead.

We have added it to our forked repository, complete with detailed code comments and a consistent coding style for easy adoption. We believe that integrating Skip-Cache into this exceptional model will be highly beneficial. To run the inference with skip-cache with the command line, you only need to add --use-cache and specify the --cache-step

python sample_t2i.py --infer-mode fa --prompt "渔舟唱晚" --use-cache --cache-step 2 # or 3,4,5,6

Below, we present both quantitative and qualitative results of Skip-Cache on Hunyuan-DiT to showcase its performance.

Qualitative Results
image

Visualizations
Comparison between Skip-Cache and other caching methods on HunyuanDiT:
image
Accelerating HunyuanDiT with 2x speedup:
image

@guanjiechen118 guanjiechen118 changed the title Accelerating the inference of Hunyuan-DiT with 2x speedup for free with its skip-branches Accelerating the inference of Hunyuan-DiT with 2x speedup with its skip-branches Dec 2, 2024
@guanjiechen118 guanjiechen118 changed the title Accelerating the inference of Hunyuan-DiT with 2x speedup with its skip-branches Accelerating the inference of Hunyuan-DiT with its skip-branches Dec 2, 2024
@zml-ai
Copy link
Collaborator

zml-ai commented Dec 3, 2024

Awesome, thanks! I’ll check it out soon. :)

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.

2 participants