• Home
  • History
  • Annotate
  • only in /frameworks/ml/nn/runtime/include/
History log of /frameworks/ml/nn/runtime/include/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
89e08c0689df686a54292c0e20d7b2bdf8b11b60 05-Jun-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Document unspecified dimensions." into pi-dev
9ecf6c51674bcf182185d3c80788c5d796415487 05-Jun-2018 David Gross <dgross@google.com> Document unspecified dimensions.

Test: mm

Bug: 77234888
Bug: 109687058
Change-Id: I8bc8aa1cb3d5092e94f34aa245bc4185516ac434
euralNetworks.h
63ca6c1661e50255ca6824e13c49c6e08cdadb5d 04-Jun-2018 Miao Wang <miaowang@google.com> Properly guard newly added APIs in P

- Use __ANDROID_API__ >= __ANDROID_API_P__ to guard all new APIs added
in Android P.

Bug: 109661480
Bug: 109661699
Test: mm
Change-Id: I3ad4fba01d7950a6a51e6ee3ef7fc96bf9488dc4
euralNetworks.h
aec086a4a628f1f186323f7db8f4574515d74f24 03-May-2018 Michael Butler <butlermichael@google.com> Free wrapper resource before assignment

Any resources owned by "this" (lefthand side of assignment) are never
released (as the destructor would do), but are overwritten by the
move-assignment process and are therefore leaked.

This CL frees the resource before assignment. Additionally, it adds
missing ownership documentation for Compilation.

Bug: 79205067
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Iacd561adee5205cb039fc7dea4fd1a816ca8d641
euralNetworksWrapper.h
f1a4694344c8acf2b157724ddf7df6ce2d1ac7bb 27-Apr-2018 Michael Butler <butlermichael@google.com> Sync updated NNAPI doc to HAL -- script

Additionally reformatted text to fit within 80 character line limit for
HIDL HALs.

Additionally removed "of each addition" from "Specifies the activation
to invoke on the result of each addition" because it was was included
regardless of the operation. As one example, it was included in CONV_2D,
which (although it includes a bias add) was confusing and unclear.

Bug: 72650109
Test: None, only documentation change
Change-Id: I779654aa30e1dec1f376ca173257e839fc68dc64
euralNetworks.h
eb336294144d6e32ee7e5284cd2c51da32df7ef8 20-Apr-2018 Michael Butler <butlermichael@google.com> Remove inconsistent references to "type" in NNAPI

"Type" in the NNAPI refers both to "OperandCode" and
"ANeuralNetworksOperandType" throughout the NNAPI documentation.

To make the documentation more consistent and less ambiguous,
this CL uses documentation links to the name itself instead of "type".

Bug: 72650109
Test: None, only documentation changes
Change-Id: I6718063da98a9c7ad10c4bb0452bca9a8986270b
euralNetworks.h
c8081626b9a9283425430b3775948a64ee305b08 26-Apr-2018 Mika Raento <mikie@google.com> Merge "Script syncing of types.hal from NeuralNetworks.h" into pi-dev
3340f8bea2913ee5f4d76193c11f1068b6582770 18-Apr-2018 Mika Raento <mikie@google.com> Script syncing of types.hal from NeuralNetworks.h

Automates the synchronization of Operand and Operation enums from
NeuralNetworks.h to types.hal

Fixed a couple of typos in NeuralNetworks.h that had been fixed in
types.hal. Edited NeuralNetworks.h language and formatting to match
types.hal for minimal diff and automatic syncing in the future.

Change-Id: I527a8829132bf74d4c032056afb9b05d6bb42d04
Bug: 77604249
Test: compared output with git diff
Test: mm in $ANDROID_BUILD_TOP
euralNetworks.h
2dcdbd97a63fb2563b7fe9865cea8d04481a2e27 23-Apr-2018 Miao Wang <miaowang@google.com> Fix the error code ANEURALNETWORKS_UNMAPPABLE

- The error codes should not clash with each other.
- Change ANEURALNETWORKS_UNMAPPABLE to be of value 7.
- The impact of this enum value change is expected to be minimal.

Bug: 68356625
Test: make checkbuild
Test: NNAPI CTS and VTS tests pass.
Change-Id: I85a8b9a2180659d9057564119802d851e4011fc6
euralNetworks.h
a98386dad9f0356e4e51395137d73bd558ed30bf 27-Mar-2018 Yang Ni <yangni@google.com> Fixed an error in LSTM documentation on peephole

Bug: 76431010

One of the inputs is independent of the other two, and not related to
the peephole optimization.

Test: None. Documentation change only.
Change-Id: Ia8aa3e86f31bfa5f5f8378bb9af1e293eae5bae8
euralNetworks.h
369a512b5626af9f1722a9674166adeeed5bc057 19-Apr-2018 Miao Wang <miaowang@google.com> Document that RESIZE_BILINEAR will not force align corner pixels.

Bug: 73961830
Test: mm
Change-Id: I7c94f3488343db2cb8be6852c08de5cdad6645c9
euralNetworks.h
6d78cf0e572d4117b3011bcf0ab768c47dc58031 12-Apr-2018 Mika Raento <mikie@google.com> Clarify Fully Connected Op comments and naming

- Make the reshaping of input clearer in header comment
- Make variable names in implementation match header comments
- Add a test for the case where first dimension is not the batch size

Bug: 74851002
Test: NeuralNetworksTest
Change-Id: Ic914d5b61ef162f2be04834bcd128208f13a627f
euralNetworks.h
58cbcf3e037e9f6db040b0f8b4d5fc06d6015e65 09-Apr-2018 David Gross <dgross@google.com> Fix documentation typos.

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.0::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all

Bug: 76016141
Bug: 67601776 (partial fix)

Change-Id: Iff881734a2aad5de9b58177111cb9793ea4853a6
euralNetworks.h
b66b5abcef40e88df6ac18ce7890372192102323 02-Apr-2018 Miao Wang <miaowang@google.com> Finalize STRIDED_SLICE

