Unverified Commit 87c98b02 authored by Martin Hickey's avatar Martin Hickey Committed by GitHub
Browse files

[MyPy][BugFix] Check profiler is assigned before calling start() on it (#35505)


Signed-off-by: default avatarMartin Hickey <martin.hickey@ie.ibm.com>
Co-authored-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent de7dd634
...@@ -788,11 +788,12 @@ class Worker(WorkerBase): ...@@ -788,11 +788,12 @@ class Worker(WorkerBase):
self.profiler = CudaProfilerWrapper(self.profiler_config) self.profiler = CudaProfilerWrapper(self.profiler_config)
logger.debug("Starting CUDA profiler") logger.debug("Starting CUDA profiler")
else: else:
logger.warning("Unrecognized profiler: %s", profiler_type) # Config validation should prevent this code being reached
return raise ValueError(
self.profiler.start() f"Invalid profiler value of {self.profiler_config.profiler}"
else: )
# Profiler already initialized. Restart profiling but keep
# If profiler already initialized, restart profiling but keep
# the original trace name from the first initialization. # the original trace name from the first initialization.
self.profiler.start() self.profiler.start()
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment