.to() doesn’t necessarily involve cross-device copying, and I wouldn’t expect it here. I’d guess it is either to(dtype=int) form or no-op protective calls (like x=x.to(y)). Chrome trace or nvtx profiling mode would tell you more about these calls.



 marcortiz11:

One of the possible reasons is that GPU may be sending back to CPU profiling information. Is that true?


I don’t think this would be directly recorded, this would imply messed up profiling report.