Skip to content

Basic "CLI" #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ dependencies=[
"hypothesis",
"numpy",
"packaging",
"pandas",
"parameterized",
"pytest",
"pytest-xdist",
"pyyaml",
"ruamel.yaml",
"sympy",
"tabulate",
"tomli",
"zstd",
]
Expand Down
7 changes: 7 additions & 0 deletions sdk/inspector/TARGETS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")

oncall("executorch")
Expand All @@ -20,6 +21,12 @@ python_library(
],
)

python_binary(
name = "inspector_cli",
main_src = "inspector_cli.py",
deps = [":inspector"],
)

python_library(
name = "inspector_utils",
srcs = [
Expand Down
29 changes: 29 additions & 0 deletions sdk/inspector/inspector_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import argparse

from executorch.sdk.inspector.inspector import Inspector

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--etdump_path",
required=True,
help="Provide an ETDump file path.",
)
parser.add_argument(
"--etrecord_path",
required=False,
help="Provide an optional ETRecord file path.",
)

args = parser.parse_args()

inspector = Inspector(
etdump_path=args.etdump_path, etrecord_path=args.etrecord_path
)
inspector.print_data_tabular()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def run(self):
"executorch/backends": "backends",
"executorch/exir": "exir",
"executorch/schema": "schema",
"executorch/sdk": "sdk",
"executorch/extension": "extension",
"executorch/bundled_program": "bundled_program",
"tosa": "backends/arm/third-party/serialization_lib/python/tosa",
Expand Down