Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use nsys? #399

Open
vedantroy opened this issue Jun 13, 2024 · 1 comment
Open

How to use nsys? #399

vedantroy opened this issue Jun 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vedantroy
Copy link

vedantroy commented Jun 13, 2024

Is there a recommended way to use nsys / nsight? I know there's a profiling hook for using the Pytorch profiler, but I'm wondering how to use nsys instead.

Can I use these APIs:

with torch.autograd.profiler.emit_nvtx():
    profiler.start()
    y = x.view(1, -1)
    z = x.to(memory_format=torch.channels_last)
    zz = z.reshape(1, -1)
    profiler.stop()

Furthermore, I'm not sure which of the below I'm supposed to use:

    import torch.cuda.profiler as profiler
    with torch.autograd.profiler.emit_nvtx():
@tianyu-l tianyu-l added the enhancement New feature or request label Jun 24, 2024
@yifuwang
Copy link
Contributor

Hey @vedantroy, IIUC emit_nvtx is just adding addititonal information into the trace. To actually profile your program with nsys, you have start your program with it (e.g., nsys profile --gpu-metrics-device=0 -o [output] [command]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants