Nsys CLI profile python will be wrong

I try to use Nsight System CLI to profile a python file which used hugging face transformer inside and calling cuda backend.

However, I got this error, seem the nsys doesn’t think python is a executable\application?

and the sample python codes are like:

from transformers import AutoTokenizer, AutoModel

model_path = "test_model_path"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModel.from_pretrained(model_path , trust_remote_code=True).half().cuda()
response, history = model.chat(tokenizer, "hello", history=[])
print(response)

That is the standard way people profile python codes. I’m sure you covered all of this, but a couple of simple questions. Do you also have a directory named python in the location you are calling nsys from? Are you sure that “which python” works from here?

Also you seem to be running in an Admin pathway w/o admin privileges, have you tried with admin?

hi @hwilper, thanks for your reply.

here is my command in root powershell on my windows.

it could answer your questions i guess:

OS: windows 11
CUDA: 11.8
Nsight Systems: 2023.2.3.1001-32894139v0
GPU: RTX 4070 Laptop (BTW, seems CUDA toolchains are not fully-supported well on 4070,as I know CUDA debugger in Visual studio is unsupported).

I’m going to assume that what looks like a space between . and \ is just an artifact of the font.

@dofek do you have other suggestions?

hi @hwilper , still not working after removing ‘.’ & '' . BTW, i’m sure there is no space between ‘.’ & ''

FYI:

I’ll ping @dofek again.

This looks like a bug. As a workaround please provide the full path of the python executable within double quotes, e.g. “C:\Program Files\Python39\python.exe”