trunk/6d164731740e201b9c3f3c6422b14557160ab006: Fix _maybe_view_chunk_cat view shape for negative gather_dim (#194865)
- PyTorch: 118 events in the last 90 days
- PyTorch: 117th Release in the last 90 days
- Previous: earlier the same day · v2.14.0-rc10: [cuDNN] Add guards for cuDNN SDPA decode (#194963)
What happened
Fixes #194856 _maybe_view_chunk_cat builds the view target shape with shape[gather_dim + 1:] , which wraps around for gather_dim == -1 ( shape[0:] re-appends the whole shape), so all_gather_single(x, gather_dim=-1, ...) raises RuntimeError: shape '[...]' is invalid for input of size ... whenever the view optimization is eligible. The numel_between guard ( if gather_dim > 1 else 1 ) mis-hands negative dims into the v…
Summary assembled by rule from the sources below