Skip to content

Commit 5cf362a

Browse files
lucylqfacebook-github-bot
authored andcommitted
Back out "Add constant segment to export options" (#1538)
Summary: Pull Request resolved: #1538 Original commit changeset: 7ea529bdbc22 Original Phabricator Diff: D52137846 Reviewed By: shoumikhin Differential Revision: D52551266 fbshipit-source-id: 5a526ac3c0db4f7ce13fe2110fa30a2c9c5be9ac
1 parent 30732fe commit 5cf362a

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

examples/portable/scripts/export.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
from executorch.exir.capture import EdgeCompileConfig
1313

14-
from executorch.exir.capture._config import ExecutorchBackendConfig
15-
1614
from ...models import MODEL_NAME_TO_MODEL
1715
from ...models.model_factory import EagerModelFactory
1816
from ..utils import export_to_edge, export_to_exec_prog, save_pte_program
@@ -31,12 +29,6 @@ def main() -> None:
3129
help=f"provide a model name. Valid ones: {list(MODEL_NAME_TO_MODEL.keys())}",
3230
)
3331
parser.add_argument("-o", "--output_dir", default=".", help="output directory")
34-
parser.add_argument(
35-
"-c",
36-
"--constant_segment",
37-
default=True,
38-
help="whether or not to store constants in a separate segment",
39-
)
4032

4133
args = parser.parse_args()
4234

@@ -50,7 +42,6 @@ def main() -> None:
5042
*MODEL_NAME_TO_MODEL[args.model_name]
5143
)
5244

53-
config = ExecutorchBackendConfig(extract_constant_segment=args.constant_segment)
5445
if (
5546
dynamic_shapes is not None
5647
): # capture_pre_autograd_graph does not work with dynamic shapes
@@ -62,13 +53,9 @@ def main() -> None:
6253
_check_ir_validity=False,
6354
),
6455
)
65-
prog = edge_manager.to_executorch(
66-
ExecutorchBackendConfig(extract_constant_segment=True)
67-
)
56+
prog = edge_manager.to_executorch()
6857
else:
69-
prog = export_to_exec_prog(
70-
model, example_inputs, dynamic_shapes=dynamic_shapes, backend_config=config
71-
)
58+
prog = export_to_exec_prog(model, example_inputs, dynamic_shapes=dynamic_shapes)
7259
save_pte_program(prog.buffer, args.model_name, args.output_dir)
7360

7461

0 commit comments

Comments
 (0)