Repository navigation
Conversation
80ea1c8 to
ac3b8f5
Compare
a67edb3 to
1285e8f
Compare
bdb5789 to
9a8fecb
Compare
3d3cb96 to
87aaa15
Compare
ba196ad to
2f46244
Compare
1685615 to
053893b
Compare
ba80126 to
45e6c13
Compare
053893b to
2959ead
Compare
45e6c13 to
51fc2f9
Compare
db4f2b7 to
ba520f8
Compare
e3c85f8 to
1e5d24b
Compare
|
@yzhou51 On Linux, the accuracy needs to be fixed.
|
fcf6088 to
2371fe4
Compare
ba520f8 to
2371fe4
Compare
7d8ccda to
e0b9fd7
Compare
|
Reproduce it in the LNL ubuntu 32G. ReproduceI ran on Lunar Lake, Ubuntu, NPU driver 1.38.0.20260910 (the same driver as yours), Qwen3.6-35B-A3B Q4_0. KLD is against the ggml-CPU logits, wikitext-2, -c 256 -b 256, with your NPU settings. Only the OpenVINO package changes between the two Lunar Lake runs:
With 2026.4.1, Lunar Lake reproduces your numbers almost exactly. With the master build, on the same machine with the same driver and settings, the result is as expected. On Panther Lake under Windows with a master build, I measured a mean KLD of 0.081, 86.6% same top p and a PPL ratio of 1.051. I don't have a Panther Lake Ubuntu machine, so the comparison on Ubuntu is on Lunar Lake only. Cause2026.4.1 was tagged on 2026-09-23. It doesn't have these NPUW changes, which the NPU MoE path of this PR depends on: openvinotoolkit/openvino#38123, "[NPUW] Preserve MoE mixing scores and drain failed expert requests" (merged 2026-09-26). It corrects how the MoE executor applies the expert mixing scores, including zero and underfilled selections. NextI'll add this minimum version to the NPU MoE section of docs/backend/OPENVINO.md in this PR. |
0d151df to
e0b9fd7
Compare
NPUW, the partitioning layer of the NPU plugin, has its own MoE support. It isolates the experts into functions and runs only the routed experts for each token, with the router on the host (the `HOST_ROUTED` mode). This PR translates the MoE block of a model into the form NPUW recognises, and sets the NPUW properties for that mode.
ov_graph_compute_static scanned every node of the graph for a MoE block on each call, cache hits included, to choose the NPUW MoE properties. set_input_output already matches each MoE block when the decoder is built, so it now records the result in GgmlOvDecoder::has_moe_block(), and the properties are added from that flag when a graph compiles. The properties are the same as before.
…E models on the NPU
Overview
MoE models did not run on the NPU. On CPU and GPU, the backend translates
MUL_MAT_IDto OpenVINO'sGatherMatmul, which the NPU plugin does not support.NPUW, the partitioning layer of the NPU plugin, has its own MoE support. It isolates the experts into functions and runs only the routed experts for each token, with the router on the host (the
HOST_ROUTEDmode). This PR translates the MoE block of a model into the form NPUW recognises, and sets the NPUW properties for that mode.It covers the block that
build_moe_ffnemits with:That is the case for
qwen35moe(Qwen3.6-35B-A3B, tested) andqwen3moe, which builds the same block (not tested). CPU and GPU keepGatherMatmul.Additional information
How to run
NPUW_WEIGHTS_BANK_ALLOC=CPUkeeps NPUW's copy of the weights in host memory instead of the memory the NPU can address. It costs some speed, so it is documented rather than set by default.Performance
Testing
Qwen3.6-35B-A3B Q4_0, greedy, prompt
The capital of France is,-c 256, with the settings above:NPUW_MOE_POOL_SIZE=0,NPUW_MOE_TOKEN_CHUNK_SIZE=16give identical output, so the backend's MoE defaults work on their own.Accuracy
(PTL NPU): KLD against the ggml-CPU build, wikitext-2,
-c 256, 40 chunks:Requirements
YES, AI help analysis and enable this feature.