Skip to content

Commit d5f5591

Browse files
Olivia-liufacebook-github-bot
authored andcommitted
"CLI" aka a script to run the Inspector (#546)
Summary: Not a CLI strictly speaking, but should be good enough for MVP. Differential Revision: D49758493
1 parent ee7ae7d commit d5f5591

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ dependencies=[
1212
"hypothesis",
1313
"numpy",
1414
"packaging",
15+
"pandas",
1516
"parameterized",
1617
"pytest",
1718
"pytest-xdist",
1819
"pyyaml",
1920
"ruamel.yaml",
2021
"sympy",
22+
"tabulate",
2123
"tomli",
2224
"zstd",
25+
2326
]
2427

2528
[tool.setuptools.package-data]

sdk/etdb/TARGETS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
12
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
23

34
oncall("executorch")
@@ -20,6 +21,12 @@ python_library(
2021
],
2122
)
2223

24+
python_binary(
25+
name = "inspector_cli",
26+
main_src = "inspector_cli.py",
27+
deps = [":inspector"],
28+
)
29+
2330
python_library(
2431
name = "inspector_utils",
2532
srcs = [

sdk/etdb/inspector_cli.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
import argparse
8+
9+
from executorch.sdk.etdb.inspector import Inspector
10+
11+
if __name__ == "__main__":
12+
parser = argparse.ArgumentParser()
13+
parser.add_argument(
14+
"--etdump_path",
15+
required=True,
16+
help="Provide an ETDump file path.",
17+
)
18+
parser.add_argument(
19+
"--etrecord_path",
20+
required=False,
21+
help="Provide an optional ETRecord file path.",
22+
)
23+
24+
args = parser.parse_args()
25+
26+
inspector = Inspector(
27+
etdump_path=args.etdump_path, etrecord_path=args.etrecord_path
28+
)
29+
inspector.print_data_tabular()

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def run(self):
5757
"executorch/backends": "backends",
5858
"executorch/exir": "exir",
5959
"executorch/schema": "schema",
60+
"executorch/sdk": "sdk",
6061
"executorch/extension": "extension",
6162
"executorch/bundled_program": "bundled_program",
6263
"tosa": "backends/arm/third-party/serialization_lib/python/tosa",

0 commit comments

Comments
 (0)