webmachinelearning / webnn

🧠 Web Neural Network API
https://www.w3.org/TR/webnn/
Other
393 stars 47 forks source link

Define a common term for logical tensor changes? #150

Closed anssiko closed 3 years ago

anssiko commented 3 years ago

https://github.com/webmachinelearning/webnn/pull/144/files/44870dee0271e50ead69da93bf4ef0b9c206537e

Looking at this PR, wouldn't it make sense to define a common term for logical tensor changes (e.g. views?) somewhere early in the document so that concept can be re-used?

via @cynthia https://github.com/webmachinelearning/webnn/issues/137#issuecomment-782802457

anssiko commented 3 years ago

@cynthia we discussed this issue on our recent call. Can you answer the following question:

@rafaelcintron: what does "tensor changes" mean in this context?

Thank you!

cynthia commented 3 years ago

Apologies for the delayed response. Sorry if it was unclear (I didn't know the right terminology) but I was referring to cases where it still refers to the same tensor, but has "changed" from the caller's point of view. One example would be a non-copying reshape, another would be a transpose.

anssiko commented 3 years ago

Per https://www.w3.org/2021/05/13-webmachinelearning-minutes.html#t02:

@wchao1115 and @gramalingam to draft a proposed resolution in this issue.

gramalingam commented 3 years ago

It seems like this is implementation-dependent. For example, a transpose may require a copy that actually reorders the data for some tensor-implementations and may not require a copy with some other tensor-implementations. In general, an implementation may optimize the implementation of certain ops to be very lightweight by avoiding copies, but it is hard to guarantee when this will or will not happen.

anssiko commented 3 years ago

@gramalingam feel free to turn your proposal into a PR for the spec. See https://github.com/webmachinelearning/webnn#pull-requests for instructions.

The syntax for adding an informative note to clarify this per your suggestion is simply:

Note: This is your note.

Editors @wchao1115 @huningxin can also help you out, but I'd like to encourage you to first try make a PR direct so we can grow our Bikeshed-savvy contributor base :-)

cynthia commented 3 years ago

Not having it normative is fine - or alternatively, normative with a "may" clause. The original issue was about have a consistent term across the spec when referring to this particular operation, as it's something many implementations will need to do for efficiency.

anssiko commented 3 years ago

@cynthia, https://github.com/webmachinelearning/webnn/pull/196 may have addressed this issue, see https://webmachinelearning.github.io/webnn/#programming-model-overview

anssiko commented 3 years ago

As discussed in WebML WG Teleconference – 2 Sep 2021 the group feels this issue has been addressed by #196.