Skip to content

Commit c393d17

Browse files
authored
Revert "Use extension module for pybind (#13858)" (#13911)
This reverts commit 185c96a. ### Summary [PLEASE REMOVE] See [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests) for ExecuTorch PR guidelines. [PLEASE REMOVE] If this PR closes an issue, please add a `Fixes #<issue-id>` line. [PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: <area>" label. For a list of available release notes labels, check out [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests). ### Test plan [PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.
1 parent 0b4de82 commit c393d17

File tree

5 files changed

+290
-81
lines changed

5 files changed

+290
-81
lines changed

exir/backend/test/test_backends.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,16 @@ def forward(self, x):
319319
)
320320

321321
buff = exec_prog.buffer
322-
executorch_module = _load_for_executorch_from_buffer(buff)
322+
323323
# This line should raise an exception like
324324
# RuntimeError: failed with error 0x12
325-
executorch_module.run_method("forward")
325+
_load_for_executorch_from_buffer(buff)
326326

327327
@vary_segments
328328
def test_backend_with_compiler_out_of_range(self, extract_delegate_segments: bool):
329329
with self.assertRaisesRegex(
330330
RuntimeError,
331-
"Failed to get method forward, error: 0x12",
331+
"loading method forward failed with error 0x12",
332332
):
333333
self.run_model_in_unsupported_backend(
334334
extract_delegate_segments=extract_delegate_segments

exir/backend/test/test_backends_lifted.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,15 @@ def forward(self, x):
347347

348348
buff = exec_prog.buffer
349349

350-
executorch_module = _load_for_executorch_from_buffer(buff)
351350
# This line should raise an exception like
352351
# RuntimeError: failed with error 0x12
353-
executorch_module.run_method("forward")
352+
_load_for_executorch_from_buffer(buff)
354353

355354
@vary_segments
356355
def test_backend_with_compiler_out_of_range(self, extract_delegate_segments: bool):
357356
with self.assertRaisesRegex(
358357
RuntimeError,
359-
"Failed to get method forward, error: 0x12",
358+
"loading method forward failed with error 0x12",
360359
):
361360
self.run_model_in_unsupported_backend(
362361
extract_delegate_segments=extract_delegate_segments

exir/backend/test/test_compatibility.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,12 @@ def forward(self, x):
6262
)
6363
)
6464

65-
executorch_module = _load_for_executorch_from_buffer(buff)
6665
# Throw runtime error with error code 0x30, meaning delegate is incompatible.
6766
with self.assertRaisesRegex(
6867
RuntimeError,
69-
"Failed to get method forward, error: 0x30",
68+
"loading method forward failed with error 0x30",
7069
):
71-
executorch_module.run_method("forward")
70+
executorch_module = _load_for_executorch_from_buffer(buff)
7271

7372
def test_compatibility_in_runtime_edge_program_manager(self):
7473
class SinModule(torch.nn.Module):
@@ -109,10 +108,9 @@ def forward(self, x):
109108
)
110109
)
111110

112-
executorch_module = _load_for_executorch_from_buffer(buff)
113111
# Throw runtime error with error code 0x30, meaning delegate is incompatible.
114112
with self.assertRaisesRegex(
115113
RuntimeError,
116-
"Failed to get method forward, error: 0x30",
114+
"loading method forward failed with error 0x30",
117115
):
118-
executorch_module.run_method("forward")
116+
executorch_module = _load_for_executorch_from_buffer(buff)

0 commit comments

Comments
 (0)