- Add documentation for begin_mask, end_mask, shrink_axis_mask.
- Add support for shrink_axis_mask, and corresponding tests.
- Add validation tests for STRIDED_SLICE.
- Updated existing tests and re-generated CTS and VTS tests.

Bug: 73661082
Test: NeuralNetworksTests_static
Change-Id: I49ad2ffcb3b7496ee1225618833ba324bb01c5b5
euralNetworks.h
56d801b8b91eab50228b754472cf1240a7e39acd 05-Apr-2018 Miao Wang <miaowang@google.com> Fix the spec for TENSOR_QUANT8_ASYMM to match our validation.

- Scale of 0.0 is invalid for quantized tensor.

Bug: 77236592
Test: mm
Change-Id: I050d9f4f44134f3193ba4a82b281b2a770a51bfa
euralNetworks.h
a9ce0001ca1df32fde3f322c385eef8ce7279329 23-Mar-2018 Miao Wang <miaowang@google.com> Remove unused / unimplemented parameter "crops" for BATCH_TO_SPACE

Bug: 73661175
Test: mm
Test: NeuralNetworksTests
Change-Id: If4b50c50e0847ce36016f6c257aac3b9d418c7b2
euralNetworks.h
247996038e3595d638dad6a54aeae69a634d8727 22-Mar-2018 Michael Butler <butlermichael@google.com> Explicitly set dimension to be nullptr when empty vector

An empty std::vector is allowed to have any value for the
std::vector::data (pointer) field. When a std::vector is
transferred into ANeuralNetworksOperandType::dimensionCount
and ANeuralNetworksOperandType::dimensions,
ANeuralNetworksOperandType::dimensions must be explicit set
to nullptr if the std::vector is empty.

This CL additionally has come code cleanup, such as removing the
now-unused setFromIntList utility function.

Bug: 76122637
Test: mma
Test: NeuralNetworksTest
Change-Id: I097464df78ee037fd87bc8a970f696d5d3bb6e3e
euralNetworksWrapper.h
0882987fa68df21b79fd1ddc6538da8a1fde65d2 20-Mar-2018 Miao Wang <miaowang@google.com> Remove obsolete comments about ANeuralNetworksMemory_createShared

Bug: 68822426
Test: mm
Change-Id: I7546333107281b39de6fbf8ed18371f1ad3dc7cb
euralNetworks.h
0deadd8c690b5a131d66e4bc03667315f28df321 14-Mar-2018 David Gross <dgross@google.com> Call validation from ModelBuilder::finish().

Also:
- Make incompletely-initialized large operand values recognizable
as incompletely-initialized (for easier validation and manual
debugging).
- Fix typos.

Test: nn/runtime/test/NeuralNetworksTest_static

Bug: 74784979

Change-Id: I4753ca137228d733b10097e68a3ef3e2fb6f46c7
euralNetworks.h
b74d2837ab1687c1a4f913aa5f90a9838efe0add 21-Feb-2018 Miao Wang <miaowang@google.com> Add relaxed execution tests

- Extend the test generator and test wrapper to allow relaxed
execution.
- Make the accpeted error range to be 5 ULP of FP16.
- Copy and modify existing V1_0 tests to be V1_1 relaxed tests.

Bug: 63911257
Test: mm
Test: Relaxed tests pass on devices with FP16 support
Change-Id: I8954aeeebcf7312d7d94580992708f1b42e2b32e
euralNetworksWrapper.h
084401d6215dca122999261c5ac3718ebf61b29e 14-Feb-2018 Michael Butler <butlermichael@google.com> NNAPI narrow evaluation for P -- runtime

We have determined that for Android P it is sufficient to have a
mechanism for a developer to specify on a per-model basis that it is
acceptable for FLOAT32 operations to be carried out as if they were
FLOAT16 operations. This CL manages the versioning differences between
1.0 and 1.1.

Bug: 63911257
Test: mm
Test: NeuralNetworksTest
Test: VtsHalNeuralnetworksV1_0TargetTest
Change-Id: If6f31536eedc92c4795056fdf3ff8818db1bc988
euralNetworks.h
58f0467869f275a18ec9c01859fc783ee9933f34 29-Jan-2018 Miao Wang <miaowang@google.com> Add new ops enum to NeuralNetworks.h

Test: mm
Bug: 63911257
Change-Id: I5e251fd199f3c4114e0275dab3081dc4de384d4e
euralNetworks.h
9c683a1fa8c5b8b4860adf7c277df64b38c3a0c9 06-Dec-2017 Miao Wang <miaowang@google.com> Fix a typo for implicit padding doc for DEPTHWISE_CONV_2D

Bug: 68318799
Test: mm
Change-Id: I216458fe4c1a17ccf1f5dcf20d04ad6f86c9834d
euralNetworks.h
a7e5f8d601737eebef06b7b4e3866975cc4645df 22-Nov-2017 David Gross <dgross@google.com> Improve error handling for Model::finish().

- finish() fails if Model is in invalid state.
- If finish() fails put Model in invalid state.

Test: nn/runtime/test

Change-Id: I9bf16a332505136d67d371ba5d55f56b7c3cce53
euralNetworksWrapper.h
46ada93580e5036924e969b56799e2c62bdb8699 01-Nov-2017 David Gross <dgross@google.com> Add missing Result values to NeuralNetworksWrapper.h.

Bug: 68728827

Test: nn/runtime/test
Change-Id: I00b4a09b5d0dcf3d1d6776fb4b57c9003820f16f
euralNetworksWrapper.h
c308618ad6e6ae365e063bf431db7fa1036eee07 30-Sep-2017 Yang Ni <yangni@google.com> Update LSTM documentation

Bug: 67184259
Bug: 67844091

Added the exact equations that are used in the current implementation.

Minor clean-ups to activation function, scratch buffer size, and
wording about building a model.

