Make CogVideoX RoPE implementation consistent#9963
Merged
Conversation
DN6
reviewed
Nov 19, 2024
DN6
approved these changes
Nov 19, 2024
Contributor
Author
|
Gentle ping to @zRzRzRzRzRzRzR. Maybe @kijai as well to reflect downstream but I'm assuming you've done that already |
Contributor
Author
|
Running slow tests now to confirm all checkpoints still work as expected |
Contributor
Author
|
All outputs are matching for 1.0 and 1.5 implementations, so looks good to merge. Failing test is unrelated |
This was referenced Nov 19, 2024
Merged
sayakpaul
pushed a commit
that referenced
this pull request
Dec 23, 2024
* update cogvideox rope implementation * apply suggestions from review
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.
What does this PR do?
CogVideoX 1.5 models use a slightly different RoPE implementation compared to 1.0. When we merged the CogVideoX 1.5 PR, this was the status of RoPE implementations:
All models still worked as expected and there weren't any bugs. This PR just makes sure that 1.5 T2V uses 1.5 RoPE implementation (the reason why it still worked before is because linspace and slice implementation are equivalent at the 1360x768 resolution, which is the only resolution 1.5 T2V supports, but differ otherwise). The 1.5 T2V needs to use sliced implementation though to keep things consistent with the original code base (even though the outputs match with 1.0 implementation).
The config for 1.5 T2V on the official checkpoints has been correctly updated (https://huggingface.co/THUDM/CogVideoX1.5-5B/commit/6b80d8556f820bf58e4e9719ec71450aff55c246), but unless we also make these changes, it will become incompatible. So requesting a speedy merge @DN6