Skip to content

Back out "Add constant segment to export options" #1538

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
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
17 changes: 2 additions & 15 deletions examples/portable/scripts/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

from executorch.exir.capture import EdgeCompileConfig

from executorch.exir.capture._config import ExecutorchBackendConfig

from ...models import MODEL_NAME_TO_MODEL
from ...models.model_factory import EagerModelFactory
from ..utils import export_to_edge, export_to_exec_prog, save_pte_program
Expand All @@ -31,12 +29,6 @@ def main() -> None:
help=f"provide a model name. Valid ones: {list(MODEL_NAME_TO_MODEL.keys())}",
)
parser.add_argument("-o", "--output_dir", default=".", help="output directory")
parser.add_argument(
"-c",
"--constant_segment",
default=True,
help="whether or not to store constants in a separate segment",
)

args = parser.parse_args()

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

config = ExecutorchBackendConfig(extract_constant_segment=args.constant_segment)
if (
dynamic_shapes is not None
): # capture_pre_autograd_graph does not work with dynamic shapes
Expand All @@ -62,13 +53,9 @@ def main() -> None:
_check_ir_validity=False,
),
)
prog = edge_manager.to_executorch(
ExecutorchBackendConfig(extract_constant_segment=True)
)
prog = edge_manager.to_executorch()
else:
prog = export_to_exec_prog(
model, example_inputs, dynamic_shapes=dynamic_shapes, backend_config=config
)
prog = export_to_exec_prog(model, example_inputs, dynamic_shapes=dynamic_shapes)
save_pte_program(prog.buffer, args.model_name, args.output_dir)


Expand Down