Skip to content

Commit

Permalink
use nvtx.range_start
Browse files Browse the repository at this point in the history
  • Loading branch information
FindHao committed Dec 13, 2024
1 parent 1b51626 commit 76953d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tritonbench/components/ncu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def do_bench_in_task(
x.grad = None
# we clear the L2 cache before run
cache.zero_()
with cuda_profiler_range(use_cuda_profiler_range), torch.cuda.nvtx.range(
range_name
):
with cuda_profiler_range(use_cuda_profiler_range):
nvtx_range_id = torch.cuda.nvtx.range_start(range_name)
fn()
torch.cuda.nvtx.range_end(nvtx_range_id)
3 changes: 2 additions & 1 deletion tritonbench/utils/triton_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,8 @@ def service_exists(service_name):
"ncu",
"--nvtx",
"--nvtx-include",
f"{_RANGE_NAME}/",
# it is for range_start and range_end. no ending /.
f"{_RANGE_NAME}",
"--target-processes",
"all",
"--import-source",
Expand Down

0 comments on commit 76953d4

Please sign in to comment.