Hi PyTorch forum,
I’m trying to address a bottleneck in some code of mine where a big F.max_pool1d is being applied (very long input length and long kernel length of 121). I noticed that this was a bottleneck from running in VizTracer, where I also learned that internally it’s calling into an ATen max_pool2d_with_indices. I’m running on a GPU (CUDA).
I don’t need gradients or anything, so I was wondering if it would be possible to avoid the indices. I noticed some merged PRs in PyTorch relating to implementing no-indices optimizations (like MaxPool1d without indices optimization by heitorschueroff · Pull Request #43745 · pytorch/pytorch · GitHub), and I was curious if it’s possible for end users to access those code paths from Python. I’ve tried inference_mode and set_grad_enabled(False), but I still see the with_indices function in the call stack.
Just curious if that’s possible – thanks!