Skip to content

Commit

Permalink
webnn: Remove support for passing MLActivations for op fusion
Browse files Browse the repository at this point in the history
Remove the ability to specify op fusions from the web platform layer.
Ops can still be fused, but this is now the responsibility of the
respective WebNN backend

Corresponds to the spec PR merged here:
webmachinelearning/webnn#664

Bug: 341518634
Cq-Include-Trybots: luci.chromium.try:win11-blink-rel,mac14.arm64-blink-rel,mac14-blink-rel
Change-Id: I8a4f2ab708e34087eeb10421596243b17bc8d7e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5494397
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310724}
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed Jun 5, 2024
1 parent 6383469 commit ab34829
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 390 deletions.
139 changes: 25 additions & 114 deletions webnn/resources/test_data/batch_normalization.json
Original file line number Diff line number Diff line change
Expand Up @@ -981,94 +981,6 @@
"type": "float32"
}
},
{
"name": "batchNormalization float32 4D NCHW tensor options.activation relu",
"inputs": {
"input": {
"shape": [2, 3, 2, 2],
"data": [
-41.30732967168238,
64.08864045143429,
-63.376671841233104,
-46.7903680211994,
83.0222726565018,
-80.08049213079853,
-62.144380499565784,
-0.10012771650340824,
-40.902161220312074,
56.963061967558474,
37.37249789808206,
57.04647733193906,
82.05679802728304,
-86.11642850667623,
76.88317547014259,
97.03362133579051,
-21.35103988063949,
-96.93823797160586,
-9.359310262561493,
80.2082435478892,
-85.36802529512583,
62.35185227095363,
-68.4724340974042,
-12.107167478351585
],
"type": "float32"
},
"mean": {
"shape": [3],
"data": [
51.62914995931095,
99.36075401019252,
-96.14736495234415
],
"type": "float32",
"constant": true
},
"variance": {
"shape": [3],
"data": [
30.448016067921067,
86.36218998771075,
73.88454888724165
],
"type": "float32",
"constant": true
}
},
"options": {
"activation": "relu"
},
"expected": {
"shape": [2, 3, 2, 2],
"data": [
0,
2.2579827308654785,
0,
0,
0,
0,
0,
0,
6.4271392822265625,
17.812623977661133,
15.533489227294922,
17.822328567504883,
5.514280319213867,
0,
4.576685905456543,
8.228469848632812,
0,
0,
0,
0,
1.2540507316589355,
18.43954849243164,
3.2196571826934814,
9.777103424072266
],
"type": "float32"
}
},
{
"name": "batchNormalization float32 4D NHWC tensor all options",
"inputs": {
Expand Down Expand Up @@ -1143,36 +1055,35 @@
"type": "float32"
},
"axis": 3,
"epsilon": 1e-6,
"activation": "relu"
"epsilon": 1e-6
},
"expected": {
"shape": [2, 2, 2, 3],
"data": [
0,
200.12615966796875,
0,
212.10623168945312,
1446.3731689453125,
0,
0,
1309.32568359375,
0,
0,
835.2536010742188,
0,
425.39935302734375,
997.6290893554688,
0,
0,
1575.1810302734375,
0,
363.98529052734375,
906.0018310546875,
0,
603.1834106445312,
221.62777709960938,
0
-1039.0085734071204,
200.12613597546277,
-120.36987167541395,
212.10626540432202,
1446.3732126569944,
-183.78396479879416,
-1300.9852072279227,
1309.3257094058545,
-171.08979404258523,
-1104.0956031373803,
835.2536189871761,
-183.83801576309426,
425.3993215144054,
997.6290832897452,
-91.55716013805052,
-1570.920072497096,
1575.1810627320297,
-187.2757593197739,
363.98524710447384,
906.0018322105,
-102.5050592863526,
603.1834043179756,
221.6277675074517,
-139.02827100419768
],
"type": "float32"
}
Expand Down
167 changes: 1 addition & 166 deletions webnn/resources/test_data/conv2d.json
Original file line number Diff line number Diff line change
Expand Up @@ -1398,170 +1398,6 @@
"type": "float32"
}
},
{
"name": "conv2d float32 4D input and filter tensors options.activation=relu",
"inputs": {
"input": {
"shape": [2, 1, 3, 3],
"data": [
0.7529087201709872,
0.7520291960017611,
0.594952773514815,
0.21631854011984264,
0.07589348976741683,
0.15106785419828572,
0.12124850358598671,
0.5364335407319905,
0.5937089927693522,
0.9910031422560608,
0.36309423611370084,
0.9289673923363004,
0.22727376737331384,
0.5414123970044269,
0.0844534212564596,
0.6765284772046276,
0.619325655574763,
0.39292160755260475
],
"type": "float32"
},
"filter": {
"shape": [3, 1, 2, 2],
"data": [
0.14543837927656278,
0.9671129790291346,
0.10836050336762582,
0.320230810822804,
0.6952692250382182,
0.5070913293589028,
0.0813970738017622,
0.5303338853508432,
0.30721364807734,
0.4324123448833208,
0.9849002194630809,
0.4281076188358701
],
"type": "float32",
"constant": true
}
},
"options": {
"activation": "relu" // relu operator
},
"expected": {
"name": "output",
"shape": [2, 3, 2, 2],
"data": [
0.8845428228378296,
0.7413608431816101,
0.2897796928882599,
0.4053896367549896,
0.9626783132553101,
0.9108520746231079,
0.4832426905632019,
0.4878997206687927,
0.8020333051681519,
0.6277193427085876,
0.4483422338962555,
0.8711439371109009,
0.6932874917984009,
1.0369365215301514,
0.8282973766326904,
0.35335418581962585,
1.1787647008895874,
0.8123774528503418,
0.816078782081604,
0.6780439019203186,
0.9170808792114258,
1.082636833190918,
1.2353861331939697,
0.9810346961021423
],
"type": "float32"
}
},
{
"name": "conv2d float32 4D input and filter tensors options.activation=sigmoid",
"inputs": {
"input": {
"shape": [2, 1, 3, 3],
"data": [
0.7529087201709872,
0.7520291960017611,
0.594952773514815,
0.21631854011984264,
0.07589348976741683,
0.15106785419828572,
0.12124850358598671,
0.5364335407319905,
0.5937089927693522,
0.9910031422560608,
0.36309423611370084,
0.9289673923363004,
0.22727376737331384,
0.5414123970044269,
0.0844534212564596,
0.6765284772046276,
0.619325655574763,
0.39292160755260475
],
"type": "float32"
},
"filter": {
"shape": [3, 1, 2, 2],
"data": [
0.14543837927656278,
0.9671129790291346,
0.10836050336762582,
0.320230810822804,
0.6952692250382182,
0.5070913293589028,
0.0813970738017622,
0.5303338853508432,
0.30721364807734,
0.4324123448833208,
0.9849002194630809,
0.4281076188358701
],
"type": "float32",
"constant": true
}
},
"options": {
"activation": "sigmoid" // sigmoid operator
},
"expected": {
"name": "output",
"shape": [2, 3, 2, 2],
"data": [
0.7077627182006836,
0.6772933602333069,
0.5719422101974487,
0.5999819040298462,
0.7236577272415161,
0.7131744623184204,
0.618513286113739,
0.6196115612983704,
0.690409243106842,
0.6519721746444702,
0.6102449893951416,
0.704983651638031,
0.6666978597640991,
0.7382584810256958,
0.6959947943687439,
0.5874307155609131,
0.7647256255149841,
0.6926159262657166,
0.6934033632278442,
0.6633020043373108,
0.7144469618797302,
0.7469926476478577,
0.7747598886489868,
0.7273134589195251
],
"type": "float32"
}
},
{
"name": "conv2d float32 4D input and filter tensors all options",
"inputs": {
Expand Down Expand Up @@ -1651,8 +1487,7 @@
0.8406119024104419
],
"type": "float32"
},
"activation": "relu" // relu operator
}
},
"expected": {
"name": "output",
Expand Down
Loading

0 comments on commit ab34829

Please sign in to comment.