Repository navigation
骁龙8gen3手机是redmi k70pro 环境输出是一堆乱码 #10
Copy link
Copy link
Open
Description
Name and Version
最新版本
Operating systems
Linux, Other? (Please let us know in description)
GGML backends
CPU
Hardware
设备: Android AArch64(adb,目录 /data/local/tmp/llama.cpp)
CPU 特征: NEON=1, ARM_FMA=1(日志 system_info: ... CPU : NEON = 1 | ARM_FMA = 1 | AARCH64_REPACK = 1)
Models
qwen1.5-1.8b.iq4_nl+q8_0-hmx.gguf
qwen2.5-1.5b.iq4_nl+q8_0-hmx.gguf
Problem description & steps to reproduce
设备/环境
- 设备: Android AArch64(adb,目录
/data/local/tmp/llama.cpp) - CPU 特征: NEON=1, ARM_FMA=1(日志
system_info: ... CPU : NEON = 1 | ARM_FMA = 1 | AARCH64_REPACK = 1) - 宿主: Linux (adb 驱动测试),终端/脚本全程 UTF-8(
LANG/LC_ALL=C.UTF-8) - 二进制:
llama-cli(本仓 Android 构建,放置于设备同目录,并确保chmod +x) - 库路径:
LD_LIBRARY_PATH=/data/local/tmp/llama.cpp,DSP_LIBRARY_PATH=/data/local/tmp/llama.cpp
后端/运行参数
- GGUF: V3
- 后端: 尝试加载 HTP
- 启动时多次打印:
load_backend: failed to find ggml_backend_init in ./libggml-htp.so - 随后:
Initializing HTP backend... (You should see this once)(HTP 初始化流程仍进入)
- 启动时多次打印:
- CPU 回退: 复现时强制
SKIP_HTP_OPS=1,完全走 CPU,乱码仍存在(排除 HTP 路径) - 核心 CLI 选项:
- 基线最小复现(贪心、无模板):
./llama-cli --simple-io --no-display-prompt -t 4 \ -m <MODEL> -p 'Hello' -n 32 --temp 0 --top-k 1 --top-p 1
- ChatML(非交互,避免
-cnv):./llama-cli --simple-io --no-display-prompt -t 4 \ -m <MODEL> -n 48 -f prompt_chatml.txt --temp 0.6 --top-k 40 --top-p 0.9
- 基线最小复现(贪心、无模板):
- 其他观测(随模型不同略有差异):
n_ctx=4096,flash_attn=0/1(不同测试场景)- KV/RPCMEM 缓冲区按日志正常分配
模型(均可稳定复现乱码)
/data/local/tmp/llama.cpp/qwen1.5-1.8b.iq4_nl+q8_0-hmx.gguf- 日志关键:
general.architecture = qwen2,general.name = Qwen 1.5 1.8b Chat
- 日志关键:
/data/local/tmp/llama.cpp/qwen2.5-1.5b.iq4_nl+q8_0-hmx.gguf- 日志关键:
general.architecture = qwen2,general.name = Qwen2.5 1.5B Instruct
- 日志关键:
Prompt 用例
- 最小复现(贪心、不使用模板):
Hello
- 英文长文(脚本内用于“生成标题”)
Large Language Models (LLMs) are advanced artificial intelligence systems designed to understand and generate human-like text. These models are trained on vast amounts of data, enabling them to perform a wide range of tasks, from answering questions and summarizing text to generating creative content and engaging in conversational dialogue. LLMs like GPT-3 and GPT-4, developed by OpenAI, have set new benchmarks in natural language processing by leveraging deep learning architectures, particularly transformer models, which excel at capturing context and relationships within text. The scalability and versatility of LLMs make them invaluable tools for applications in education, customer service, content creation, and more. However, their deployment also raises ethical considerations, including issues of bias, misinformation, and the potential for misuse. As the field continues to evolve, ongoing research and responsible deployment strategies are essential to harnessing the full potential of these powerful AI systems while mitigating their risks.
Generate a title based on the above text.
- ChatML(非交互喂给
-f文件)
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Write a concise English title for: Large Language Models are advanced...<|im_end|>
<|im_start|>assistant
- 也测试过
-cnv会话模式(进入交互后同样出现异常符号串),因此最终定位与 TTY/模板无关。
First Bad Commit
No response
Relevant log output
(base) root@NSL-A800-2:/workspace/sbw/llama.cpp-npu# adb shell "cd /data/local/tmp/llama.cpp && export LD_LIBRARY_PATH=/data/local/tmp/llama.cpp && export DSP_LIBRARY_PATH=/data/local/tmp/llama.cpp && ./llama-cli -t 4 -fa -m qwen1.5-1.8b.iq4_nl+q8_0-hmx.gguf -n 28 -p 'Large Language Models (LLMs) are advanced artificial intelligence systems designed to understand and generate human-like text. These models are trained on vast amounts of data, enabling them to perform a wide range of tasks, from answering questions and summarizing text to generating creative content and engaging in conversational dialogue. LLMs like GPT-3 and GPT-4, developed by OpenAI, have set new benchmarks in natural language processing by leveraging deep learning architectures, particularly transformer models, which excel at capturing context and relationships within text. The scalability and versatility of LLMs make them invaluable tools for applications in education, customer service, content creation, and more. However, their deployment also raises ethical considerations, including issues of bias, misinformation, and the potential for misuse. As the field continues to evolve, ongoing research and responsible deployment strategies are essential to harnessing the full potential of these powerful AI systems while mitigating their risks.\"\nGenerate a title based on the above text.' "
load_backend: failed to find ggml_backend_init in ./libggml-htp.so
build: 4406 (57e34a34) with Android (11349228, +pgo, +bolt, +lto, -mlgo, based on r487747e) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362) for x86_64-unknown-linux-gnu
main: llama backend init
main: load the model and apply lora adapter, if any
llama_model_loader: loaded meta data with 30 key-value pairs and 291 tensors from qwen1.5-1.8b.iq4_nl+q8_0-hmx.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = qwen2
llama_model_loader: - kv 1: general.type str = model
llama_model_loader: - kv 2: general.name str = Qwen 1.5 1.8b Chat
llama_model_loader: - kv 3: general.finetune str = chat
llama_model_loader: - kv 4: general.basename str = qwen-1.5
llama_model_loader: - kv 5: general.size_label str = 1.8B
llama_model_loader: - kv 6: general.license str = other
llama_model_loader: - kv 7: general.license.name str = tongyi-qianwen-research
llama_model_loader: - kv 8: general.license.link str = https://huggingface.co/Qwen/Qwen1.5-1...
llama_model_loader: - kv 9: general.tags arr[str,2] = ["chat", "text-generation"]
llama_model_loader: - kv 10: general.languages arr[str,1] = ["en"]
llama_model_loader: - kv 11: qwen2.block_count u32 = 24
llama_model_loader: - kv 12: qwen2.context_length u32 = 32768
llama_model_loader: - kv 13: qwen2.embedding_length u32 = 2048
llama_model_loader: - kv 14: qwen2.feed_forward_length u32 = 5504
llama_model_loader: - kv 15: qwen2.attention.head_count u32 = 16
llama_model_loader: - kv 16: qwen2.attention.head_count_kv u32 = 16
llama_model_loader: - kv 17: qwen2.rope.freq_base f32 = 1000000.000000
llama_model_loader: - kv 18: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001
llama_model_loader: - kv 19: general.file_type u32 = 514
llama_model_loader: - kv 20: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 21: tokenizer.ggml.pre str = qwen2
llama_model_loader: - kv 22: tokenizer.ggml.tokens arr[str,151936] = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 23: tokenizer.ggml.token_type arr[i32,151936] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 24: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv 25: tokenizer.ggml.eos_token_id u32 = 151645
llama_model_loader: - kv 26: tokenizer.ggml.padding_token_id u32 = 151643
llama_model_loader: - kv 27: tokenizer.ggml.bos_token_id u32 = 151643
llama_model_loader: - kv 28: tokenizer.chat_template str = {% for message in messages %}{% if lo...
llama_model_loader: - kv 29: general.quantization_version u32 = 2
llama_model_loader: - type f32: 121 tensors
llama_model_loader: - type q8_0: 48 tensors
llama_model_loader: - type q6_K: 2 tensors
llama_model_loader: - type iq4_nl: 120 tensors
llm_load_vocab: special tokens cache size = 3
llm_load_vocab: token to piece cache size = 0.9308 MB
llm_load_print_meta: format = GGUF V3 (latest)
llm_load_print_meta: arch = qwen2
llm_load_print_meta: vocab type = BPE
llm_load_print_meta: n_vocab = 151936
llm_load_print_meta: n_merges = 151387
llm_load_print_meta: vocab_only = 0
llm_load_print_meta: n_ctx_train = 32768
llm_load_print_meta: n_embd = 2048
llm_load_print_meta: n_layer = 24
llm_load_print_meta: n_head = 16
llm_load_print_meta: n_head_kv = 16
llm_load_print_meta: n_rot = 128
llm_load_print_meta: n_swa = 0
llm_load_print_meta: n_embd_head_k = 128
llm_load_print_meta: n_embd_head_v = 128
llm_load_print_meta: n_gqa = 1
llm_load_print_meta: n_embd_k_gqa = 2048
llm_load_print_meta: n_embd_v_gqa = 2048
llm_load_print_meta: f_norm_eps = 0.0e+00
llm_load_print_meta: f_norm_rms_eps = 1.0e-06
llm_load_print_meta: f_clamp_kqv = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: f_logit_scale = 0.0e+00
llm_load_print_meta: n_ff = 5504
llm_load_print_meta: n_expert = 0
llm_load_print_meta: n_expert_used = 0
llm_load_print_meta: causal attn = 1
llm_load_print_meta: pooling type = 0
llm_load_print_meta: rope type = 2
llm_load_print_meta: rope scaling = linear
llm_load_print_meta: freq_base_train = 1000000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_ctx_orig_yarn = 32768
llm_load_print_meta: rope_finetuned = unknown
llm_load_print_meta: ssm_d_conv = 0
llm_load_print_meta: ssm_d_inner = 0
llm_load_print_meta: ssm_d_state = 0
llm_load_print_meta: ssm_dt_rank = 0
llm_load_print_meta: ssm_dt_b_c_rms = 0
llm_load_print_meta: model type = 1B
llm_load_print_meta: model ftype = mixed IQ4_NL & Q8_0
llm_load_print_meta: model params = 1.84 B
llm_load_print_meta: model size = 1.29 GiB (6.01 BPW)
llm_load_print_meta: general.name = Qwen 1.5 1.8b Chat
llm_load_print_meta: BOS token = 151643 '<|endoftext|>'
llm_load_print_meta: EOS token = 151645 '<|im_end|>'
llm_load_print_meta: EOT token = 151645 '<|im_end|>'
llm_load_print_meta: PAD token = 151643 '<|endoftext|>'
llm_load_print_meta: LF token = 148848 'ÄĬ'
llm_load_print_meta: EOG token = 151643 '<|endoftext|>'
llm_load_print_meta: EOG token = 151645 '<|im_end|>'
llm_load_print_meta: max token length = 256
RPCMEM alloc size = 252.92969 MiB
RPCMEM alloc size = 247.92969 MiB
RPCMEM alloc size = 253.30469 MiB
RPCMEM alloc size = 75.15625 MiB
llm_load_tensors: CPU_Mapped model buffer size = 486.86 MiB
llm_load_tensors: RPCMEM model buffer size = 829.32 MiB
..................................................................
Initializing HTP backend... (You should see this once)
llama_new_context_with_model: n_seq_max = 1
llama_new_context_with_model: n_ctx = 4096
llama_new_context_with_model: n_ctx_per_seq = 4096
llama_new_context_with_model: n_batch = 2048
llama_new_context_with_model: n_ubatch = 512
llama_new_context_with_model: flash_attn = 1
llama_new_context_with_model: freq_base = 1000000.0
llama_new_context_with_model: freq_scale = 1
llama_new_context_with_model: n_ctx_per_seq (4096) < n_ctx_train (32768) -- the full capacity of the model will not be utilized
llama_kv_cache_init: kv_size = 4096, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 24
RPCMEM alloc size = 256.00000 MiB
RPCMEM alloc size = 256.00000 MiB
RPCMEM alloc size = 256.00000 MiB
llama_kv_cache_init: RPCMEM KV buffer size = 768.00 MiB
llama_new_context_with_model: KV self size = 768.00 MiB, K (f16): 384.00 MiB, V (f16): 384.00 MiB
llama_new_context_with_model: CPU output buffer size = 0.58 MiB
RPCMEM alloc size = 37.50391 MiB
llama_new_context_with_model: RPCMEM compute buffer size = 37.50 MiB
llama_new_context_with_model: CPU compute buffer size = 296.75 MiB
llama_new_context_with_model: graph nodes = 751
llama_new_context_with_model: graph splits = 3
common_init_from_params: setting dry_penalty_last_n to ctx_size = 4096
common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)
main: llama threadpool init, n_threads = 4
system_info: n_threads = 4 (n_threads_batch = 4) / 8 | CPU : NEON = 1 | ARM_FMA = 1 | LLAMAFILE = 1 | AARCH64_REPACK = 1 |
Large Language Models (LLMs) are advanced artificial intelligence systems designed to understand and generate human-like text. These models are trained on vast amounts of data, enabling them to perform a wide range of tasks, from answering questions and summarizing text to generating creative content and engaging in conversational dialogue. LLMs like GPT-3 and GPT-4, developed by OpenAI, have set new benchmarks in natural language processing by leveraging deep learning architectures, particularly transformer models, which excel at capturing context and relationships within text. The scalability and versatility of LLMs make them invaluable tools for applications in education, customer service, content creation, and more. However, their deployment also raises ethical considerations, including issues of bias, misinformation, and the potential for misuse. As the field continues to evolve, ongoing research and responsible deployment strategies are essential to harnessing the full potential of these powerful AI systems while mitigating their risks."
Generate a title based on the above text.sampler seed: 3818919562
sampler params:
repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.000
dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 4096
top_k = 40, top_p = 0.950, min_p = 0.050, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, temp = 0.800
mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000
sampler chain: logits -> logit-bias -> penalties -> dry -> top-k -> typical -> top-p -> min-p -> xtc -> temp-ext -> dist
generate: n_ctx = 4096, n_batch = 2048, n_predict = 28, n_keep = 0
r数字full市场规模数字H recur伴侣Ohtable_ABC一字_ABC传奇游戏处境生意O复杂的ingroupO怎么会这么那麼俾 N辊退回?><
llama_perf_sampler_print: sampling time = 20.03 ms / 223 runs ( 0.09 ms per token, 11136.08 tokens per second)
llama_perf_context_print: load time = 1248.16 ms
llama_perf_context_print: prompt eval time = 241.05 ms / 195 tokens ( 1.24 ms per token, 808.95 tokens per second)
llama_perf_context_print: eval time = 2805.80 ms / 27 runs ( 103.92 ms per token, 9.62 tokens per second)
llama_perf_context_print: total time = 3322.90 ms / 222 tokens
(base) root@NSL-A800-2:/workspace/sbw/llama.cpp-npu#Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Android AArch64环境输出是一堆乱码[/-][+]骁龙8gen3手机是redmi k70pro 环境输出是一堆乱码[/+]haozixu commentedon Nov 5, 2025
可以参考下 #7 (comment) 看是不是这个问题
common : Fix corrupted memory error on json grammar initialization (#…