diff --git a/backends/mediatek/TARGETS b/backends/mediatek/TARGETS new file mode 100644 index 00000000000..9d3cd9459a4 --- /dev/null +++ b/backends/mediatek/TARGETS @@ -0,0 +1,26 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "preprocess", + srcs = [ + "preprocess.py" + ], + visibility = ["PUBLIC"], + deps = [ + "//executorch/exir/_serialize:lib", + "//executorch/exir/backend:backend_api", + "//executorch/exir/passes:lib", + "fbsource//third-party/mediatek/neuropilot-express-sdk:sdk", + ], +) + +runtime.python_library( + name = "partitioner", + srcs = [ + "partitioner.py" + ], + visibility = ["PUBLIC"], + deps = [ + ":preprocess", + ], +) diff --git a/backends/mediatek/_passes/TARGETS b/backends/mediatek/_passes/TARGETS new file mode 100644 index 00000000000..def649d8857 --- /dev/null +++ b/backends/mediatek/_passes/TARGETS @@ -0,0 +1,14 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "passes", + srcs = [ + "__init__.py", + "decompose_scaled_dot_product_attention.py", + ], + visibility = ["PUBLIC"], + deps = [ + "//caffe2:torch", + "//executorch/exir:pass_base", + ], +) diff --git a/backends/mediatek/quantizer/TARGETS b/backends/mediatek/quantizer/TARGETS new file mode 100644 index 00000000000..09be73cd172 --- /dev/null +++ b/backends/mediatek/quantizer/TARGETS @@ -0,0 +1,16 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +runtime.python_library( + name = "quantizer", + srcs = [ + "__init__.py", + "annotator.py", + "qconfig.py", + "quantizer.py", + ], + visibility = ["PUBLIC"], + deps = [ + "//pytorch/ao:torchao", + "//executorch/backends/mediatek/_passes:passes", + ], +) diff --git a/backends/mediatek/runtime/BUCK b/backends/mediatek/runtime/BUCK new file mode 100644 index 00000000000..d395eb07786 --- /dev/null +++ b/backends/mediatek/runtime/BUCK @@ -0,0 +1,33 @@ +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain xplat-only targets. + +load( + "@fbsource//tools/build_defs:default_platform_defs.bzl", + "ANDROID", +) +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +runtime.cxx_library( + name = "neuron_backend", + srcs = [ + "NeuronBackend.cpp", + "NeuronBufferAllocator.cpp", + "NeuronExecutor.cpp", + ], + headers = glob([ + "include/**/*.h", + ]), + include_directories = ["include"], + deps = [ + "fbsource//third-party/mediatek/neuropilot-express-sdk:runtime_api", + "//executorch/runtime/backend:interface", + "//executorch/runtime/core:memory_allocator", + "//executorch/runtime/executor:pte_data_map", + ], + define_static_target = True, + link_whole = True, + platforms = [ANDROID], + visibility = ["PUBLIC"], +) diff --git a/backends/mediatek/runtime/TARGETS b/backends/mediatek/runtime/TARGETS new file mode 100644 index 00000000000..e69de29bb2d