I don’t think you need to rebuild PyTorch from source to be able to use the profiler (via Kineto), but might be wrong. In any case, profiling via e.g. Nsight Systems would also work using the PyTorch binaries, which would help isolate the bottleneck.