Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Dec 9, 2024
1 parent 2723460 commit b846e9e
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions optimum_benchmark/trackers/latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ def elapsed(self):

@contextmanager
def track(self):
assert self.start_time is not None, "This method can only be called inside of a '.session()' context"

if self.is_pytorch_cuda:
start_event = torch.cuda.Event(enable_timing=True)
end_event = torch.cuda.Event(enable_timing=True)
Expand Down Expand Up @@ -338,8 +336,6 @@ def elapsed(self):

@contextmanager
def track(self):
assert self.start_time is not None, "This method can only be called inside of a '.session()' context"

if self.is_pytorch_cuda:
start_event = torch.cuda.Event(enable_timing=True)
end_event = torch.cuda.Event(enable_timing=True)
Expand All @@ -359,8 +355,6 @@ def track(self):
self.per_token_end_events.extend(self.per_token_events[1:])

def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor):
assert self.start_time is not None, "This method can only be called inside of a '.session()' context"

if self.is_pytorch_cuda:
event = torch.cuda.Event(enable_timing=True)
event.record()
Expand Down Expand Up @@ -486,8 +480,6 @@ def elapsed(self):

@contextmanager
def track(self):
assert self.start_time is not None, "This method can only be called inside of a '.session()' context"

if self.is_pytorch_cuda:
start_event = torch.cuda.Event(enable_timing=True)
end_event = torch.cuda.Event(enable_timing=True)
Expand All @@ -507,8 +499,6 @@ def track(self):
self.per_step_end_events.extend(self.per_step_events[1:])

def __call__(self, pipeline, step_index, timestep, callback_kwargs):
assert self.start_time is not None, "This method can only be called inside of a '.session()' context"

if self.is_pytorch_cuda:
event = torch.cuda.Event(enable_timing=True)
event.record()
Expand Down

0 comments on commit b846e9e

Please sign in to comment.