Local rendering here.
http://yangni-z840.mtv.corp.google.com/nnapi/group__NeuralNetworks.html#ggaabbe492c60331b13038e39d4207940e0ad0377e8c305e596fb7f64ff896671fc5

Test: None. Doc change only. Ran doxygen locally and visual inspects.

Change-Id: I75548afb126a1c1b30121125fdbc3af9b356b300
euralNetworks.h
1af33897ebdc15c41c94f93535df8904065d211b 14-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add documentation for PaddingCode in NeuralNetworks.h Bug: 67331808 Test: ran NeuralNetworksTest on marlin" into oc-mr1-dev
d1da6261af7d54c5f8343a18479ab77fe2449f8a 11-Oct-2017 gfan <gfan@google.com> Add documentation for PaddingCode in NeuralNetworks.h
Bug: 67331808
Test: ran NeuralNetworksTest on marlin

Change-Id: I4b879f8a67bc366bffb12601dba7f021659a6921
euralNetworks.h
1da8fed77c5c296afa18f754ec3616e7f02a4cfd 12-Oct-2017 Jean-Luc Brouillet <jeanluc@google.com> Pass large model operand values in shared memory.

Because of a limitation in HIDL, large tensor values (e.g. weights)
need to pass in shared memory rather than as HIDL arguments. This
prevented large models from running on a driver.

Separated the handling of memory pools so that request and model
pools are not comingled.

Also improve logging so we see more details about the models when
logging.

Bug: 67603060
Test: Ran system tests and VTS tests.

Change-Id: I760e31275699f9306c4b21945935dc3a4ca68754
euralNetworks.h
3a9b7c8eb10692fc746a954bfbc4b53b774d267b 10-Oct-2017 Yang Ni <yangni@google.com> Made embedding lookup take int lookups

Bug: 67459279

NN API only supported float tensors when this op was first added.
Now int tensors are allowed in the API and we have updated the
documentation saying the lookup indices are integers, we need
update the implementaion and tests of this op to match the
documentation.

Also reverted the input order to match TF Lite.

Test: NeuralNetworksTest
Test: adb shell
/data/nativetest64/embedding_lookup_test/embedding_lookup_test

Change-Id: Ie0db884ca772e8fb388876c3cef609016e753bf1
euralNetworks.h
a86baa03c7756a3a3cd9207ef38a23025dd27ad4 10-Oct-2017 Gerry Fan <gfan@google.com> Merge "Minor clarification for NeuralNetworks.h for EMBEDDING_LOOKUP and HASHTABLE_LOOKUP Bug: 67459279 Test: locally run cts NeuralNetworksTests on marlin" into oc-mr1-dev
a6ec3b4ac8a993214406235cfabc71f9c10b29b4 05-Oct-2017 gfan <gfan@google.com> Minor clarification for NeuralNetworks.h for EMBEDDING_LOOKUP and HASHTABLE_LOOKUP
Bug: 67459279
Test: locally run cts NeuralNetworksTests on marlin

Change-Id: Ib0bc48b3d0a2403820989d8c7d517081f5a9b647
euralNetworks.h
3a664717ca18db7941130e16538f75e10513a41d 09-Oct-2017 Miao Wang <miaowang@google.com> Fix RESIZE_BILINEAR documenation.

Bug: 67503562
Test: none needed
Change-Id: Ib59ce8d8dbe814b835c400081a286a0514b5f1be
euralNetworks.h
7faa4d8a5301bc64e89a0228037a373bc21259c5 05-Oct-2017 Gerry Fan <gfan@google.com> Merge "Fix test spec in depthwise_conv_2d and depthwise_conv_2d_quant8 Bug: 67381597 Test: locally run cts NeuralNetworksTests on marlin" into oc-mr1-dev
c96b526122230f552e5bbb96d4bd0497f50c5c91 05-Oct-2017 gfan <gfan@google.com> Fix test spec in depthwise_conv_2d and depthwise_conv_2d_quant8
Bug: 67381597
Test: locally run cts NeuralNetworksTests on marlin

Change-Id: Iba23f8d024e87d563b0020b6c02e30b2e65
euralNetworks.h
66d5cb6e3a90aefc8d545f6369080ab88de9d667 05-Oct-2017 Jean-Luc Brouillet <jeanluc@google.com> Rename setInputsAndOutputs

To avoid confusion with other set* functions, rename setInputsAndOutputs
to identifyInputsAndOutputs.

Also added a few new generated tests when I reran generate_test.sh.

Bug: 63905942
Test: local & VTS tests
Change-Id: Ie947044bee1a97426c847b9d66e60f0c25395bbc
euralNetworks.h
euralNetworksWrapper.h
4b9f4fa4e9353ec89310041499e82c2bcd1a3090 05-Oct-2017 David Gross <dgross@google.com> Merge changes Ia0ccf4e4,I5767d214 into oc-mr1-dev

* changes:
Allocate all inter-partition temporaries to a single Memory object.
Asynchronus partitioned execution, plus minor code cleanup.
a5e146a1efaf31028e2eeef53dd3264fd6d95563 05-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change stateful Ops to stateless ones" into oc-mr1-dev
e3178825b8686f3300a895572691a2e8c1f0676b 05-Oct-2017 David Gross <dgross@google.com> Asynchronus partitioned execution, plus minor code cleanup.

Partioned execution is now asynchronous end-to-end, although
the individual execution steps are serialized with respect to
one another.

Other changes:
- Minor code cleanup per comments from previous CL
https://googleplex-android-review.git.corp.google.com/#/c/platform/frameworks/ml/+/3000624/
including comments on memory management for
inter-partition temporaries.
- Remove "simulation" form of partitioning, and renumber
values of debug.nn.partition property accordingly.
- Fix android:nn:wrapper::Event -- add missing contructor
and fix comment.

Bug: 63905942
Test: mma (user)
mma (userdebug)
ml/nn/runtime/tests (userdebug)
(and spot check that debug.nn.partition unspecified,
0, and 1 exhibits the correct control over
partitioning behavior)

