Hi,
I am not sure how the pytest benchmark utilities are working but they are most likely not doing proper cuda synchronization. So you most likely want to add the proper calls there (for pytorch torch.cuda.synchronize(), not sure for cupy).
Also maybe you want to remove all the data initialization from the benchmark? Or do you actually care about that?
These will add extra variance as they need to perform cpu/gpu synchronization.
Also code-wise, the problem is that your two implementation do different things so that might explain the perf difference between the two.
Have you tries running the numpy code with pytorch directly (the content of the for loop). All these advanced indexing ops should work properly afaik