Here is my test env:
-
device.
xiaomi 15, 8gen4
-
I get model from the following location:
l3utterfly/Llama-3.2-3B-Instruct-qnn-executorch Llama-3.2-3B-Instruct.SM8750.pte
I get tokenizer from this location:
Llama-3.2-3B-Instruct
- code:
git clone https://github.com/pytorch/executorch.git
cd executorch
git submodule update --init --recursive
./backends/qualcomm/scripts/build.sh --release
I can find the binary file from this location:
build-android/examples/qualcomm/oss_scripts/llama/qnn_llama_runner
- run cmd:
dada:/data/local/tmp $ ./qnn_llama_runner \
--model_path Llama-3.2-3B-Instruct.SM8750.pte \
--tokenizer_path tokenizer.json \
--decoder_model_version llama3 \
--prompt 'hello' \
--seq_len 128 \
error info:
I tokenizers:regex.cpp:27] Registering override fallback regex
I 00:00:00.000833 executorch:runner.cpp:149] creating module: model_path=Llama-3.2-3B-Instruct.SM8750.pte
I 00:00:00.000850 executorch:runner.cpp:150] creating runner: tokenizer_path=tokenizer.json
I 00:00:00.000852 executorch:runner.cpp:151] eval mode=1
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1728760969.240951 12853 re2.cc:237] Error parsing '((?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]|\s[\r\n...': invalid perl operator: (?!
I tokenizers:re2_regex.cpp:27] Re2 failed to compile regex: ((?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]|\s[\r\n]+|\s+(?!\S)|\s+), error: invalid perl operator: (?!
This may be ok if a fallback regex is used.
I tokenizers:regex_lookahead.cpp:26] Creating PCRE2 regex
I 00:00:00.348318 executorch:llm_runner_helper.cpp:55] Loaded json tokenizer
[INFO] [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
[INFO] [Qnn ExecuTorch]: soc_model in soc_info: SM8750
[INFO] [Qnn ExecuTorch]: backend_type: kHtpBackend
[INFO] [Qnn ExecuTorch]: library_path:
[INFO] [Qnn ExecuTorch]: dump intermediate outputs: (null)
[INFO] [Qnn ExecuTorch]: log_level:
[INFO] [Qnn ExecuTorch]: profile_level: kProfileOff
[INFO] [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
[INFO] [Qnn ExecuTorch]: Is on-device graph construction: 1
[INFO] [Qnn ExecuTorch]: Enable shared buffer: 0
Segmentation fault
139|dada:/data/local/tmp $
139|dada:/data/local/tmp $ logcat |grep ExecuTorch
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: library_path:
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: log_level:
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: library_path:
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: log_level:
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: library_path:
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: log_level:
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: library_path:
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: log_level:
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: library_path:
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: log_level:
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Enable shared buffer: 0
Could you tell me how to solve this?
Here is my test env:
device.
xiaomi 15, 8gen4
I get model from the following location:
l3utterfly/Llama-3.2-3B-Instruct-qnn-executorch Llama-3.2-3B-Instruct.SM8750.pte
I get tokenizer from this location:
Llama-3.2-3B-Instruct
git clone https://github.com/pytorch/executorch.git
cd executorch
git submodule update --init --recursive
./backends/qualcomm/scripts/build.sh --release
I can find the binary file from this location:
build-android/examples/qualcomm/oss_scripts/llama/qnn_llama_runner
dada:/data/local/tmp $ ./qnn_llama_runner \
error info:
I tokenizers:regex.cpp:27] Registering override fallback regex
I 00:00:00.000833 executorch:runner.cpp:149] creating module: model_path=Llama-3.2-3B-Instruct.SM8750.pte
I 00:00:00.000850 executorch:runner.cpp:150] creating runner: tokenizer_path=tokenizer.json
I 00:00:00.000852 executorch:runner.cpp:151] eval mode=1
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1728760969.240951 12853 re2.cc:237] Error parsing '((?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]|\s[\r\n...': invalid perl operator: (?!
I tokenizers:re2_regex.cpp:27] Re2 failed to compile regex: ((?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]|\s[\r\n]+|\s+(?!\S)|\s+), error: invalid perl operator: (?!
This may be ok if a fallback regex is used.
I tokenizers:regex_lookahead.cpp:26] Creating PCRE2 regex
I 00:00:00.348318 executorch:llm_runner_helper.cpp:55] Loaded json tokenizer
[INFO] [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
[INFO] [Qnn ExecuTorch]: soc_model in soc_info: SM8750
[INFO] [Qnn ExecuTorch]: backend_type: kHtpBackend
[INFO] [Qnn ExecuTorch]: library_path:
[INFO] [Qnn ExecuTorch]: dump intermediate outputs: (null)
[INFO] [Qnn ExecuTorch]: log_level:
[INFO] [Qnn ExecuTorch]: profile_level: kProfileOff
[INFO] [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
[INFO] [Qnn ExecuTorch]: Is on-device graph construction: 1
[INFO] [Qnn ExecuTorch]: Enable shared buffer: 0
Segmentation fault
139|dada:/data/local/tmp $
139|dada:/data/local/tmp $ logcat |grep ExecuTorch
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: library_path:
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: log_level:
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:11:25.694 12582 12582 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: library_path:
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: log_level:
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:18:12.769 12824 12824 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: library_path:
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: log_level:
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:18:24.783 12831 12831 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: library_path:
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: log_level:
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:21:32.104 12841 12841 I [Qnn ExecuTorch]: Enable shared buffer: 0
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Deserializing processed data using QnnContextCustomProtocol
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: soc_model in soc_info: SM8750
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: backend_type: kHtpBackend
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: library_path:
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: dump intermediate outputs: (null)
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: log_level:
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: profile_level: kProfileOff
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: the size of qnn context binary: -1841596872
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Is on-device graph construction: 1
10-13 03:22:49.396 12853 12853 I [Qnn ExecuTorch]: Enable shared buffer: 0
Could you tell me how to solve this?