Skip to content

Npu support mm bert - #306

Merged
zhaixuejun1993 merged 2 commits into
ravi9:dev_backend_openvinofrom
zhaixuejun1993:npu-support-mmBERT
Sep 8, 2026
Merged

Npu support mm bert#306
zhaixuejun1993 merged 2 commits into
ravi9:dev_backend_openvinofrom
zhaixuejun1993:npu-support-mmBERT

Conversation

@zhaixuejun1993

Copy link
Copy Markdown
Collaborator

openvino: support cacheless encoder models on NPU

  1. Packed QKV views used by mmBERT were rejected by the ROPE support check. This split Q/K RoPE onto CPU, prevented cacheless attention detection, and sent fragmented encoder graphs through the decoder-oriented NPUW path.
  2. Accept packed QKV RoPE views, detect cacheless attention from its mask, and run these models as a single full-sequence prefill without NPUW or a decode graph. Also provide static mask, output index, and mean-pooling shapes and inputs.

openvino: optimize norm and RoPE translation

  1. Replace the decomposed mean/variance normalization graph with an opset6 MVN operation. This preserves the GGML epsilon placement while allowing OpenVINO plugins to compile normalization as one operation with fewer intermediate tensors.
  2. Cache RoPE sine and cosine outputs in the graph-wide tensor map. Build the cache key from all RoPE parameters and the optional frequency-factor input so compatible Q/K and layer nodes share one subgraph without mixing different RoPE configurations.

@zhaixuejun1993

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

    Packed QKV views used by mmBERT were rejected by the ROPE support check. This split Q/K RoPE onto CPU, prevented cacheless attention detection, and sent fragmented encoder graphs through the decoder-oriented NPUW path.

    Accept packed QKV RoPE views, detect cacheless attention from its mask, and run these models as a single full-sequence prefill without NPUW or a decode graph. Also provide static mask, output index, and mean-pooling shapes and inputs.
    Replace the decomposed mean/variance normalization graph with an opset6 MVN operation. This preserves the GGML epsilon placement while allowing OpenVINO plugins to compile normalization as one operation with fewer intermediate tensors.

    Cache RoPE sine and cosine outputs in the graph-wide tensor map. Build the cache key from all RoPE parameters and the optional frequency-factor input so compatible Q/K and layer nodes share one subgraph without mixing different RoPE configurations.

    Expose NodeContext::put_shared() to publish translator-created outputs for graph-level reuse.
@zhaixuejun1993
zhaixuejun1993 merged commit 4a22842 into ravi9:dev_backend_openvino Sep 8, 2026
5 of 16 checks passed
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.

1 participant