Easy way to get Kineto to use the new profiler?

Hello, I’m trying out the PyTorch Profiler as per this blog post, but I get this error:

AssertionError: Requested Kineto profiling but Kineto is not available,
                  make sure PyTorch is built with USE_KINETO=1

I dug into the code to see if I could profile without Kineto but it seems the profiler requires it. Is there an easy way to get Pytorch with USE_KINETO set, or does this require building from source?

6 Likes

I also hope there is a way to do that other than rebuild.

Though I don’t think that possible reading pytorch/init.cpp at 728d18f97695def22f237ce343a3a9679aca49b0 · pytorch/pytorch · GitHub.

@alannnna what pytorch version and cuda toolkit have you installed?
Profiler is available starting from pytorch 1.8.1 release

Hi,
I also encountered the same issue, I installed from the source of version 1.9.0a0 on my MacBook Air M1.
Thanks

@Elena_Neroslavskaya Pytorch 1.8.1, no CUDA toolkit as I was just trying it out on Mac.

Did installing 1.9.0a0 from source fix it for you, or are you saying you had the same problem when you installed that version? Thanks.

Hey, I also have the same problem (torch 1.8.1 on windows). Does anyone have a solution to this?

I also encounter the same problem on torch1.8.1 with cuda on windows, is any solution?

Got the same problem here. 1.8.1.

Installed using command: pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

I had the same issue. As a workaround I’ve switched to the legacy API
torch.autograd.profiler.profile()
and then it worked.