onnxruntime
a8260cd6 - [webgpu] Optimize LinearAttention Op with subgroup (#28412)

Commit
96 days ago
[webgpu] Optimize LinearAttention Op with subgroup (#28412) ### Description Optimize the `LinearAttention` Op with subgroupAdd(). - Detect the adapter's `subgroupMinSize` to allocate workgroup shared memory - Drastically reduces workgroup shared memory usage (workgroup_size_x * TILE_V → MAX_SG * TILE_V) - Eliminates most `workgroupBarrier()` calls in the subgroup reduction The optimization is gated behind `subgroup_min_size`, which is enabled when the device supports `wgpu::FeatureName::Subgroups`. The original is preserved as fallback. ## Qwen3.5-4B Performance Benchmarks | Metric | Prefill Speed (TPS) | Decode Speed (TPS) | Prefill Improvement | | :--- | :--- | :--- | :--- | | **Default** | 719.6 | 29.6 | - | | **Optimized** | 929.8 | 29.7 | 1.29x | **Test Environment:** * **Hardware:** Intel Panther Lake * **Configuration:** Prefill: 1024, Decode: 128 ### Motivation and Context See above.
Author
Parents
Loading