@@ -102,8 +102,8 @@ def parse_qnn_config(self):
102
102
self .qnn_config = {}
103
103
# Copy key-value pairs to the class object
104
104
for key , value in config_data .items ():
105
- if key == QnnConstants .CONVERTOR_ARGS_EXTENSION_STR :
106
- self .check_extension_arg (key , value , QnnConstants .IMMUTABLE_CONVERTOR_ARGS )
105
+ if key == QnnConstants .CONVERTER_ARGS_EXTENSION_STR :
106
+ self .check_extension_arg (key , value , QnnConstants .IMMUTABLE_CONVERTER_ARGS )
107
107
if key == QnnConstants .CONTEXT_BIN_ARGS_EXTENSION_STR :
108
108
self .check_extension_arg (key , value , QnnConstants .IMMUTABLE_CONTEXT_BIN_GEN_ARGS )
109
109
self .qnn_config [key ] = value
@@ -191,20 +191,20 @@ def create_qnn_compiler_config_json(self) -> str:
191
191
def compile (self ) -> str :
192
192
"""
193
193
Compiles the given ``ONNX`` model during object creation using QNN compiler and saves the compiled ``qpc`` package at ``qnn_binary_dir``.
194
- - Creates convertor command and convert onnx model to model.dlc using qairt-convertor
194
+ - Creates converter command and convert onnx model to model.dlc using qairt-converter
195
195
- command line arguments and qnn_config.json (if provided) are used to create qnn_compiler_config.json for context-binary-generator
196
- - model.dlc from convertor stage is passed into context-binary-generator command to create programqpc.bin.
196
+ - model.dlc from converter stage is passed into context-binary-generator command to create programqpc.bin.
197
197
198
198
Returns:
199
199
:str: Path to compiled ``qpc`` package.
200
200
"""
201
201
if not (
202
202
self .qnn_config
203
- and (QnnConstants .SKIP_QNN_CONVERTOR_STEP_STR in self .qnn_config )
204
- and self .qnn_config [QnnConstants .SKIP_QNN_CONVERTOR_STEP_STR ]
203
+ and (QnnConstants .SKIP_QNN_CONVERTER_STEP_STR in self .qnn_config )
204
+ and self .qnn_config [QnnConstants .SKIP_QNN_CONVERTER_STEP_STR ]
205
205
):
206
206
converter_cmd = self .converter ()
207
- execute_command ("convertor " , converter_cmd , self .qpc_base_path )
207
+ execute_command ("converter " , converter_cmd , self .qpc_base_path )
208
208
209
209
if not os .path .isfile (self .dlc_model_path ):
210
210
raise FileNotFoundError (
@@ -225,7 +225,7 @@ def compile(self) -> str:
225
225
226
226
def converter (self ) -> str :
227
227
"""
228
- Creates QNN convertor command using provided options.
228
+ Creates QNN converter command using provided options.
229
229
230
230
IMMUTABLE parameters which can not be overridden by the user using qnn_config.json:
231
231
:input_network (str): Generated ``ONNX`` Model Path.
@@ -235,10 +235,10 @@ def converter(self) -> str:
235
235
:float_bitwidth (int): Converts the graph to the specified float bitwidth, either 32 or 16(Default).
236
236
:preserve_io_datatype(flag): Passed by default.
237
237
238
- CONVERTOR_ARGS_EXTENSION passed in qnn_config.json is appended to the command created.
238
+ CONVERTER_ARGS_EXTENSION passed in qnn_config.json is appended to the command created.
239
239
240
240
Returns:
241
- :str: QNN Convertor command.
241
+ :str: QNN Converter command.
242
242
"""
243
243
converter_tool = QnnConstants .QAIRT_CONVERTER .format (self .qnn_sdk_path , self .qnn_target )
244
244
@@ -250,10 +250,10 @@ def converter(self) -> str:
250
250
f"--float_bitwidth { QnnConstants .FLOAT_BITWIDTH } "
251
251
)
252
252
# Add default arguments.
253
- cmd += QnnConstants .CONVERTOR_DEFAULT_ARGS
253
+ cmd += QnnConstants .CONVERTER_DEFAULT_ARGS
254
254
255
- if self .qnn_config and QnnConstants .CONVERTOR_ARGS_EXTENSION_STR in self .qnn_config :
256
- cmd += self .qnn_config [QnnConstants .CONVERTOR_ARGS_EXTENSION_STR ]
255
+ if self .qnn_config and QnnConstants .CONVERTER_ARGS_EXTENSION_STR in self .qnn_config :
256
+ cmd += self .qnn_config [QnnConstants .CONVERTER_ARGS_EXTENSION_STR ]
257
257
258
258
return cmd
259
259
@@ -266,7 +266,7 @@ def generate_context_binary(self) -> str:
266
266
:backend_binary (str): Generated QPC binary file name, which is provided programqpc.bin
267
267
:output_dir (str): Path to store generated Binaries (qnn_binary_dir).
268
268
:model (str): Path to the <qnn_model_name.so> file containing a QNN network.
269
- :dlc_path (str): Path to DLC file generated by QNN-Convertor .
269
+ :dlc_path (str): Path to DLC file generated by QNN-Converter .
270
270
:config_file(str): Path to created qnn_compiler_config.json containing qnn_compile_backend.json & shared_library_path.
271
271
272
272
Configurable parameters:
@@ -279,15 +279,13 @@ def generate_context_binary(self) -> str:
279
279
"""
280
280
binary_gen_tool = QnnConstants .QNN_CONTEXT_BIN .format (self .qnn_sdk_path , self .qnn_target )
281
281
backend_lib = QnnConstants .QNN_CONTEXT_LIB_BACKEND .format (self .qnn_sdk_path , self .qnn_target )
282
- model_lib = QnnConstants .QNN_CONTEXT_LIB_MODEL .format (self .qnn_sdk_path , self .qnn_target )
283
282
config_file_path = self .create_qnn_compiler_config_json ()
284
283
285
284
cmd = (
286
285
f"{ binary_gen_tool } --binary_file { QnnConstants .CONTEXT_BIN_NAME } "
287
286
f"--backend_binary { QnnConstants .CONTEXT_BIN_QPC_NAME } "
288
287
f"--output_dir { self .qnn_binary_dir } "
289
288
f"--backend { backend_lib } "
290
- f"--model { model_lib } "
291
289
f"--dlc_path { self .dlc_model_path } "
292
290
f"--config_file { config_file_path } "
293
291
)
@@ -343,7 +341,7 @@ def compile(
343
341
) -> str :
344
342
"""
345
343
Compiles the given ``ONNX`` model using QNN compiler and saves the compiled ``qpc`` package at ``qnn_binary_dir``.
346
- Generates model.dlc during convertor stage, qnn_compile_backend.json for backend parameters of context-binary-generator.
344
+ Generates model.dlc during converter stage, qnn_compile_backend.json for backend parameters of context-binary-generator.
347
345
Generates tensor-slicing configuration if multiple devices are passed in ``device_group``.
348
346
349
347
``Mandatory`` Args:
@@ -375,7 +373,7 @@ def compile(
375
373
376
374
os .makedirs (qpc_base_path , exist_ok = True )
377
375
378
- # Created custom_io_config.yaml file for QNN-Convertor stage.
376
+ # Created custom_io_config.yaml file for QNN-Converter stage.
379
377
# TODO To make custom_io_config.yaml configurable as not all models need it.
380
378
custom_io_file_path = os .path .join (qpc_base_path , "custom_io_config.yaml" )
381
379
0 commit comments