Torch 2.8 slower than torch 1.13 for simple operations

A while back I asked a similar question here: Torch Execution Time Differences: 1.13.0 vs. 2.4.0

I noticed a significant slowdown when switching from Torch 1 to Torch 2. In another post ( Torch gets slower when upgrading the version - #7 by joshua_marqo ), a similar issue was also discussed.

In both discussions, runtime measurements seem to be problematic or inaccurate according to @ptrblck. Sadly, he didn’t provide any details on how to properly measure execution time - at least I couldn’t figure out how to measure it based on his descriptions.

Would be really interested in understanding these changes.