I came across this torch.cuda.utilization() function to measure the GPU utilization. What’s the sample period between each measurement? If i want to measure the utilization of specific two operation do i manually add time.sleep() to ensure that utilization doesn’t get affected?
torch.Op1()
torch.cuda.utilization(0) # To get GPU utilization of Op1
time.sleep(1)
torch.Op2()
torch.cuda.utilization(0) #To get GPU utilization of Op2
Does this work roughly?