Skip to content

Commit c857a54

Browse files
mergennachinfacebook-github-bot
authored andcommitted
Replace Executorch with ExecuTorch, Part 5/N (#469)
Summary: Pull Request resolved: #469 In python files comments Reviewed By: cccclai Differential Revision: D49566736 fbshipit-source-id: 2094ff15f63484b29429013636651ba24bfc4738
1 parent 749a365 commit c857a54

File tree

20 files changed

+41
-41
lines changed

20 files changed

+41
-41
lines changed

backends/xnnpack/test/tester/tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def run_method(self, method="forward"):
359359
delegated_module = self.get_artifact(self._stage_name(Partition))
360360
self.reference_output = delegated_module(*self.inputs)
361361

362-
# Executorch
362+
# ExecuTorch
363363
inputs_flattened, _ = tree_flatten(self.inputs)
364364
serialized_buffer = self.get_artifact(self._stage_name(Serialize))
365365
executorch_module = _load_for_executorch_from_buffer(serialized_buffer)

bundled_program/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class BundledExecutionPlanTest:
8484

8585
@dataclass
8686
class BundledProgram:
87-
"""Executorch program bunlded with data for verification."""
87+
"""ExecuTorch program bunlded with data for verification."""
8888

8989
# Schema version.
9090
version: int
@@ -94,5 +94,5 @@ class BundledProgram:
9494
# Its length should be equal to the number of execution plans in program.
9595
execution_plan_tests: List[BundledExecutionPlanTest]
9696

97-
# The binary data of a serialized Executorch program.
97+
# The binary data of a serialized ExecuTorch program.
9898
program: bytes

codegen/tools/gen_all_oplist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
def main(argv: List[Any]) -> None:
1717
"""This binary is a wrapper for //xplat/caffe2/tools/code_analyzer/gen_oplist.py.
1818
This is needed because we intend to error out for the case where `model_file_list_path`
19-
is empty or invalid, so that the Executorch build will fail when no selective build target
20-
is provided as a dependency to Executorch build.
19+
is empty or invalid, so that the ExecuTorch build will fail when no selective build target
20+
is provided as a dependency to ExecuTorch build.
2121
"""
2222
parser = argparse.ArgumentParser(description="Generate operator lists")
2323
parser.add_argument(
@@ -66,7 +66,7 @@ def main(argv: List[Any]) -> None:
6666
model_file_names = model_list_file.read().split()
6767
assert (
6868
len(model_file_names) > 0
69-
), "BUCK was not able to find any `et_operator_library` in the dependency graph of the current Executorch "
69+
), "BUCK was not able to find any `et_operator_library` in the dependency graph of the current ExecuTorch "
7070
"build. Please refer to Selective Build wiki page to add at least one."
7171
gen_oplist.main(argv)
7272

codegen/tools/gen_ops_def.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def dump_yaml(model_file: str, output_file: str) -> None:
6363

6464

6565
def main(args: List[Any]) -> None:
66-
"""This binary generates a template functions.yaml which will be consumed by Executorch codegen.
66+
"""This binary generates a template functions.yaml which will be consumed by ExecuTorch codegen.
6767
It reads the model file, deserialize it and dumps all the operators into a new functions.yaml.
6868
The generated file contains placeholder kernels, it needs to be updated with proper kernel names.
6969
"""

docs/source_cpp/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
############################################################################
9191
# Main library page layout example configuration. #
9292
############################################################################
93-
"afterTitleDescription": "Welcome to the Executorch's documentation.",
93+
"afterTitleDescription": "Welcome to the ExecuTorch's documentation.",
9494
}
9595

9696
# Tell sphinx what the primary language being documented is.

exir/backend/test/demos/rpc/test_rpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
"""
2626
Server can be an App Call, and will send delegate to client backend like DSP,
27-
DSP will reeive the rpc call, calls the Executorch instance (like on DSP),
27+
DSP will reeive the rpc call, calls the ExecuTorch instance (like on DSP),
2828
and return the result.
2929
3030
@@ -65,12 +65,12 @@
6565
6666
MCU
6767
——
68-
1. MCU instantiate Executorch instance with DSPBackend
68+
1. MCU instantiate ExecuTorch instance with DSPBackend
6969
2. In DSPBackend init/execute, it'll invoke the implemented RPC calls on DSP
7070
7171
DSP
7272
——
73-
3. DSP receives the RPC call and construct the Executorch instance on the DSP
73+
3. DSP receives the RPC call and construct the ExecuTorch instance on the DSP
7474
4. When dsp executor runs, it can call any delegate (e.g. Accelerator) as needed.
7575
7676
There’ll negligible overhead in binary size on the MCU, as the executor size is small.

exir/dialects/backend/_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class BackendOpOverload(EdgeOpOverload):
2626
2. backend op is stateless while delegation doesn't have to
2727
3. backend op stays in executor standard runtime but delegation doesn't have to
2828
29-
Examples for backend ops including fused ops for a specific backend, Executorch prim ops to handle symbolic shape.
29+
Examples for backend ops including fused ops for a specific backend, ExecuTorch prim ops to handle symbolic shape.
3030
3131
Note that the assumption here is that the backend op and the original callable / equivalent callable is 1 - 1 mapping.
3232

exir/dialects/edge/_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def __init__(
230230
else:
231231
# Not get the info from edge.yaml
232232
# Create a dtype constraint for this operator that allows any dtype
233-
# combinations as long as any dtype is legal in Executorch.
233+
# combinations as long as any dtype is legal in ExecuTorch.
234234
type_alias = {
235235
f"T{idx}": list(regular_tensor_str_to_dtypes.values())
236236
for idx in range(len(all_tensor_io_names))

exir/emit/_emit_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class EmitterOutput:
106106
a mapping of instruction ids to debug handles.
107107
"""
108108

109-
# The Executorch program
109+
# The ExecuTorch program
110110
program: Program
111111

112112
# This dictionary maps the instruction ids to their corresponding

exir/emit/_emitter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
"""Takes an ExportedArtifact, or a collection of ExportedArtifacts, in execution dialect, and turns
8-
them into a single Executorch Program.
8+
them into a single ExecuTorch Program.
99
1010
The provided ExportedArtifact's graph modules are in execution dialect and the emitter parses and
1111
converts them into executorch instructions. The emitter walks the provided graphs and as it
@@ -1015,7 +1015,7 @@ def _emit_delegate(
10151015
return delegate_ret
10161016

10171017
def _get_operator(self, name: str, overload: str) -> Tuple[int, Operator]:
1018-
"""Given a fully qualified name, lookups the operator in the Executorch Program, or adds it
1018+
"""Given a fully qualified name, lookups the operator in the ExecuTorch Program, or adds it
10191019
if it is not already present"""
10201020
key = (name, overload)
10211021
op_index = self.emitter_state.operator_cache.get(key)

exir/passes/memory_format_ops_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class MemoryFormatOpsPass(ExportPass):
2323
"""
2424
This pass replaces ops which takes torch.memory_format as an argument with
25-
'equivalent' op which takes dim_order. This is towards the larger Executorch
25+
'equivalent' op which takes dim_order. This is towards the larger ExecuTorch
2626
goal to move away from torch.memory_format. There is a 1:1 mapping between
2727
the aten op and the new edge dialect dim_order op.
2828
"""

exir/passes/sym_to_tensor_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class SymToTensorPass(ExportPass):
1818
"""
1919
The dispatcher implicitly converts SymInt/SymFloats to tensors, but
20-
sometimes this doesn't comply with the operator's schema which Executorch
20+
sometimes this doesn't comply with the operator's schema which ExecuTorch
2121
heavily relies on. So this pass inserts a
2222
torch.ops.aten.scalar_tensor.default operator before these SymInts are used
2323
so that it matches the schema of the operator.

exir/program/_program.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ def to_edge(
626626
class EdgeProgramManager:
627627
"""
628628
Package of one or more :class:'ExportedPrograms' in Edge dialect. Designed to simplify
629-
lowering to Executorch.
629+
lowering to ExecuTorch.
630630
631631
Allows easy applications of transforms across a collection of exported programs
632632
including the delegation of subgraphs.
633633
634-
Manages the second link in the lowering chain of ATen -> Edge -> Executorch.
634+
Manages the second link in the lowering chain of ATen -> Edge -> ExecuTorch.
635635
"""
636636

637637
# TODO(T163717152): Link to Edge dialect docs here ^.
@@ -761,11 +761,11 @@ def to_executorch(
761761
self, config: Optional[ExecutorchBackendConfig] = None
762762
) -> "ExecutorchProgramManager":
763763
"""
764-
Transforms the program to the Executorch backend.
764+
Transforms the program to the ExecuTorch backend.
765765
766766
Args:
767767
config: An optional argument used to provide greater control over
768-
the transformation to the Executorch backend.
768+
the transformation to the ExecuTorch backend.
769769
770770
Returns:
771771
ExecutorchProgramManager: A manager representing the state of the EdgeProgramManager
@@ -786,13 +786,13 @@ def to_executorch(
786786
class ExecutorchProgramManager:
787787
"""
788788
Package of one or more :class:'ExportedPrograms' in Execution dialect. Designed to simplify
789-
lowering to Executorch.
789+
lowering to ExecuTorch.
790790
791791
When the ExecutorchProgramManager is constructed the ExportedPrograms in execution dialect
792792
are used to form the executorch binary (in a process called emission) and then serialized
793793
to a buffer.
794794
795-
Manages the final link in the lowering chain of ATen -> Edge -> Executorch.
795+
Manages the final link in the lowering chain of ATen -> Edge -> ExecuTorch.
796796
"""
797797

798798
# TODO(T163717152): Link to Execution dialect docs here ^.
@@ -864,7 +864,7 @@ def exported_program(self, method_name: str = "forward") -> ExportedProgram:
864864

865865
def dump_executorch_program(self, verbose: bool = False) -> None:
866866
"""
867-
Prints the Executorch binary in a human readable format.
867+
Prints the ExecuTorch binary in a human readable format.
868868
869869
Args:
870870
verbose (bool):
@@ -884,6 +884,6 @@ def debug_handle_map(self) -> Dict[int, Union[int, List[int]]]:
884884
@property
885885
def buffer(self) -> bytes:
886886
"""
887-
Returns a buffer containing the serialized Executorch binary.
887+
Returns a buffer containing the serialized ExecuTorch binary.
888888
"""
889889
return self._buffer

exir/serde/serialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ def deserialize(
683683
) -> exir.ExportedProgram:
684684
exported_program_str = exported_program_bytes.decode("utf-8")
685685
exported_program_dict = json.loads(exported_program_str)
686-
# Executorch tests save exported program on disk when we haven't
686+
# ExecuTorch tests save exported program on disk when we haven't
687687
# provided any compatibility guarantees.
688688
if "module_call_graph" not in exported_program_dict["graph_module"]:
689689
exported_program_dict["graph_module"]["module_call_graph"] = []

extension/pybindings/test/make_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def create_program(
6060
) -> Tuple[Program, Tuple[Any, ...]]:
6161
"""Returns an executorch program based on ModuleAdd, along with inputs."""
6262

63-
# Trace the test module and create a serialized Executorch program.
63+
# Trace the test module and create a serialized ExecuTorch program.
6464
inputs = (torch.ones(2, 2), torch.ones(2, 2))
6565
input_map = {}
6666
for method in eager_module.get_methods_to_export():
@@ -74,14 +74,14 @@ def create_program(
7474
.to_executorch()
7575
)
7676

77-
# Create the Executorch program from the graph.
77+
# Create the ExecuTorch program from the graph.
7878
pretty_print(exec_prog.program)
7979
return (exec_prog, inputs)
8080

8181
######### TEST CASES #########
8282

8383
def test_e2e(tester):
84-
# Create an Executorch program from ModuleAdd.
84+
# Create an ExecuTorch program from ModuleAdd.
8585
exported_program, inputs = create_program(ModuleAdd())
8686

8787
# Use pybindings to load and execute the program.

scripts/file_size_compare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
TTY_RESET = "\033[0m"
3737

3838
# Error message printed if size is exceeded.
39-
SIZE_ERROR_MESSAGE = """This diff is increasing the binary size of Executorch (the PyTorch Edge model executor) by a large amount.
40-
Executorch has strict size requirements due to its embedded use case. Please follow these steps:
39+
SIZE_ERROR_MESSAGE = """This diff is increasing the binary size of ExecuTorch (the PyTorch Edge model executor) by a large amount.
40+
ExecuTorch has strict size requirements due to its embedded use case. Please follow these steps:
4141
1. Check the output of the two steps (Build ... with the base commit/diff version) and compare their executable section sizes.
4242
2. Contact a member of #pytorch_edge_portability so we can better help you.
4343
"""

sdk/edir/et_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
"""
8-
Intermediate Representation of Executorch Concepts in Productivity SDK
8+
Intermediate Representation of ExecuTorch Concepts in Productivity SDK
99
"""
1010

1111
from __future__ import annotations
@@ -74,7 +74,7 @@ class PROFILE_STAT_HEADER(Enum):
7474
MAX_MS = "Max (ms)"
7575

7676

77-
# A single inference run extracted from Executorch SDK ET Dump
77+
# A single inference run extracted from ExecuTorch SDK ET Dump
7878
@dataclass
7979
class InferenceRun:
8080
# Maps from a node identifier (e.g. Debug Handle) to its associated metadata
@@ -733,7 +733,7 @@ def _extract_output_shapes(metadata: Dict[str, Any]) -> Optional[List[List[int]]
733733

734734
# Representation of an Exported ExecuTorch Program as an OperatorGraph
735735
class ExportedETOperatorGraph(OperatorGraphWithStats):
736-
# Given the path to an Executorch Program, parse it into an OperatorGraph
736+
# Given the path to an ExecuTorch Program, parse it into an OperatorGraph
737737
# `include_constant_nodes`: Whether to include constant nodes in output graph
738738
@staticmethod
739739
def gen_operator_graph_from_path(
@@ -773,7 +773,7 @@ def _resolve_kernel_args(args, values):
773773

774774
return unpacked_args, out_indices
775775

776-
# Given an Executorch Program, parse it into an OperatorGraph
776+
# Given an ExecuTorch Program, parse it into an OperatorGraph
777777
# `include_constant_nodes`: Whether to include constant nodes in output graph
778778
@staticmethod
779779
def gen_operator_graph(

test/end2end/exported_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
"""Test helper for exporting an nn.Module to an Executorch program."""
7+
"""Test helper for exporting an nn.Module to an ExecuTorch program."""
88

99
import functools
1010
import inspect

test/models/export_delegated_program.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121
from torch import nn
2222

23-
"""Traces and exports delegated nn.Modules to Executorch .pte program files.
23+
"""Traces and exports delegated nn.Modules to ExecuTorch .pte program files.
2424
2525
Creates two versions of each file:
2626
- <module-name>.pte: Delegate data stored in segments outside of the flatbuffer data.
@@ -133,7 +133,7 @@ def main() -> None:
133133
# when possible.
134134
parser = argparse.ArgumentParser(
135135
prog="export_delegated_program",
136-
description="Exports delegated nn.Module models to Executorch .pte files",
136+
description="Exports delegated nn.Module models to ExecuTorch .pte files",
137137
)
138138
parser.add_argument(
139139
"--modules",

test/models/export_program.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from torch import nn
1818
from torch._export import dynamic_dim
1919

20-
"""Traces and exports nn.Modules to Executorch .pte program files.
20+
"""Traces and exports nn.Modules to ExecuTorch .pte program files.
2121
2222
This tool mainly exists to export programs for C++ tests, but can also
2323
be used to export models manually.
@@ -177,7 +177,7 @@ def main() -> None:
177177
# when possible.
178178
parser = argparse.ArgumentParser(
179179
prog="export_program",
180-
description="Exports nn.Module models to Executorch .pte files",
180+
description="Exports nn.Module models to ExecuTorch .pte files",
181181
)
182182
parser.add_argument(
183183
"--modules",

0 commit comments

Comments
 (0)