Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions exir/backend/test/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,16 @@ def forward(self, x):
)

buff = exec_prog.buffer

executorch_module = _load_for_executorch_from_buffer(buff)
# This line should raise an exception like
# RuntimeError: failed with error 0x12
_load_for_executorch_from_buffer(buff)
executorch_module.run_method("forward")

@vary_segments
def test_backend_with_compiler_out_of_range(self, extract_delegate_segments: bool):
with self.assertRaisesRegex(
RuntimeError,
"loading method forward failed with error 0x12",
"Failed to execute method forward, error: 0x12",
):
self.run_model_in_unsupported_backend(
extract_delegate_segments=extract_delegate_segments
Expand Down
5 changes: 3 additions & 2 deletions exir/backend/test/test_backends_lifted.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,16 @@ def forward(self, x):

buff = exec_prog.buffer

executorch_module = _load_for_executorch_from_buffer(buff)
# This line should raise an exception like
# RuntimeError: failed with error 0x12
_load_for_executorch_from_buffer(buff)
executorch_module.run_method("forward")

@vary_segments
def test_backend_with_compiler_out_of_range(self, extract_delegate_segments: bool):
with self.assertRaisesRegex(
RuntimeError,
"loading method forward failed with error 0x12",
"Failed to execute method forward, error: 0x12",
):
self.run_model_in_unsupported_backend(
extract_delegate_segments=extract_delegate_segments
Expand Down
10 changes: 6 additions & 4 deletions exir/backend/test/test_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ def forward(self, x):
)
)

executorch_module = _load_for_executorch_from_buffer(buff)
# Throw runtime error with error code 0x30, meaning delegate is incompatible.
with self.assertRaisesRegex(
RuntimeError,
"loading method forward failed with error 0x30",
"Failed to get method forward, error: 0x30",
):
executorch_module = _load_for_executorch_from_buffer(buff)
executorch_module.run_method("forward")

def test_compatibility_in_runtime_edge_program_manager(self):
class SinModule(torch.nn.Module):
Expand Down Expand Up @@ -108,9 +109,10 @@ def forward(self, x):
)
)

executorch_module = _load_for_executorch_from_buffer(buff)
# Throw runtime error with error code 0x30, meaning delegate is incompatible.
with self.assertRaisesRegex(
RuntimeError,
"loading method forward failed with error 0x30",
"Failed to get method forward, error: 0x30",
):
executorch_module = _load_for_executorch_from_buffer(buff)
executorch_module.run_method("forward")
Loading
Loading