{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/accelerating-diffusion-transformers-with-dual","title":"Accelerating Diffusion Transformers with Dual Feature Caching","arxiv_id":"2412.18911","date":"2024-12-25","proceeding":null,"authors":["Chang Zou","Evelyn Zhang","Runlin Guo","Haohang Xu","Conghui He","Xuming Hu","Linfeng Zhang"],"abstract":"Diffusion Transformers (DiT) have become the dominant methods in image and video generation yet still suffer substantial computational costs. As an effective approach for DiT acceleration, feature caching methods are designed to cache the features of DiT in previous timesteps and reuse them in the next timesteps, allowing us to skip the computation in the next timesteps. However, on the one hand, aggressively reusing all the features cached in previous timesteps leads to a severe drop in generation quality. On the other hand, conservatively caching only the features in the redundant layers or tokens but still computing the important ones successfully preserves the generation quality but results in reductions in acceleration ratios. Observing such a tradeoff between generation quality and acceleration performance, this paper begins by quantitatively studying the accumulated error from cached features. Surprisingly, we find that aggressive caching does not introduce significantly more caching errors in the caching step, and the conservative feature caching can fix the error introduced by aggressive caching. Thereby, we propose a dual caching strategy that adopts aggressive and conservative caching iteratively, leading to significant acceleration and high generation quality at the same time. Besides, we further introduce a V-caching strategy for token-wise conservative caching, which is compatible with flash attention and requires no training and calibration data. Our codes have been released in Github: \\textbf{Code: \\href{https://github.com/Shenyi-Z/DuCa}{\\texttt{\\textcolor{cyan}{https://github.com/Shenyi-Z/DuCa}}}}","url_abs":"https://arxiv.org/abs/2412.18911v1","url_pdf":"https://arxiv.org/pdf/2412.18911v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"accelerating-diffusion-transformers-with-dual","repo_url":"https://github.com/shenyi-z/duca","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"accelerating-diffusion-transformers-with-dual","repo_url":"https://github.com/Shenyi-Z/TaylorSeer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"accelerating-diffusion-transformers-with-dual","repo_url":"https://github.com/Shenyi-Z/ToCa","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"video-generation","task_name":"Video Generation"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.18911","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.18911"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Shenyi-Z/ToCa","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Shenyi-Z/TaylorSeer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shenyi-z/duca","reach":null}],"summary":{"ran_honours":1,"unverified":2},"by_repo_kind":{"listed":{"samples":3,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"d6599e8a3ed738da","entry":"single_cache_add","repo":"Shenyi-Z/TaylorSeer","repo_kind":"listed","path":"TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","file_url":"https://github.com/Shenyi-Z/TaylorSeer/blob/HEAD/TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d6599e8a3ed738da"}},{"code_sha256_prefix":"1b643d2df3f30581","entry":"double_cache_step","repo":"Shenyi-Z/TaylorSeer","repo_kind":"listed","path":"TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","file_url":"https://github.com/Shenyi-Z/TaylorSeer/blob/HEAD/TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1b643d2df3f30581"}},{"code_sha256_prefix":"4987ddd40e3ee6e5","entry":"single_cache_step","repo":"Shenyi-Z/TaylorSeer","repo_kind":"listed","path":"TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","file_url":"https://github.com/Shenyi-Z/TaylorSeer/blob/HEAD/TaylorSeer-HiDream/hi_diffusers/models/transformers/transformer_hidream_image.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4987ddd40e3ee6e5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}