Conversation
| return noise_pred_merged, noise_cond | ||
|
|
||
|
|
||
| def nearest_interp(src, target_len): |
There was a problem hiding this comment.
Do you think it's better to move this to utils?
There was a problem hiding this comment.
Not sure its purpose fits into any of the existing utils file. One option is to create a separate wan_magcache_utils.py file and move nearest_interp, init_magcache and magcache_step methods into it (this can help keep wan_pipeline.py cleaner).
If the current approach seems ok, we can keep it as it is.
There was a problem hiding this comment.
The nearest_interp seems like something that could be used by others in the future
There was a problem hiding this comment.
Which file do you suggest to move this into?
|
@syhuang22 can you help review that the changes in this PR do not impact CFG Cache? |
|
Ran the CFG test here to see if anything was affected, the test passed so the current change doesn't impact CFG cache. |
This PR adds support for Magnitude Aware Caching (An inference acceleration technique designed to speed up Diffusion models like Wan 2.1 by skipping heavy model passes).
Reference: https://github.com/Zehong-Ma/MagCache/tree/main/MagCache4Wan2.1
Details about implementation and validation related experiments can be found here: go/magcache
MagCache support for WAN 2.2 shall be added in the upcoming PRs