Repository navigation
reduceLogSum, reduceLogSumExp, reduceSumSquare are not supported on OV/NNAPI #209
Description
Activity
@mingmingtasd They can all be emulated though e.g.
reduceLogSumwould be an element-wise log over a reduce-sum operation. LikewisereduceSumSquarewould be a reduce-sum over an element-wise square operation.The design goal of webnn is not to build a one-to-one mapping to each and every popular framework or platform API, as that would be impossible to achieve. The goal is to define a core set of operations that can be accelerated by the platform API when that acceleration is available while at the same time allowing the frameworks to be built on top of it without translation discrepancy or overhead.
Reacted by Dwayne Robinson@mingmingtasd They can all be emulated though e.g.
reduceLogSumwould be an element-wise log over a reduce-sum operation. LikewisereduceSumSquarewould be a reduce-sum over an element-wise square operation.The design goal of webnn is not to build a one-to-one mapping to each and every popular framework or platform API, as that would be impossible to achieve. The goal is to define a core set of operations that can be accelerated by the platform API when that acceleration is available while at the same time allowing the frameworks to be built on top of it without translation discrepancy or overhead.
Yes, good explanation for this issue which I raised here for disscusion, I agree with you, thanks a lot! @wchao1115
@mingmingtasd thanks for raising this issue, and thanks @wchao1115 for explaining the design goal of the API.
We discussed this on our call https://www.w3.org/2021/09/30-webmachinelearning-minutes.html#t04 and agreed to add an informative section to the reduction operations with pseudo-code on how reduceLogSum, reduceLogSumExp and reduceSumSquare ops could be emulated. See "The behavior of this operation can be generically emulated" for other similar examples in the spec.
We hope that will addresses this issue and also helps other readers of the spec who might have similar questions.
Reacted by mingmingtasdFlagging as editorial per conversation in #209 (comment) which says that the planned resolution is to provide the decomposition for the ops in question.
Reacted by Dwayne Robinson- added a commit that references this issue
on Apr 16, 2024
I find that for these three reducution ops:
reduceLogSum, reduceLogSumExp, reduceSumSquare
DMl/ONNX can support them while OV/NNAPI can't support them.