Skip to content

Commit

Permalink
rename according to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tfogal committed Nov 1, 2024
1 parent 8d803ae commit a6d2d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions thunder/core/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def add_markers(msg: str) -> None:
# but alternatively as a `with` context:
# with thunder.core.profile.profile("name for a block of code"):
# # ... code ...
profile: Callable[[str], None] = None
annotate_for_profile: Callable[[str], None] = None


if _ENABLED:
profile = functools.partial(nvtx.annotate, domain="thunder")
annotate_for_profile = functools.partial(nvtx.annotate, domain="thunder")
else:

class _no_annotate(contextlib.nullcontext):
Expand All @@ -70,4 +70,4 @@ def __init__(self, *args, **kwargs):
def __call__(self, fqn):
return fqn

profile = _no_annotate
annotate_for_profile = _no_annotate
2 changes: 1 addition & 1 deletion thunder/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2970,7 +2970,7 @@ def fn():


def test_profiling_decorator():
@thunder.core.profile.profile("compile_and_run")
@thunder.core.profile.annotate_for_profile("compile_and_run")
def foo():
def bar(a: torch.Tensor):
t0 = torch.add(a, 42)
Expand Down

0 comments on commit a6d2d07

Please sign in to comment.