Skip to content

Fix DORT CI according to torch-nightly changes #2125

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

Merged
merged 1 commit into from
Mar 24, 2025
Merged
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
11 changes: 4 additions & 7 deletions onnxscript/tools/training_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
# Licensed under the MIT License.
# --------------------------------------------------------------------------
import torch
from torch.onnx import ExportOptions
from torch.onnx import _OrtBackend as OrtBackend
from torch.onnx import _OrtBackendOptions as OrtBackendOptions
from torch.onnx import _OrtBackend, _OrtBackendOptions


def make_aot_ort(dynamic: bool = False):
def make_aot_ort():
"""Implements an autograd backend for torch.compile based on onnxrt backend."""
export_options = ExportOptions(dynamic_shapes=dynamic)
options = OrtBackendOptions(export_options=export_options)
ort_backend = OrtBackend(options=options)
options = _OrtBackendOptions()
ort_backend = _OrtBackend(options=options)
return ort_backend


Expand Down
2 changes: 1 addition & 1 deletion onnxscript/tools/transformers_models/phi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_phi_dort_static(self):
input_tensors = input_tensors_many[0]
expected = model(*input_tensors)

local_aot_ort = onnxscript.tools.training_helper.make_aot_ort(dynamic=False)
local_aot_ort = onnxscript.tools.training_helper.make_aot_ort()

compiled_model = torch.compile(
copy.deepcopy(model),
Expand Down
Loading