Accelerating the inference of Hunyuan-DiT with its skip-branches #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Below, we present both quantitative and qualitative results of Skip-Cache on Hunyuan-DiT to showcase its performance.
Qualitative Results
Visualizations
Comparison between Skip-Cache and other caching methods on HunyuanDiT:
Accelerating HunyuanDiT with 2x speedup: