mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
Fix a backend test by using local backend (#19230)
The decomposition pass (e.g., converting torch.add to aten.add) in DORT no longer exists. Therefore, we have to use `use_aot_autograd=True` to enable Dynamo's built-in operator decomposition. I think we need to add the decomposition pass back to DORT or remove `use_aot_autograd` (remove because it will always be `true`).
This commit is contained in:
parent
f53068446e
commit
532f8c642c
1 changed files with 6 additions and 1 deletions
|
|
@ -216,7 +216,12 @@ class TestTorchDynamoOrt(unittest.TestCase):
|
|||
tensor_q = tensor_p.relu()
|
||||
return tensor_q
|
||||
|
||||
local_backend = make_local_backend(dynamic=True, use_aot_autograd=False)
|
||||
# TODO: Set use_aot_autograd=False. In order to decompose torch
|
||||
# function calls to aten ops, we need to set
|
||||
# user_aot_autograd=True because there is no decomposition in DORT
|
||||
# anymore. A long-term fix will be brining # decomposition pass back
|
||||
# into DORT.
|
||||
local_backend = make_local_backend(dynamic=True, use_aot_autograd=True)
|
||||
optimized_elementwise_model = torch.compile(elementwise_model, backend=local_backend, dynamic=True)
|
||||
|
||||
def run(fun, list_x):
|
||||
|
|
|
|||
Loading…
Reference in a new issue