Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reset dynamo option #125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tritonbench/operators/embedding/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(
# they are generated later
self.baseline_op = None
self.liger_op = None
self.reset_dynamo = True

def get_input_iter(self) -> Generator:
for B, T, D in [(32, 512, 768), (8, 2048, 4096)]:
Expand Down
4 changes: 4 additions & 0 deletions tritonbench/utils/triton_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ class BenchmarkOperator(metaclass=PostInitProcessor):
example_inputs: Any = None
use_cuda_graphs: bool = False
is_compute_bound = True
# reset dynamo to avoid errors like https://github.com/pytorch-labs/tritonbench/issues/90
reset_dynamo = False

"""
A base class for adding operators to torch benchmark.
Expand Down Expand Up @@ -729,6 +731,8 @@ def run(
self.example_inputs = self.get_example_inputs()
for input_id in input_id_range:
self.example_inputs = self.get_example_inputs()
if self.reset_dynamo:
torch._dynamo.reset()
x_val = self.get_x_val(self.example_inputs)
if "proton" in self.required_metrics:
proton.activate(self._proton_session_id)
Expand Down
Loading