Skip to content

Commit

Permalink
Switch benchmarking to use export non-strict mode (#130977)
Browse files Browse the repository at this point in the history
Summary:
Switch the export part used by AOTInductor benchmarking from strict to non-strict, and switch it from producing torch IR to aten IR.

X-link: pytorch/pytorch#130977
Approved by: https://github.com/angelayi
ghstack dependencies: #134639

Reviewed By: ZainRizvi

Differential Revision: D62009176

Pulled By: desertfire

fbshipit-source-id: 72cb7b2f4ef8297537a932f30010ebcb46e12935
  • Loading branch information
desertfire authored and facebook-github-bot committed Aug 30, 2024
1 parent e6251f1 commit 1f4461f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions userbenchmark/dynamo/dynamobench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,14 +1364,13 @@ def load(cls, model, example_inputs, device):
else:
_register_dataclass_output_as_pytree(example_outputs)

# TODO(angelayi): change this to predispatch
# https://github.com/pytorch/pytorch/issues/127513 needs to be fixed before changing
# to predispatch to avoid performance regressions
gm = torch.export._trace._export_to_torch_ir(
gm = torch.export._trace._export(
model,
example_args,
example_kwargs,
)
pre_dispatch=True,
strict=False,
).module()
with torch.no_grad():
so_path = torch._inductor.aot_compile(
gm, example_args, example_kwargs
Expand Down

0 comments on commit 1f4461f

Please sign in to comment.