Trim profiler file paths (#51192)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51192
Trim profiler file paths when using stack traces
Test Plan:
python test/test_profiler.py -k test_source
```
SumBackward0 0.02% 6.000us 0.51% 154.000us 154.000us 1 test/test_profiler.py(91): test_source
...conda3/envs/pytorch/lib/python3.8/unittest/case.py(633): _callTestMethod
...r/local/miniconda3/envs/pytorch/lib/python3.8/unittest/case.py(676): run
...al/miniconda3/envs/pytorch/lib/python3.8/unittest/case.py(736): __call__
.../local/miniconda3/envs/pytorch/lib/python3.8/unittest/suite.py(122): run
```
Reviewed By: ngimel
Differential Revision: D26113905
Pulled By: ilia-cher
fbshipit-source-id: 2b71c31b6c4437855d33013d42d977745e6f489f