MCPcopy Create free account
hub / github.com/pytorch/executorch / build_pte

Function build_pte

backends/arm/test/test_model.py:138–176  ·  view source on GitHub ↗
(
    et_build_root: str,
    model_name: str,
    target: str,
    system_config: str,
    memory_mode: str,
    build_output: str,
    no_intermediate: bool,
    no_quantize: bool,
)

Source from the content-addressed store, hash-verified

136
137
138def build_pte(
139 et_build_root: str,
140 model_name: str,
141 target: str,
142 system_config: str,
143 memory_mode: str,
144 build_output: str,
145 no_intermediate: bool,
146 no_quantize: bool,
147):
148 command_list = [
149 "python3",
150 "-m",
151 "backends.arm.scripts.aot_arm_compiler",
152 "--delegate",
153 "--bundleio",
154 f"--model_name={model_name}",
155 f"--target={target}",
156 f"--output={build_output}",
157 ]
158
159 if "vgf" != target:
160 command_list.append(f"--system_config={system_config}")
161 command_list.append(f"--memory_mode={memory_mode}")
162
163 if not no_quantize:
164 command_list.append("--quantize")
165
166 if not no_intermediate:
167 command_list.append(f"--intermediate={output}")
168
169 run_external_cmd(command_list)
170
171 pte_file_ending = "bpte"
172 pte_file = os.path.join(
173 output, f"{model_name}_arm_delegate_{args.target}.{pte_file_ending}"
174 )
175
176 return pte_file
177
178
179def build_ethosu_runtime(

Callers 1

test_model.pyFile · 0.85

Calls 2

run_external_cmdFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected