Skip to content

Commit

Permalink
[WebNN EP] Support Einsum op (#19558)
Browse files Browse the repository at this point in the history
Adds support for einsum via WebNN matmul, transpose, reshape, reducesum,
identity and element-wise binary ops.
  • Loading branch information
peishenyan authored Nov 16, 2024
1 parent c73a3d1 commit 5928009
Show file tree
Hide file tree
Showing 5 changed files with 800 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/web/docs/webnn-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ operators and the supported opset domain/versions in **WebNN EP** by ONNX Runtim
| Div | ai.onnx(7-12, 13, 14+) | div ||| |
| DequantizeLinear | ai.onnx(10-12, 13-18, 19-20, 21-22, 23+) | dequantizeLinear ||| |
| Dropout | ai.onnx(7-9, 10-11, 12, 13-21, 22+) | identity ||| Only supports test mode |
| Einsum | ai.onnx(12+) | reshape, transpose, matmul, reduceSum, mul, triangular ||| |
| Elu | ai.onnx(7+) | elu ||| WebNN CPU backend only supports 'alpha' value is 1.0 |
| Equal | ai.onnx(7-10, 11-12, 13-18, 19+) | equal ||| |
| Erf | ai.onnx(7-9, 10-12, 13+) | erf ||| |
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/core/providers/webnn/builders/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ static const InlinedHashMap<std::string, std::string> op_map = {
{"DequantizeLinear", "dequantizeLinear"},
{"Dropout", "identity"},
{"DynamicQuantizeLinear", "dynamicQuantizeLinear"},
{"Einsum", "matmul"},
{"Elu", "elu"},
{"Equal", "equal"},
{"Erf", "erf"},
Expand Down
Loading

0 comments on commit 5928009

Please sign in to comment.