Change-Id: I5767d2144c4a42258444a6445866529919d4fe8d
euralNetworksWrapper.h
35d33fbbbda5d379d26a1d414a8e3e016e026938 05-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Fix a typo in documentation to FULLY_CONNECTED"" into oc-mr1-dev
ce38590c9b8e3f8b90c283472b54b47ad7a1f2b9 04-Oct-2017 Yang Ni <yangni@google.com> Revert "Fix a typo in documentation to FULLY_CONNECTED"

Bug: 63905942

The apostrophe to the matrix indicates a transpose.

This reverts commit 76354c87e4c1aad5da714828a633fe37404920a8.

Change-Id: I8e84a2e39e826c8bfe25366cc6d8d1fd64252b4f
euralNetworks.h
eefb1e60444afd08a4350e11f281ac7064ebba63 04-Oct-2017 Yang Ni <yangni@google.com> Change stateful Ops to stateless ones

Bug: 63905942

Updated Ops RNN, LSTM, and SVDF.
Split outputs used for states into inputs and outputs.

Test: NeuralNetworksTest
Change-Id: Ia3d11f640cba4cab1b94d0b9746c46d347c024a4
euralNetworks.h
2a2b3842abe8bad7cde8a1c1ef5645291fd587b5 04-Oct-2017 Miao Wang <miaowang@google.com> Fix documentation of CONCATENATION.

Bug: 67185615
Test: none needed
Change-Id: I7100a0f67a80d83c47346d420c97ac83ff31613b
euralNetworks.h
a3bed7887a65e0662080d2630e228954ca578ca3 04-Oct-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix problem passing null optional operands." into oc-mr1-dev
76354c87e4c1aad5da714828a633fe37404920a8 03-Oct-2017 Yang Ni <yangni@google.com> Fix a typo in documentation to FULLY_CONNECTED

Bug: 63905942

Test: none. Not a code change.

Change-Id: I5e03e63a6599355ba970330ca1ad744e6999f695
euralNetworks.h
62cc2758c1c2d303861e209f26bddcf4d7564b73 28-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Fix problem passing null optional operands.

Allow optional operands to be specified in the model as having no value.
Modify the HAL to allow passing missing operands. Change the validation
of most operations to verify that none of their operands are missing.

Bug: 63905942
Test: Compiled and ran runtime/test.
Change-Id: I378bc51847a8fb30cb2d36c9bf707ebadc79289b
euralNetworks.h
35647da7af1f99b6abb48c4eeaec042ea9edfb4d 03-Oct-2017 Miao Wang <miaowang@google.com> Fix documentation of FULLY_CONNECTED, and add checks for input rank.

Bug: 67319070
Bug: 63905942

Test: mm
Test: NeuralNetworksTests pass
Change-Id: Ia19c643598c48682b65d4de984fb22d9c3bb05f9
euralNetworks.h
93e086fbc0f1577eabdffd0d3420589f2788bd95 02-Oct-2017 Miao Wang <miaowang@google.com> Remove activation parameter from CONCATENATION

Bug: 67185615
Test: mm
Change-Id: I3555259305761691ea65d2fff406d7fcd8ee8eb5
euralNetworks.h
8e86dabb2a154ba15f519138be46bffc0d30b20c 30-Sep-2017 Yang Ni <yangni@google.com> Merge "Updated data type for keys in Hashtable Lookup" into oc-mr1-dev
850d1eb131d62b07438ff5869bdb80e09fada766 30-Sep-2017 Miao Wang <miaowang@google.com> Allow implicit padding

- Upadte the documentation to support implicit padding.
- Removed error logging for implicit padding input.

Bug: 63905942
Test: mm
Test: NeuralNetworksTest pass
Change-Id: I5149433ccb393ed390ad9e24013249ef37c6aba8
euralNetworks.h
7da2c9a54b25fd15546d6f99eba06dff1ac9a862 29-Sep-2017 Yang Ni <yangni@google.com> Updated data type for keys in Hashtable Lookup

Bug: 63905942

This OP was initially added when the NN API only allowed floating-
point tensors.

Now since integer tensors are allowed in NN API, update the Hashtable
Lookup with the better suited data types.

Test: NeuralNetworksTest
Change-Id: I3dafb2f60bd428700a5a6de393b86dbd75f285dd
euralNetworks.h
25f0f2dcd7049cd9f8a60133697dff114bbbf00e 28-Sep-2017 Miao Wang <miaowang@google.com> Allow ADD and MUL taking quantized input.

- Implement the quant8 path for ADD and MUL.
- Add tests for quant8 ADD and MUL, both normal and broadcast version.
- Add validation for quantization parameters, forcing scale >= 0 and
zeroPoint in range [0, 255] for QUANT8_ASYMM type operands.

Bug: 63905942
Test: mm
Test: NeuralNetworksTest pass
Change-Id: Ib643217737af9624a079369e0aea792025223fbb
euralNetworks.h
c7e8396248b9f42a5cec48b4e7c1c03f3ba081b4 28-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix documentation for CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED." into oc-mr1-dev
c6973dfadcfef42729c5e379b149bc332715819f 28-Sep-2017 Miao Wang <miaowang@google.com> Fix documentation for CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED.

Bug: 63905942
Test: mm
Change-Id: I9d5d47691c0f233d617a1bd4b2dde804a95de343
euralNetworks.h
ef22aa5727b96e9a0863ef71cfbe3dbdac339408 16-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Create mutiple sample test drivers

Create multiple sample test drivers to better test partitioning.

Bug: 63905942
Test: Compiled, ran runtimte/tests and VTS tests.

Change-Id: I037aeb82a849592f3a931bcdc558f32010aa1146
euralNetworks.h
45bf79e5b9fee354fde7c1f64417d9ca4a1da7da 25-Sep-2017 Miao Wang <miaowang@google.com> Clarify the expectation of scale and zeroPoint for affected ops.

