[BUG]Fix the error issue for q/k/v stride is not match for non FPDT scenarios.#469
Merged
tjruwase merged 1 commit intodeepspeedai:mainfrom Aug 14, 2025
Merged
Conversation
Signed-off-by: yisheng <yi.sheng@intel.com>
|
@YJHMITWEB can you please help with this? Thanks |
|
@sfc-gh-truwase Sure, Tunji. I will take a look. |
|
@sfc-gh-truwase Checked Ulysses (ds sequence parallel), FPDT, and no sp, this fix looks good. There is an issue when FPDT is disabled but with original Ulysses (ds sequence parallel), I pushed a new PR#479 to fix it. |
sfc-gh-truwase
approved these changes
Aug 14, 2025
tjruwase
approved these changes
Aug 14, 2025
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.
Hi, we met the error issues when not enable sequence_parallel. The error info can see below:
[rank11]: File "/home/yisheng/jira_6035/llm.devkit/Megatron-DeepSpeed/megatron/model/transformer.py", line 301, in forward
[rank11]: query_layer = query_layer.view(output_size[2],
[rank11]: RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
When goes to the path:
https://github.com/deepspeedai/Megatron-DeepSpeed/blob/main/megatron/model/transformer.py#L734
the stride is not match here:
https://github.com/deepspeedai/Megatron-DeepSpeed/blob/main/megatron/model/transformer.py#L301
So I add the default path here to fix this issues.