Ejemplo n.º 1
0
 def config(self):
     return ProfilerConfig(
         self.profiler_kind,
         self.record_shapes,
         self.profile_memory,
         self.with_stack,
         self.with_flops,
         self.with_modules,
         self.experimental_config)
Ejemplo n.º 2
0
 def config(self):
     return ProfilerConfig(
         self.profiler_kind,
         self.record_shapes,
         self.profile_memory,
         self.with_stack,
         self.with_flops,
         self.with_modules,
         # avoid exposing _ExperimentalConfig this in legacy public API
         torch._C._autograd._ExperimentalConfig(),
     )
Ejemplo n.º 3
0
 def __enter__(self):
     if not self.enabled:
         return
     if self.entered:
         raise RuntimeError(
             "ITT annotation context manager is not reentrant")
     self.entered = True
     _enable_profiler(
         ProfilerConfig(ProfilerState.ITT, self.record_shapes, False, False,
                        False, False, _ExperimentalConfig()), set())
     return self
Ejemplo n.º 4
0
 def __enter__(self):
     if not self.enabled:
         return
     if self.entered:
         raise RuntimeError(
             "NVTX annotation context manager is not reentrant")
     self.entered = True
     torch.cuda.synchronize()
     _enable_profiler(
         ProfilerConfig(ProfilerState.NVTX, self.record_shapes, False,
                        False, False, False), set())
     return self
Ejemplo n.º 5
0
 def config(self):
     return ProfilerConfig(self.profiler_kind, self.record_shapes,
                           self.profile_memory, self.with_stack,
                           self.with_flops)