- Remove the OperandType constructor taking f_min and f_max as
quantization parameters as it causes confusions for ops like
LOGISTIC and SOFTMAX.
- Update the documenation to clearly state the expected scale and
zeroPoint for LOGISTIC, SOFTMAX and CONCATENATION.
- Update the tests to directly input scale and zeroPoint.

Bug: 63905942
Test: mm
Test: NeuralNetworksTest pass
Change-Id: Ia450d6ce9509205d22e6383bd7e454afa0568cbb
euralNetworks.h
euralNetworksWrapper.h
3309c4645147c763b3437f7d9d69a8725dc7cd38 24-Sep-2017 Miao Wang <miaowang@google.com> Fix documentation to use zeroPoint instead of offset or zero_value

Bug: 63905942
Test: mm
Change-Id: I29350d80b7fff597601837870cded41788037cf3
euralNetworks.h
874d039215516aebdaba2e242609199897fe80c0 23-Sep-2017 Miao Wang <miaowang@google.com> Fix sigmoid and softmax tests and implementation.

- CPU executor now checks both the scale and offset for the
output Shape.
- The golden references and output range for the tests are updated.

Bug: 63905942
Test: mm
Test: NeuralNetworksTest pass
Change-Id: I9e892ae0de8ea17298dbb7edb96036e1d30c84fb
euralNetworks.h
6dd108cb66fa0f79d416428fccd5bc74c4360f1a 22-Sep-2017 Quddus Chong <quddusc@google.com> Fixed small typos in header comments.

Test: none

Bug: 63905942
Change-Id: I879ec3cb5a7b4d62851e286997cdce6dac6924b1
euralNetworks.h
dec08deb44c829eca478214972170606323b66cf 18-Sep-2017 Miao Wang <miaowang@google.com> Fix documentation of depthwise convolution

Bug: 63905942
Test: mm
Change-Id: Ied08b698b1c10e4fc0f31445ae50a22c9e3dc8f5
euralNetworks.h
67573d1086d40fb50e6fe1dbcb84be43d9f05ac2 16-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix RNN documentation" into oc-mr1-dev
80e4de129633e61d116ddef412beb7e4db93106d 15-Sep-2017 Yang Ni <yangni@google.com> Fix RNN documentation

Bug: 63905942

The last two inputs were in the wrong order for the RNN operator.

Test: ran NeuralNetworksTest on marlin

Change-Id: I3e045eddb40409f4beb9f21d266c84d18c5406cb
euralNetworks.h
fbc04728deedbbf1a119460f5d3c950328b1aeae 14-Sep-2017 Quddus Chong <quddusc@google.com> Clean up docs.

Replace these references:
1) ANeuralNetworksExecution_wait
with:
ANeuralNetworksEvent_wait

2) ANeuralNetworksExecution_start
with:
ANeuralNetworksExecution_startCompute

3) ANeuralNetworksRequest_free
with:
ANeuralNetworksExecution_free

Test: none

Bug: 63905942

Change-Id: Ic8f0631f6e8be894c49d18448538583225a0ddec
euralNetworks.h
39dcb0f2cc87b0eba06b314a91d55e50efea5abe 14-Sep-2017 David Gross <dgross@google.com> Merge changes I5922f13a,I7194e277 into oc-mr1-dev

* changes:
Bring back Event, and wait on Event rather than on Execution.
Make Compilation API synchronous.
425b2594c76e934dfdbc93209253e3c189571149 14-Sep-2017 David Gross <dgross@google.com> Bring back Event, and wait on Event rather than on Execution.

This is at the recommendation of the API council.

This undoes change I50b8e155d9589210e14920237878a4f295e7755f

Bug: 63905942
Test: nn/runtime/test

Change-Id: I5922f13ae7070f7ec0af035557a9921c88ca9221
euralNetworks.h
euralNetworksWrapper.h
65aa556323f4a054f80a75b6c4c721b2a7ed3298 14-Sep-2017 David Gross <dgross@google.com> Make Compilation API synchronous.

Per advice from the API council, the Compilation API no longer exposes
asynchronous behavior to the user -- rather than start() and wait()
APIs, we now have a finish() API.

Also:
- Track whether or not Compilation::finish() has been invoked, for
the sake of API usage checking.
- Changed Model::finish() to return Result not int, for consistency.
- Made Model and Compilation documentation more similar to one another.
- Fixed typos in documentation.

NOTE: It's possible to implement compilation asynchronously behind the
synchronous API -- e.g., Compilation_finish() starts compilation
asynchronously, and we implicitly wait for it to complete at the point of
Request_startCompute(). However, this would defeat one of the purposes of
an explicit Compilation API -- giving the application control over when
to spend the time compiling, to keep it off a critical timing path, such
as repeatedly applying a model to a sequence of frames in real time.

Bug: 63905942
Test: nn/runtime/tests
Change-Id: I7194e277aa6211af66794d917dcc5254c7d81af4
euralNetworks.h
euralNetworksWrapper.h
a5c16e4e73a34e6776a8f071ab884444c28b6893 14-Sep-2017 Miao Wang <miaowang@google.com> Rename ANeuralNetworksOperandType.offset to zeroPoint

Bug: 63905942
Test: NeuralNetworksTest
Change-Id: I15464657dc4eed9adbfc444df306cd0062993be3
euralNetworks.h
euralNetworksWrapper.h
7612f29b31f97f3b15769264131566b36dea9a25 12-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Remove the initialization and shutdown APIs.

Initialize the list of drivers as needed rather than
requiring an API call. This initialization will be
triggered when compiling the first model.

Bug: 63905942
Test: Compiled and ran the unit tests.

Change-Id: I1893a9f9d96d9d241916de3a7dd3cb7a54e33b06
euralNetworks.h
euralNetworksWrapper.h
d2d0c031c43e8e5aafc75e8a652d79bcc2aaca99 12-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Update documentation. Remove IntList.

As NDK council request, updated some documentation and removed
IntList. Other issues will be addressed in other CLs.

