Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
define_common_targets(is_fbcode = is_fbcode())
78 changes: 0 additions & 78 deletions devtools/inspector/TARGETS

This file was deleted.

80 changes: 80 additions & 0 deletions devtools/inspector/targets.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

def define_common_targets(is_fbcode = False):
if not is_fbcode:
return

runtime.python_library(
name = "inspector",
srcs = [
"_inspector.py",
],
deps = [
"fbsource//third-party/pypi/ipython:ipython",
"fbsource//third-party/pypi/numpy:numpy",
"fbsource//third-party/pypi/pandas:pandas",
"fbsource//third-party/pypi/tabulate:tabulate",
":inspector_utils",
":vgf_neural_statistics",
"//executorch/devtools/debug_format:et_schema",
"//executorch/devtools/etdump:schema_flatcc",
"//executorch/devtools/etrecord:etrecord",
"//executorch/exir:lib",
"//executorch/devtools/inspector:intermediate_output_capturer",
"//executorch/devtools/inspector/numerical_comparator:lib",
],
)

runtime.python_library(
name = "vgf_neural_statistics",
srcs = [
"vgf_neural_statistics.py",
],
)

runtime.python_binary(
name = "inspector_cli",
main_function = ".inspector_cli.main",
main_src = "inspector_cli.py",
deps = [
"//executorch/devtools:lib",
"//executorch/devtools/inspector:lib",
],
)

runtime.python_library(
name = "inspector_utils",
srcs = [
"_inspector_utils.py",
],
deps = [
"fbsource//third-party/pypi/matplotlib:matplotlib",
"fbsource//third-party/pypi/numpy:numpy",
"//caffe2:torch",
"//executorch/devtools/debug_format:base_schema",
"//executorch/devtools/debug_format:et_schema",
"//executorch/devtools/etdump:schema_flatcc",
"//executorch/devtools/etdump:serialize",
"//executorch/devtools/etrecord:etrecord",
],
)

runtime.python_library(
name = "intermediate_output_capturer",
srcs = [
"_intermediate_output_capturer.py",
],
deps = [
"//executorch/devtools/inspector:inspector_utils",
],
)

runtime.python_library(
name = "lib",
srcs = ["__init__.py"],
deps = [
":inspector",
":inspector_utils",
":vgf_neural_statistics",
],
)
9 changes: 9 additions & 0 deletions examples/devtools/scripts/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(is_fbcode = is_fbcode())
31 changes: 31 additions & 0 deletions examples/devtools/scripts/targets.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

def define_common_targets(is_fbcode = False):
if not is_fbcode:
return

runtime.python_binary(
name = "export_bundled_program",
main_function = ".export_bundled_program.main",
main_src = "export_bundled_program.py",
deps = [
"//caffe2:torch",
"//executorch/devtools:lib",
"//executorch/devtools/bundled_program:config",
"//executorch/devtools/bundled_program/serialize:lib",
"//executorch/examples/models:models",
"//executorch/extension/export_util:export_util",
],
)

runtime.python_binary(
name = "gen_sample_etrecord",
srcs = ["gen_sample_etrecord.py"],
main_function = "executorch.examples.devtools.scripts.gen_sample_etrecord.main",
deps = [
"//executorch/devtools:lib",
"//executorch/devtools/etrecord:etrecord",
"//executorch/examples/models:models",
"//executorch/exir:lib",
],
)
9 changes: 9 additions & 0 deletions extension/training/examples/CIFAR/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl.

load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets(is_fbcode = is_fbcode())
9 changes: 6 additions & 3 deletions extension/training/examples/CIFAR/targets.bzl
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

def define_common_targets():
def define_common_targets(is_fbcode = False):
"""Defines targets that should be shared between fbcode and xplat.

The directory containing this targets.bzl file should also contain both
TARGETS and BUCK files that call this function.
Originally an fbcode-only TARGETS dir; the runtime.python_binary calls
here use srcs=[...] which the xplat python_binary macro rejects, so the
body is gated on is_fbcode to preserve pre-migration behavior.
"""
if not is_fbcode:
return

runtime.python_library(
name = "model",
Expand Down
Loading