modelscope / modelscope/DiffSynth-Studio
`RuntimeError: Sizes of tensors must match` during `torch.cat` when using `deepspeed_stage_3`
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.1k
- Forks
- 1.3k
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 45
Description
When using deepspeed_stage_3 as the training strategy, I encounter a runtime error:
x = torch.cat([cache_x, x], dim=2)
RuntimeError: Sizes of tensors must match except in dimension 2. Expected size 384 but got size 96 for tensor number 1 in the list.
This does not happen with deepspeed_stage_2 or auto.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the torch.cat([cache_x, x], dim=2) call and reproduce the failure with the deepspeed_stage_3 training strategy, comparing the tensor shapes with deepspeed_stage_2 and auto. Done means the size mismatch is resolved for stage 3 and the reported runtime error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100