[pyper] fuse clip_ranges+gather_ranges (#52461)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52461
TODO: add tests
Test Plan:
Before:
7.10623 ms/iter
0.0849279 ms. 1.21267%. fb::clip_ranges (212 nodes)
0.254071 ms. 3.62783%. fb::gather_ranges (214 nodes)
After:
7.0654 ms/iter
0.300174 ms. 4.2739%. fb::clip_ranges_gather (264 nodes)
Reviewed By: hlu1
Differential Revision: D26523903
fbshipit-source-id: 9b2420c522232659b198cbe250d4454bbcd9297b