-
Notifications
You must be signed in to change notification settings - Fork 27.7k
[DTensor] squeeze_.dim updates spec but doesn't squeeze local tensor #174136
Copy link
Copy link
Closed
Labels
bot-mislabeledIf you notice that the claude-bot mislabeled an issueIf you notice that the claude-bot mislabeled an issuebot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage bothigh prioritymodule: correctness (silent)issue that returns an incorrect result silentlyissue that returns an incorrect result silentlymodule: dtensordistributed tensor tagdistributed tensor tagoncall: distributedAdd this issue/PR to distributed oncall triage queueAdd this issue/PR to distributed oncall triage queuetriage review
Metadata
Metadata
Assignees
Labels
bot-mislabeledIf you notice that the claude-bot mislabeled an issueIf you notice that the claude-bot mislabeled an issuebot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage bothigh prioritymodule: correctness (silent)issue that returns an incorrect result silentlyissue that returns an incorrect result silentlymodule: dtensordistributed tensor tagdistributed tensor tagoncall: distributedAdd this issue/PR to distributed oncall triage queueAdd this issue/PR to distributed oncall triage queuetriage review
When squeezing on a sharded dimension,
squeeze_.dimon DTensor updates the DTensor's spec/shape but does NOT actually execute squeeze on the underlying local tensor, causing a metadata mismatch.Reproduction
Output:
DTensor claims shape
[4]but local tensor is still[1, 4].Root Cause
In
_dispatch.py,_dispatch_fast_path_python_tailhas special handling forsqueeze_.dim:This updates the spec but the local tensor is never squeezed. Manual squeeze works:
But
dt.squeeze_(0)leaves local tensor unchanged.cc @ezyang @gchanan @kadeng @msaroufim @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @dcci @aditvenk @xmfan @tianyu-l @XilunWu @SherlockNoMad @ppwwyyxx @H-Huang