forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS/Web]Added FusedConv. (microsoft#17766)
### Description Added FusedConv and FusedConvTranspose ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Improve performance
- Loading branch information
1 parent
9e8ad39
commit a2e9ba7
Showing
21 changed files
with
339 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
[ | ||
{ | ||
"name": "conv without bias addition A", | ||
"operator": "FusedConv", | ||
"attributes": [ | ||
{ "name": "activation", "data": "Relu", "type": "string" }, | ||
{ "name": "kernel_shape", "data": [2, 2], "type": "ints" } | ||
], | ||
"opset": { "domain": "com.microsoft", "version": 1 }, | ||
"cases": [ | ||
{ | ||
"name": "T[0]", | ||
"inputs": [ | ||
{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 80, 90], | ||
"dims": [1, 1, 3, 3], | ||
"type": "float32" | ||
}, | ||
{ | ||
"data": [1, 2, 3, 4], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [370, 470, 670, 770], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "T[1]", | ||
"inputs": [ | ||
{ | ||
"data": [10, 20, -30, -40, -50, -60, 70, 80, 90], | ||
"dims": [1, 1, 3, 3], | ||
"type": "float32" | ||
}, | ||
{ | ||
"data": [1, 2, 3, 4], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [0, 0, 390, 430], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "NHWC conv without bias addition A", | ||
"operator": "Conv", | ||
"attributes": [ | ||
{ "name": "activation", "data": "Relu", "type": "string" }, | ||
{ "name": "kernel_shape", "data": [2, 2], "type": "ints" } | ||
], | ||
"opset": { "domain": "com.ms.internal.nhwc", "version": 11 }, | ||
"cases": [ | ||
{ | ||
"name": "T[2]", | ||
"inputs": [ | ||
{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 80, 90], | ||
"dims": [1, 3, 3, 1], | ||
"type": "float32" | ||
}, | ||
{ | ||
"data": [1, 2, 3, 4], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [370, 470, 670, 770], | ||
"dims": [1, 2, 2, 1], | ||
"type": "float32" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "T[3]", | ||
"inputs": [ | ||
{ | ||
"data": [10, 20, -30, -40, -50, -60, 70, 80, 90], | ||
"dims": [1, 3, 3, 1], | ||
"type": "float32" | ||
}, | ||
{ | ||
"data": [1, 2, 3, 4], | ||
"dims": [1, 1, 2, 2], | ||
"type": "float32" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [0, 0, 390, 430], | ||
"dims": [1, 2, 2, 1], | ||
"type": "float32" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include "core/providers/js/operators/conv.h" | ||
namespace onnxruntime { | ||
namespace contrib { | ||
namespace js { | ||
|
||
ONNX_OPERATOR_KERNEL_EX( | ||
FusedConv, | ||
kMSDomain, | ||
1, | ||
kJsExecutionProvider, | ||
KernelDefBuilder() | ||
.TypeConstraint("T", DataTypeImpl::GetTensorType<float>()), | ||
onnxruntime::js::Conv<false, true>); | ||
|
||
} // namespace js | ||
} // namespace contrib | ||
} // namespace onnxruntime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.