Optimize WAN pipelines: Reduce host overhead, hoist transposes, and fix Cache bugs#432
Draft
Perseus14 wants to merge 1 commit into
Draft
Optimize WAN pipelines: Reduce host overhead, hoist transposes, and fix Cache bugs#432Perseus14 wants to merge 1 commit into
Perseus14 wants to merge 1 commit into
Conversation
304ef1a to
da2175c
Compare
…ncat/transpose churn reduction, replace prints with max_logging, and fix CFG cache multi-host sharding crashes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR introduces several performance optimizations and bug fixes to the Wan 2.1 and 2.2 pipelines (both T2V and I2V), significantly reducing host overhead during the denoising loop and ensuring stability under data-parallel configurations.
Key Optimizations
conditiontensors outside of the main denoising loop in the I2V pipelines (wan_pipeline_i2v_2p1.py,wan_pipeline_i2v_2p2.py) to eliminate redundantjnp.transposeandjnp.concatenatechurn on every inference step.Bug Fixes & Cleanups
use_cfg_cacheifbatch_size % data_shards != 0. Previously,cfg_cacheevaluated only the unconditional branch (dropping the batch size to 1), which caused aValueErrorinulysses_attention'sshard_mapif the user configureddata_shards > 1.print()statements withmax_logging.log()across the pipelines for cleaner distributed logging.ruffandpyinkto clean up linter warnings and unused imports.