Skip to content
Open
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
1 change: 1 addition & 0 deletions backends/apple/coreml/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ runtime.python_library(
"//executorch/exir/backend:partitioner",
"//executorch/exir/backend:utils",
"//executorch/export:lib",
"//executorch/runtime:runtime", # @manual
],
)

Expand Down
1 change: 1 addition & 0 deletions backends/qualcomm/recipes/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ runtime.python_library(
deps = [
"//caffe2:torch",
"//executorch/export:lib",
"//executorch/runtime:runtime", # @manual
"//executorch/backends/qualcomm/partition:partition",
"//executorch/backends/qualcomm/serialization:serialization",
"//executorch/backends/qualcomm/utils:utils",
Expand Down
1 change: 1 addition & 0 deletions backends/xnnpack/recipes/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ runtime.python_library(
deps = [
"//caffe2:torch",
"//executorch/export:lib",
"//executorch/runtime:runtime", # @manual
"//executorch/backends/xnnpack/quantizer:xnnpack_quantizer",
"//executorch/backends/xnnpack/partition:xnnpack_partitioner",
":xnnpack_recipe_types",
Expand Down
1 change: 1 addition & 0 deletions backends/xnnpack/test/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ runtime.python_test(
deps = [
"//executorch/backends/xnnpack/recipes:xnnpack_recipes",
"//executorch/export:lib",
"//executorch/runtime:runtime", # @manual
"//pytorch/vision:torchvision", # @manual
"//executorch/backends/xnnpack/test/tester:tester",
"//executorch/examples/models:models", # @manual
Expand Down
1 change: 1 addition & 0 deletions devtools/etrecord/tests/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ runtime.python_library(
"//executorch/exir/tests:models",
"//executorch/backends/xnnpack/partition:xnnpack_partitioner",
"//executorch/export:lib",
"//executorch/runtime:runtime", # @manual
],
)
1 change: 0 additions & 1 deletion export/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ runtime.python_library(
":recipe",
":stages",
":types",
"//executorch/runtime:runtime",
":recipe_registry"
]
)
Expand Down
11 changes: 9 additions & 2 deletions export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,15 @@ def run_method(
Raises:
RuntimeError: If the method cannot be loaded
"""
# Lazy import to avoid forcing portable_lib dependency at module load time
from executorch.runtime import Runtime, Verification
# Lazy import to avoid forcing portable_lib dependency at module load time.
try:
from executorch.runtime import Runtime, Verification
except ModuleNotFoundError as e:
raise ModuleNotFoundError(
"executorch.runtime is not available. "
"In OSS: Please ensure executorch is properly installed via pip. "
"In fbcode: Please add //executorch/runtime:runtime to your dependencies."
) from e

et_runtime = Runtime.get()
program = et_runtime.load_program(
Expand Down
Loading