Bug: 63905942
Test: Compiled and ran the unit tests.

Change-Id: Iff6898737696daa6bbf41643b07d0a4508af4c0d
euralNetworks.h
euralNetworksWrapper.h
66d56404cdfab9ab8aa79d4bda83be3832a3aff9 14-Sep-2017 Miao Wang <miaowang@google.com> Make the enums pass as int32_t, and make offset and length size_t.

- Also removes fp16 perf and bootup time info.

Bug: 63905942
Test: NeuralNetworksTest
Change-Id: I1f722fed06a4227eb5f204eb51f7728fe749f5ec
euralNetworks.h
euralNetworksWrapper.h
01df5047f2661fd8428d5fc966bc3b7984ec1857 14-Sep-2017 David Gross <dgross@google.com> Merge "Rename Request to Execution at the API level." into oc-mr1-dev
5e7827e7bdc7ee6b6fc9b1989070c98fa10e9797 13-Sep-2017 David Gross <dgross@google.com> Move OEM codes out of NeuralNetworks.h to new file NeuralNetworksOEM.h.

Also remove FAKE_QUANT operation.

Bug: 63905942
Test: nn/runtime/tests, vts

Change-Id: Ia9262ec727f93dfe1b0ccade4ed76347c55ba163
euralNetworks.h
euralNetworksOEM.h
euralNetworksWrapper.h
3ced3cfd5b8f22b632c35f24e585c4847383b195 13-Sep-2017 David Gross <dgross@google.com> Rename Request to Execution at the API level.

There's a separate notion of Request at the HIDL level;
this is not renamed.

Bug: 63905942
Test: nn/runtime/tests

Change-Id: I671e3b387d735a9091dc5a2d14afbea6b45f444c
euralNetworks.h
euralNetworksWrapper.h
05292dc440641a38fab6a07c1372ce6780816c1c 13-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update ANeuralNetworksMemory related API" into oc-mr1-dev
aca6ab57e0e07367724934dd372e0bf4e8bc6b3c 13-Sep-2017 Michael Butler <butlermichael@google.com> Merge "Neuralnetworks HAL cleanup -- frameworks/ml/nn" into oc-mr1-dev
5f916fc9a7ae95f172492bdfe5344c37beff3a6f 12-Sep-2017 Michael Butler <butlermichael@google.com> Neuralnetworks HAL cleanup -- frameworks/ml/nn

Does three primary cleanups:
1) Removes unused OperandTypes, creates OEM types
2) Creates explicit ErrorStatus; functions return status
3) IDevice::initialize renamed to getCapabilities,
IDevice::getSupportedSubgraph renamed to getSupportedOperations

It makes the corresponding changes to the runtime.

Bug: 63905942
Test: mm, frameworks/ml/nn/runtime/test
Change-Id: I1545373dfa30780aaf9b61b3938be536cf122e74
euralNetworks.h
euralNetworksWrapper.h
42dc6a6cd68877cd85e3bc475b41bda0fd946c41 13-Sep-2017 Miao Wang <miaowang@google.com> Update ANeuralNetworksMemory related API

- Remove ANeuralNetworksMemory_createShared.
- Remove ANeuralNetworksMemory_getPointer.
- Allow a offset specified for
ANeuralNetworksMemory_createFromFd.
- Update the tests.

Bug: 63905942
Test: mm
Test: updated NeuralNetworksTests pass.
Change-Id: I1fd7362ec379f5f855c71c6758e0b647be9aaa76
euralNetworks.h
euralNetworksWrapper.h
b5474e8bbbf5bca2cf93d6c2bda1b56981428bad 13-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Documentation on speech/text OPs" into oc-mr1-dev
0408f166b02c866f141034615370f503b428c71a 11-Sep-2017 Yang Ni <yangni@google.com> Documentation on speech/text OPs

Bug: 63905942

Operations documented in this CL include:
Embedding Lookup;
Hashtable Lookup;
LSH Projection;
LSTM;
RNN;
SVDF.

Test: mm

Change-Id: I312a5164f63f5f646d7baddb3870e230e008b28a
euralNetworks.h
4ffc65b9cb9c9d04c694f0948117554526a46b17 12-Sep-2017 David Gross <dgross@google.com> Remove Event and wait on Request instead.

Bug: 63905942
Test: nn/runtime/tests
Change-Id: I50b8e155d9589210e14920237878a4f295e7755f
euralNetworks.h
euralNetworksWrapper.h
133ad4f3efd94aefc47d137e12b16e0b41cd6c4a 11-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Cleaned up the documentation.

- Fixed many formatting issues that would give Doxygen trouble.
- Corrected information on multithreading.
- Corrected misc. errors.
- Removed remaining TODOs.

Bug: 63905942
Test: Compiled & ran the unit tests.

Change-Id: I9c3f62b27fec372ee17d99323a129cbb9c3acbe1
euralNetworks.h
18c58d289c2346d750301392866229630960b392 12-Sep-2017 David Gross <dgross@google.com> Merge "Fix bug in the way an Event handles a bound thread." into oc-mr1-dev
d756f33874dccaedd99eef78942eaf4ae2389ed9 12-Sep-2017 David Gross <dgross@google.com> Merge "More discipline for models and requests." into oc-mr1-dev
402baa3fde7795bcea6e2ebeffab97c70b228dd4 12-Sep-2017 David Gross <dgross@google.com> Fix bug in the way an Event handles a bound thread.

Previously, we were calling std::thread::join() from the
Event destructor. However, if the Event's reference count
drops to zero due to action in the bound thread, then the
bound thread calls the Event's destructor, and tries to
join itself; this throws an exception, and produces a
message like

terminating with uncaught exception of type std::__1::system_error:
thread::join failed: Resource deadlock would occur

However, we do not seem to have had any test cases that actully
call ANeuralNetworksEvent_free(), so every Event would leak, and
we never hit this problem.

Now also change Request::compute() to stop leaking its event -- doing
this without changing bound thread handling would produce the exception
shown above.

