Skip to content

Commit f4ed04f

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
Pybindings Module is more flexible with non_const set ups (#109)
Summary: Pull Request resolved: #109 Made the module handle models with more then one non_const buffer level, and made it allocate the needed memory dynamically rather then relying on static constants which historically have needed to be updated a ton. Reviewed By: guangy10 Differential Revision: D48583639 fbshipit-source-id: bd39606cf818e12f427b94a53162f4c16df4db73
1 parent ef94eed commit f4ed04f

File tree

3 files changed

+151
-122
lines changed

3 files changed

+151
-122
lines changed

extension/pybindings/TARGETS

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Any targets that should be shared between fbcode and xplat must be defined in
33
# targets.bzl. This file can contain fbcode-only targets.
44

5-
load("@fbcode//executorch/extension/pybindings:targets.bzl", "MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB", "MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB", "MODULE_DEPS", "define_common_targets", "executorch_pybindings")
5+
load("@fbcode//executorch/extension/pybindings:targets.bzl", "ATEN_MODULE_DEPS", "MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB", "MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB", "PORTABLE_MODULE_DEPS", "define_common_targets", "executorch_pybindings")
66
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
77

88
define_common_targets()
@@ -11,7 +11,7 @@ executorch_pybindings(
1111
srcs = [
1212
"module.cpp",
1313
],
14-
cppdeps = MODULE_DEPS,
14+
cppdeps = PORTABLE_MODULE_DEPS,
1515
python_module_name = "core",
1616
visibility = ["PUBLIC"],
1717
)
@@ -20,7 +20,7 @@ executorch_pybindings(
2020
srcs = [
2121
"module.cpp",
2222
],
23-
cppdeps = MODULE_DEPS + MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB,
23+
cppdeps = PORTABLE_MODULE_DEPS + MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB,
2424
python_module_name = "portable",
2525
visibility = ["PUBLIC"],
2626
)
@@ -29,20 +29,7 @@ executorch_pybindings(
2929
srcs = [
3030
"module.cpp",
3131
],
32-
cppdeps = [
33-
"//executorch/runtime/kernel:operator_registry",
34-
"//executorch/runtime/executor:executor_aten",
35-
"//executorch/runtime/core/exec_aten:lib",
36-
"//executorch/schema:bundled_program_schema",
37-
"//executorch/schema:program",
38-
"//executorch/extension/data_loader:buffer_data_loader",
39-
"//executorch/extension/data_loader:mmap_data_loader",
40-
"//executorch/util:read_file",
41-
"//executorch/util:test_memory_config",
42-
"//executorch/util:bundled_program_verification_aten",
43-
"//caffe2:torch-cpp",
44-
"//executorch/runtime/executor/test:test_backend_compiler_lib_aten",
45-
] + MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB,
32+
cppdeps = ATEN_MODULE_DEPS + MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB,
4633
python_module_name = "aten_mode_lib",
4734
visibility = ["PUBLIC"],
4835
)

0 commit comments

Comments
 (0)