← Back to events
ActiveAIRelease

trunk/6d164731740e201b9c3f3c6422b14557160ab006: Fix _maybe_view_chunk_cat view shape for negative gather_dim (#194865)

Photo: PyTorch Releases

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

Why it's spreading

Sources