File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -589,9 +589,8 @@ def do_nothing(max_batch_size, max_seq_length):
589
589
# attributes will NOT be seen on by AOTI-compiled forward
590
590
# function, e.g. calling model.setup_cache will NOT touch
591
591
# AOTI compiled and maintained model buffers such as kv_cache.
592
- from torch ._inductor .package import load_package
593
592
594
- aoti_compiled_model = load_package (
593
+ aoti_compiled_model = torch . _inductor . aoti_load_package (
595
594
str (builder_args .aoti_package_path .absolute ())
596
595
)
597
596
Original file line number Diff line number Diff line change @@ -75,17 +75,20 @@ def export_for_server(
75
75
if not package :
76
76
options = {"aot_inductor.output_path" : output_path }
77
77
78
- path = torch ._export . aot_compile (
78
+ ep = torch .export . export (
79
79
model ,
80
80
example_inputs ,
81
81
dynamic_shapes = dynamic_shapes ,
82
- options = options ,
83
82
)
84
83
85
84
if package :
86
- from torch ._inductor .package import package_aoti
87
-
88
- path = package_aoti (output_path , path )
85
+ path = torch ._inductor .aoti_compile_and_package (
86
+ ep , package_path = output_path , inductor_configs = options
87
+ )
88
+ else :
89
+ path = torch ._inductor .aot_compile (
90
+ ep .module (), example_inputs , options = options
91
+ )
89
92
90
93
print (f"The generated packaged model can be found at: { path } " )
91
94
return path
You can’t perform that action at this time.
0 commit comments