How to know pytouch run on CUDA core or Tensor Core?

How to know if a model is run in CUDA cores or Tensor Core?

When we give the following code, model goes to CUDA cores.

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") 
model = model.to(device)

and then can check by using next(model.parameters()).is_cuda.

How to run a model in tensor cores? and how to check if it runs in tensor cores.

You can benefit from nvprof by Nvidia to profile it.

Please provide any examples with nvprof

Actually I haven’t tried yet. This package is provided by Nvidia and there are some tutorials on their developer website.

https://youtu.be/yyR0ZoCeBO8

ICYMI, please follow up in this thread here: Does pytorch use tensor cores by default? - #2 by eqy