Skip to content

[QNN:Bugfix] Add support for convert llm/visual mnn model into same q… - #4757

Merged
Qxinyu merged 1 commit into
alibaba:masterfrom
blueskycoco:multi-model-convert-qnn-0811
Aug 12, 2026
Merged

[QNN:Bugfix] Add support for convert llm/visual mnn model into same q…#4757
Qxinyu merged 1 commit into
alibaba:masterfrom
blueskycoco:multi-model-convert-qnn-0811

Conversation

@blueskycoco

Copy link
Copy Markdown
Contributor

…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

  • Feature
  • [ *] Bugfix
  • Perf
  • Refact
  • Style
  • Doc
  • Test
  • Chore

Checklist

  • Commit message follows [Module:Type] Description format
  • Code compiles without errors
  • [ *] Tested on relevant platform(s)
  • No unrelated format or style changes included

…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
Qxinyu merged commit e24ef7c into alibaba:master Aug 12, 2026
1 check passed
@blueskycoco
blueskycoco deleted the multi-model-convert-qnn-0811 branch August 12, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants