11
11
12
12
from executorch .exir .capture import EdgeCompileConfig
13
13
14
- from executorch .exir .capture ._config import ExecutorchBackendConfig
15
-
16
14
from ...models import MODEL_NAME_TO_MODEL
17
15
from ...models .model_factory import EagerModelFactory
18
16
from ..utils import export_to_edge , export_to_exec_prog , save_pte_program
@@ -31,12 +29,6 @@ def main() -> None:
31
29
help = f"provide a model name. Valid ones: { list (MODEL_NAME_TO_MODEL .keys ())} " ,
32
30
)
33
31
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
- )
40
32
41
33
args = parser .parse_args ()
42
34
@@ -50,7 +42,6 @@ def main() -> None:
50
42
* MODEL_NAME_TO_MODEL [args .model_name ]
51
43
)
52
44
53
- config = ExecutorchBackendConfig (extract_constant_segment = args .constant_segment )
54
45
if (
55
46
dynamic_shapes is not None
56
47
): # capture_pre_autograd_graph does not work with dynamic shapes
@@ -62,13 +53,9 @@ def main() -> None:
62
53
_check_ir_validity = False ,
63
54
),
64
55
)
65
- prog = edge_manager .to_executorch (
66
- ExecutorchBackendConfig (extract_constant_segment = True )
67
- )
56
+ prog = edge_manager .to_executorch ()
68
57
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 )
72
59
save_pte_program (prog .buffer , args .model_name , args .output_dir )
73
60
74
61
0 commit comments