Note that CUDA kernels are executed asynchronously.
If you would like to time them, you should call torch.cuda.synchronize() before starting and stopping the timer.
Otherwise, you might e.g. just time the kernel launch time.