Make CogVideoX RoPE implementation consistent #9963
Merged
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