microsoft / microsoft/onnxruntime

[WebGPU Performance] Expand QKV and MLP fusion coverage for WebGPU EP

Open
#28,693 1 comment 0 reactions 1 assignee View on GitHub

@hariharans29 is already working on this.

Since May 27, 2026.

ep:WebGPU performance platform:web
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the issue

The soon to merge PR https://github.com/microsoft/onnxruntime/pull/28280 has basic QKV and MLP fusion patterns implemented - mostly targeting the Qwen architecture.

1. Accout for the QKV fusion already recently made available in GenAI: https://github.com/microsoft/onnxruntime-genai/pull/2137
That fusion fuses the 3 QKV Matmuls into 1 fused Matmul + 1 Slice
In the dynamic fusion introduced in the afore-mentioned PR, 1 SLN + 3 Matmuls are fused together. Keep coverage for this "old" QKV setup (for models which have not upgraded to using the latest GenAI model builder), but also account for the new pattern we will see 1 SLN + 1 QKV Matmul + 1 Split.

2. Expand MLP fusion coverage for more models. The MLP fused node has support for "activation" so it is generic enough to handle more similar patterns with different activations (for example Gemma3).

### To reproduce

N/A

### Urgency

N/A

### Platform

Windows

### OS Version

Winodws 11

### ONNX Runtime Installation

Built from Source

### ONNX Runtime Version or Commit ID

Main branch

### ONNX Runtime API

Python

### Architecture

X64

### Execution Provider

Other / Unknown

### Execution Provider Library Version

WebGPU

### Model File

N/A

### Is this a quantized model?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.