File tree Expand file tree Collapse file tree
examples/qualcomm/oss_scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111import numpy as np
1212from executorch .backends .qualcomm .export_utils import (
13+ Device ,
1314 make_quantizer ,
1415 QnnConfig ,
1516 setup_common_args_and_variables ,
16- SimpleADB ,
1717)
1818from executorch .backends .qualcomm .quantizer .quantizer import QuantDtype
1919from executorch .examples .qualcomm .utils import (
@@ -84,19 +84,19 @@ def main(args):
8484 et_program_manager .write_to_file (f )
8585 logging .info (f"wrote { pte_path } ({ os .path .getsize (pte_path )} bytes)" )
8686
87- adb = SimpleADB (
87+ device = Device (
8888 qnn_config = qnn_config ,
8989 pte_path = pte_path ,
9090 workspace = f"/data/local/tmp/{ getpass .getuser ()} /executorch/{ pte_filename } " ,
9191 )
92- adb .push (inputs = inputs )
93- adb .execute ()
92+ device .push (inputs = inputs )
93+ device .execute ()
9494
9595 # collect output data
9696 output_data_folder = f"{ args .artifact } /outputs"
9797 make_output_dir (output_data_folder )
9898
99- adb .pull (host_output_path = args .artifact )
99+ device .pull (host_output_path = args .artifact )
100100
101101 # top-k analysis
102102 predictions = []
Original file line number Diff line number Diff line change 1414
1515import torch
1616from executorch .backends .qualcomm .export_utils import (
17+ Device ,
1718 get_backend_type ,
1819 make_quantizer ,
1920 QnnConfig ,
2021 setup_common_args_and_variables ,
21- SimpleADB ,
2222)
2323from executorch .backends .qualcomm .hf_transformers .api import get_quant_recipe
2424from executorch .examples .qualcomm .utils import make_output_dir
@@ -102,17 +102,17 @@ def post_process():
102102 "> outputs/result.txt" ,
103103 ]
104104 )
105- adb = SimpleADB (
105+ device = Device (
106106 qnn_config = qnn_config ,
107107 pte_path = pte_path ,
108108 workspace = workspace ,
109109 runner = runner_bin ,
110110 )
111111 # No pregen inputs, input_list is not required
112- adb .push (inputs = [], files = [tokenizer_json_path ])
113- adb .execute (custom_runner_cmd = runner_cmd )
112+ device .push (inputs = [], files = [tokenizer_json_path ])
113+ device .execute (custom_runner_cmd = runner_cmd )
114114
115- adb .pull (host_output_path = args .artifact , callback = post_process )
115+ device .pull (host_output_path = args .artifact , callback = post_process )
116116
117117 if args .ip and args .port != - 1 :
118118 with Client ((args .ip , args .port )) as conn :
You can’t perform that action at this time.
0 commit comments