Here’s a fix Bring back old algorithm for sorting on small number of segments by zasdfgbnm · Pull Request #64127 · pytorch/pytorch · GitHub 4, it has a link to the issue describing regression and the issue has a link to original PR introducing it.
Pytorch is calling into cub for almost all (and definitely all large) inputs.