[QNN:Bugfix] Add support for convert llm/visual mnn model into same q… - #4757
Merged
Merged
Conversation
…nn folder (Qnn model) first visual convert: python3 npu/generate_llm_qnn.py --model ../../../model/Qwen3-VL-4B-Instruct-MNN-QNN --soc_id=57 --dsp_arch=v75 --image_sizes 256x256 --model_name visual.mnn second llm convert: python3 npu/generate_llm_qnn.py --model ../../../model/Qwen3-VL-4B-Instruct-MNN-QNN --soc_id=57 --dsp_arch=v75 --reuse_config_qnn_json layout of qnn model: |-- config.json |-- config_qnn.json |-- embeddings_bf16.bin |-- export_args.json |-- llm.mnn |-- llm.mnn.json |-- llm.mnn.weight |-- llm_config.json |-- qnn | |-- graphllm0.bin | |-- ... | |-- graphllmxx.bin | |-- graphvisual0.bin | |-- llm.mnn | `-- visual.mnn |-- tokenizer.mtok |-- visual.mnn -- visual.mnn.weight 2 directories, 52 files push Qwen3-VL-4B-Instruct-MNN-QNN to /data/local/tmp, then will get both visual & llm inference on npu. Signed-off-by: Dillon Min <dillonhua@gmail.com>
Qxinyu
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nn folder (Qnn model)
first visual convert:
python3 npu/generate_llm_qnn.py --model ../../../model/Qwen3-VL-4B-Instruct-MNN-QNN --soc_id=57 --dsp_arch=v75 --image_sizes 256x256 --model_name visual.mnn
second llm convert:
python3 npu/generate_llm_qnn.py --model ../../../model/Qwen3-VL-4B-Instruct-MNN-QNN --soc_id=57 --dsp_arch=v75 --reuse_config_qnn_json
layout of qnn model:
|-- config.json
|-- config_qnn.json
|-- embeddings_bf16.bin
|-- export_args.json
|-- llm.mnn
|-- llm.mnn.json
|-- llm.mnn.weight
|-- llm_config.json
|-- qnn
| |-- graphllm0.bin
| |-- ...
| |-- graphllmxx.bin
| |-- graphvisual0.bin
| |-- llm.mnn
| `-- visual.mnn
|-- tokenizer.mtok
|-- visual.mnn
-- visual.mnn.weight
2 directories, 52 files
push Qwen3-VL-4B-Instruct-MNN-QNN to /data/local/tmp, then will get both visual & llm inference on npu.
Description
@wangzhaode
This PR is replace old one (#4549) as merge conflict reason.
two point addressed:
1, change --reuse_config_qnn_json from type=bool to action="store_true"
2, clean stale files (qnn/graphvisualxx.bin, qnn/visual.mnn, qnn/graphllmxx.bin, qnn/llm.mnn) before tmp/qnn copy
Module
QNN
Type
Checklist
[Module:Type] Descriptionformat