Bug: 63905942
Test: nn/runtime/tests
Change-Id: I0d9370d187c10be00a4a69db8eb5f79854c9be12
euralNetworksWrapper.h
7c9cca3ae67378313c586e010f32fb29e648da95 12-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add documentation for ops" into oc-mr1-dev
544739620cd7f37d40524d2407c92042e485c73f 11-Sep-2017 David Gross <dgross@google.com> More discipline for models and requests.

- Must explicitly call new finish() API on model before compiling
or freeing.

- Must not modify a request once start() has been called on it.

Bug: 63905942
Test: nn/runtime/tests, nn/common/operations tests
Change-Id: Ifc6e614bda647d729e8702023a02613e629ca6a0
euralNetworks.h
euralNetworksWrapper.h
85e34644847dfc0c210520a21217aeb6269f3d3d 10-Sep-2017 Miao Wang <miaowang@google.com> Add documentation for ops

This CL adds/updates documentation for the following ops:
ADD
AVERAGE_POOL
CONCATENATION
CONV_2D
DEPTHWISE_CONV_2D
DEPTH_TO_SPACE
DEQUANTIZE
FLOOR
FULLY_CONNECTED
L2_NORMALIZATION
L2_POOL_2D
LOCAL_RESPONSE_NORMALIZATION
LOGISTIC
MAX_POOL_2D
MUL
RELU
RELU1
RELU6
RESHAPE
RESIZE_BILINEAR
SOFTMAX
SPACE_TO_DEPTH
TANH

Bug: 63905942
Test: mm

Change-Id: I23818067bebd1c510ed08b9ac466b7cfb28de039
euralNetworks.h
83e24dc4706a5b7089881a55daf05b3924fab3b7 10-Sep-2017 David Gross <dgross@google.com> Add compilation APIs.

For now, compilation is implemented as a synchronous no-op.

Bug: 63905942
Test: nn/runtime/tests, nn/common/operations tests

Change-Id: I1cb96a7e800671d0c70c9cc1b7eab6f8244232cb
euralNetworks.h
euralNetworksWrapper.h
23eda93ed8fd41bb4b35359ca91bf8163e20bccc 09-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Explicitly add "_2D" to applicable ops, and add fused activation function enum." into oc-mr1-dev
55cef2193279a646292fdeb355399627dd8990c8 09-Sep-2017 Miao Wang <miaowang@google.com> Explicitly add "_2D" to applicable ops, and add fused activation
function enum.

- Add the fused activation enum to explicitly set the expectation that
only the included ones are supported for fused ops.
- Add "_2D" to CONV, DEPTHWISE_CONV, AVG_POOL, MAX_POOL, and L2_POOL,
since they are only supposed to do 2D computation.
- Updated the tests and the stack to plumbing the changes through.

Bug: 63905942
Test: mm
Test: NeuralNetworksTests pass for both CPU path and sample hidl driver.
Change-Id: I60aeabab1d193d26d938c0d1d3ffdd519740d222
euralNetworks.h
0afe5897f4034528b027294efbe45c836924643c 09-Sep-2017 Michael Butler <butlermichael@google.com> Merge "Disallow copy semantics for NeuralNetworkWrapper objects." into oc-mr1-dev
fce2d202e5dd6f4b2193d84d8726ff4ba86e2fc8 09-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add support for mmaped file descriptor" into oc-mr1-dev
105807d963d969197fe78185ed588bfad3dc0ea5 05-Sep-2017 Miao Wang <miaowang@google.com> Add support for mmaped file descriptor

- create new API to create ANeuralNetworks_Memory from a mmaped fd.
- add the corresponding Memory constructor to NeuralNetworksWrapper.h
- Add unit test TestFd for the new API.

Bug: 63905942
Test: mm
Test: TestFd pass with CPU path.
Test: TestFd pass on sample HIDL driver, with ag/2588539

Change-Id: I1fcb0f0bd01e58bd592e18eff11c27034ee4a4c3
euralNetworks.h
euralNetworksWrapper.h
cc7f99f85cf9ee7df37e22ed5c957c76713b227d 07-Sep-2017 David Gross <dgross@google.com> Remove stray uses of "shared" from comments.

Bug: 63905942
Test: mm
Change-Id: I1e56bc8b95566c849b80982fa8a7c7ae95030d04
euralNetworks.h
7b87fec6bb919d16a8cc2820d470733a2776e8fa 07-Sep-2017 Michael Butler <butlermichael@google.com> Disallow copy semantics for NeuralNetworkWrapper objects.

Before this CL, the NeuralNetworks runtime would double-free a
NeuralNetworks runtime object if its corresponding wrapper object was
copied as in the following scenario:

{
Model base_model = Model(...); // ANeuralNetworksModel_create x1
Model copied_model = base_model; // Copies runtime object's pointer
} // ANeuralNetworksModel_free x2, double-free

This CL removes copy semantics on Wrapper objects. Additionally, it
explicitly handles move semantics to ensure the runtime object is only
freed once.

Bug: 63905942
Test: mm -j40
Change-Id: Ibd0e8e67eb851a97c18482683c8a37edd665b162
euralNetworksWrapper.h
04244491820e2e3c3bbe228948aee7baa11b65bd 04-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Improvements to the Memory code." into oc-mr1-dev
2150f1d186b2854fb5aa609594be12a667f845f0 01-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Improvements to the Memory code.

Addresses the comments of a previous CL that arrived after
submission. Change_Id of that CL was I997a10f6102dcae7c6876c96a4f6f913eaf54c74.

- Improved documentation.
- getPointer is now getPointerAndSize. It returns a status code, as
not all Memory will be able to return a pointer.

Test: Compiled and ran the unit test.
Bug: 63905942
Change-Id: I8aade863212dd7e95856d7c3d583c1b5f00eda48
euralNetworks.h
euralNetworksWrapper.h
689d892203c06c66c7bb2e374462a8434e40b75f 01-Sep-2017 Michael Butler <butlermichael@google.com> NNAPI Concurrent Query Management -- Implementation

