Skip to content

Fix Wan AccVideo/CausVid fuse_lora #11856

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

Merged
merged 6 commits into from
Jul 4, 2025
Merged

Fix Wan AccVideo/CausVid fuse_lora #11856

merged 6 commits into from
Jul 4, 2025

Conversation

a-r-r-o-w
Copy link
Member

@a-r-r-o-w a-r-r-o-w commented Jul 3, 2025

Both AccVideo and CausVid work on my end with fuse_lora.

@apolinario Could you give this a try and see if it resolves the issue you faced?

@a-r-r-o-w a-r-r-o-w requested a review from sayakpaul July 3, 2025 13:39
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@apolinario
Copy link
Collaborator

Both commits fix the issue of not allowing fuse_lora on CausVid and AccVid

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Aryan!

if key.endswith((".diff", ".diff_b")) and "norm" in key:
# NOTE: we don't support this because norm layer diff keys are just zeroed values. We can support it
# in future if needed and they are not zeroed.
original_state_dict.pop(key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker but might just quickly zero if it's all zeros:

zero_status_pe = state_dict_all_zero(state_dict, "position_embedding")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the original codebases where this comes from, I don't think these keys can be anything but zero and yesterday's investigation revealed the same. Probably best to not do anything else here IMO

original_state_dict.pop(key)
logger.debug(f"Removing {key} key from the state dict as it is a norm diff key. This is unsupported.")

if "time_projection" in key and not has_time_projection_weight:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠

@a-r-r-o-w
Copy link
Member Author

For some reason the tests fail with the latest main merged. It's again one of those errors that when I try to reproduce locally, just passes. If I run the test alone, it passes. If I run all the tests, the test fails. 😢

@sayakpaul
Copy link
Member

@a-r-r-o-w yeah the VACE tests seem to be a bit flaky and I currently don't have an idea why. So, feel free to merge. We can also mark the tests with is_flaky for the moment.

@a-r-r-o-w a-r-r-o-w merged commit 425a715 into main Jul 4, 2025
15 checks passed
@a-r-r-o-w a-r-r-o-w deleted the lora/fix-wan branch July 4, 2025 15:40
tolgacangoz pushed a commit to tolgacangoz/diffusers that referenced this pull request Jul 5, 2025
* fix

* actually, better fix

* empty commit; trigger tests again

* mark wanvace test as flaky
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.

4 participants