The NNAPI requires requests on a model to be asynchronously
processed. This CL implements a basic Event that can later be used
to block the runtime thread until the asynchronous request has
completed.

The design document for NN API asynchronous behavior:
https://docs.google.com/a/google.com/document/d/1mO35KK3Mnr489ZftTDnKXXnXiYxk19jZ1C4DWOqaVB4/edit?usp=sharing

Bug: 63905942
Test: VtsHalNeuralnetworksV1_0TargetTest (32-bit, 64-bit) with sample driver enabled by cherry-pick
frameworks/ml/nn/runtime/test with and without sample driver enabled
Change-Id: I97b1d4cbf189176fb3b21b2cc1af09dddaff18ab
euralNetworks.h
b14b32a244f4fd6f5b192479c1b3ebbf3999bcff 01-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Cleanup the constants in NeuralNetworks.h" into oc-mr1-dev
c1ab6fc5e953a61811e9f25d2afff06bfa571f0e 01-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Cleanup the constants in NeuralNetworks.h

- Alphabetize the operations.
- Move the constants that count operation and types
out of the public header file.
- Remove N_GRAM operation.
- Add TENSOR_INT32.
- Add static assert verifications.
- Add documentation.

Test: Compiled and ran the tests.
Bug: 63905942

Change-Id: Ifafdcb3fd00efabd2b1972b035cc5d43f7dbec51
euralNetworks.h
fee08c736c9f273ca29e2dd3d4190121f0276c6e 01-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix the OperandType constructor in NN wrapper." into oc-mr1-dev
910c9f04913e3bee1a0b6406b6e146457d19c5e7 31-Aug-2017 Miao Wang <miaowang@google.com> Fix the OperandType constructor in NN wrapper.

- Use constructor delegation in OperandType constructors for the
quantized variants.

Bug: 63905942
Test: mm
Test: Created a quantized AVERAGE_POOL tests, and it pass
Change-Id: I1c0a4c26fc056873ff837ba2f60ec85923985fe2
euralNetworksWrapper.h
a67d8a0e28baef2fab57a2a3255461869abed74d 30-Aug-2017 Miao Wang <miaowang@google.com> Add OEM_OPERATION enum.

Bug: 63905942
Test: mm
Test: All unit tests passing on sailfish
Change-Id: I391ca039620be6525d95ad581acdb6e11d091af2
euralNetworks.h
15b59e721efe1a75b0e8cde8bd44bbb532446e13 12-Aug-2017 Yang Ni <yangni@google.com> Implement EMBEDDING_LOOKUP and HASHTABLE_LOOKUP

Bug: 63905942

Adapted previous TF Lite implementation and unit tests for NN API on
CPU.

Test: adb shell /data/nativetest64/embedding_lookup_test/embedding_lookup_test
Test: adb shell /data/nativetest64/hashtable_lookup_test/hashtable_lookup_test

Change-Id: I6e4a9d8c5d0d47e66e3fa771967da3526d19ac4b
euralNetworks.h
b8810af67d4efbd966d6788c56cd01c5aa06a71e 30-Aug-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add full support for Memory pools." into oc-mr1-dev
8b99bb1d98a42b67ba1c00e12c7abb3708cf7c05 21-Aug-2017 Jean-Luc Brouillet <jeanluc@google.com> Add full support for Memory pools.

Weights can now be passed via memory pools.

Test: Compiled and ran the unit test.
Bug: 63905942
Change-Id: I997a10f6102dcae7c6876c96a4f6f913eaf54c74
euralNetworks.h
euralNetworksWrapper.h
ca0ae89800ff957f76345c94eeb06d8c5643974b 29-Aug-2017 Jean-Luc Brouillet <jeanluc@google.com> Remove baseline models

Also remove submodels, which were to be used with baseline models.

Bug: 63905942
Test: Compiled and ran the tests on Marlin.
Change-Id: I54495e4e0dfbd6dabf049c8bdc2997600451b047
euralNetworks.h
euralNetworksWrapper.h
27e9be3904b034e422ee9b6ab70b35ea994d2b39 03-Aug-2017 Miao Wang <miaowang@google.com> Initial implementation of the following quantized ops.

- CONV_QUANT8
- DEPTHWISE_CONV_QUANT8
- AVERAGE_POOL_QUANT8
- MAX_POOL_QUANT8
- LOGISTIC_QUANT8

Additionally, added functions to plumb through quantization
parameters.

Bug: 63905942
Test: mm
Test: end-to-end MobileNet quantized test pass

Change-Id: Ib2753c68bf2c51467ae1c158b45541bcfdf10789
euralNetworks.h
euralNetworksWrapper.h
707dbd2d55f5dacf78ffb3ad7c8b3f37c2e9d758 25-Jul-2017 Jean-Luc Brouillet <jeanluc@google.com> Pass the model as an HIDL component.

Major rework where instead of serializing the model and
passing it in a shared memory, we pass it via HIDL.

The runtime/test code does two run, one goes through the
default CPU path, the other through any available driver.

Note: The code in hardware/../sample was written by Michael Buttler.

Bug: 63905942
Test: Runs both the CPU path and through the sample driver.
Change-Id: Ie3ee975d33056ba299895b13193f4698a690dd04
euralNetworks.h
euralNetworksWrapper.h
96775128e3bcfdc5be51b62edc50309c83861fe8 12-Jul-2017 Jean-Luc Brouillet <jeanluc@google.com> First implementation of the Neural Networks API.

This first version can run a simple query on the CPU either
via the fallback path or through a simulated driver.

This code has many deficiencies: single threaded, not all
validation are done, not going through HIDL, and not
enough unit tests. Expect more changes!

Test: Compiled and ran the unit tests

Change-Id: I9f6a485a2e7207aeb5f91a2904dcb4b7fd8a6f65
euralNetworks.h
euralNetworksWrapper.h