Commit graph

199 commits

Author SHA1 Message Date
Lev Proleev
e465f8e659 LSTM: require input layer norm weights to be omitted in case CIFG is used.
In case of CIFG LSTM, input layer norm weights are not used in the
computation.

Bug: 129126572
Test: mma
Change-Id: I57bc578606132a2c44c71ab63dd7645dcc001302
Merged-In: I57bc578606132a2c44c71ab63dd7645dcc001302
(cherry picked from commit 0480af9aa8)
2019-04-08 14:28:23 +01:00
Michael Butler
51c72186ce Propagate ANNMemory_free to IBurstContext::freeMemory -- VTS update
This CL adapts the VTS code to the corresponding changes made in the NN
utility library.

Bug: 128319484
Test: mma
Test: atest VtsHalNeuralnetworksV1_0Target
Test: atest VtsHalNeuralnetworksV1_1Target
Test: atest VtsHalNeuralnetworksV1_2Target
Change-Id: I470e8228cde2b75620ad851e4fe408f8e8329e7c
Merged-In: I470e8228cde2b75620ad851e4fe408f8e8329e7c
(cherry picked from commit 102e0442d8)
2019-04-03 22:48:35 +00:00
Michael Butler
60a2253bfb NNAPI Burst object cleanup -- VTS update
This CL adapts the VTS code to the corresponding changes made in the NN
utility library.

Bug: 119570067
Test: mma
Test: atest VtsHalNeuralnetworksV1_0Target
Test: atest VtsHalNeuralnetworksV1_1Target
Test: atest VtsHalNeuralnetworksV1_2Target
Change-Id: I7cbc1d7025c0352aa1ed29d71dc84c2fcfc20a4f
Merged-In: I7cbc1d7025c0352aa1ed29d71dc84c2fcfc20a4f
(cherry picked from commit e68668f65b)
2019-04-02 20:17:31 +00:00
Xusong Wang
66baf74114 Sync operation docs between NeuralNetworks.h and HAL file
Test: mma
Change-Id: I0fb44d734216e2f40a9a2d4efc3640acd923f932
2019-03-22 13:11:25 -07:00
Xusong Wang
ed0822bc78 Fix caching interface according to vendor feedback.
- Instead of isCachingSupport returning a single boolean, switch to
  getNumberOfCacheFilesNeeded returning the number of cache files. This
  is to support use cases when driver needs more than one cache file for
  each type, or when driver does not need data cache.

- Instead of a separate saveToCache, pass cache info along with
  prepareModel_1_2 to save into cache as well as perform compilation.
  This is to avoid a potential additional copy of cache files.

Bug: 123780248
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Change-Id: I921b7b8ccc3c66af19f6589f7213c6870d6f07bf
Merged-In: I921b7b8ccc3c66af19f6589f7213c6870d6f07bf
(cherry picked from commit b61ba1ed0b)
2019-03-22 13:10:54 -07:00
Viet Dang
ed5c004915 BidirectionalSequenceLSTM op: Adds layer norm support.
Also updates documentation for this op and UnidirectionalSequenceLSTM
op.

Bug: 123644584

Test: in ag/6758764

Change-Id: I72d029fef6d890eb1771c21814b028b09af280c7
Merged-In: I72d029fef6d890eb1771c21814b028b09af280c7
(cherry picked from commit f404a1e894)
2019-03-22 13:10:17 -07:00
David Gross
2d47c80c8e Add @V1_2::Capabilities to support all non extension operand types.
Performance information in Capabilities is used by the runtime when
it selects the appropriate processor to distribute work to.  Prior to
this CL, Capabilities can only distinguish between float and non-float
data types -- so, for example, float16 and float32 performance is
considered to be the same, and performance for all non-float data types is
considered to be the same.

Bug: 124041010

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all

Change-Id: I83fb5920c1c75afbd7750d793a0b8f3e72a0552c
Merged-In: I83fb5920c1c75afbd7750d793a0b8f3e72a0552c
(cherry picked from commit 632b4bd9b0)
2019-03-22 10:43:47 -07:00
Lev Proleev
c8b3d162c2 Update scale restrictions in NN API ops docs
NN API relaxed scale restrictions to improve compatibility with TF Lite.

Updated ops:
- CONV_2D
- DEPTHWISE_CONV_2D
- TRANSPOSE_CONV_2D
- GROUPED_CONV_2D
- FULLY_CONNECTED

Test: mma
Bug: 127427474
Change-Id: I9dabd27b21679b99d638c364464d815e1c199787
2019-03-21 10:26:26 +00:00
Xusong Wang
f80e3e7826 Fix condition in mutateOperationOperandTypeSkip for conv ops.
The filter tensor is not always operand 1 if there are multiple
operations in the model.

Test: 1.2 VTS tests with sample driver
Change-Id: I8925dfd18072ae5579657e8aa13128e7d9f58324
Merged-In: I8925dfd18072ae5579657e8aa13128e7d9f58324
(cherry picked from commit 8804423ca1)
2019-03-20 13:02:48 -07:00
Xusong Wang
0237edd144 Skip OUTPUT_INSUFFICIENT_SIZE test for zero-sized output.
Bug: 126737477
Test: 1.2 VTS with sample driver
Change-Id: I04afd962ed45eac16aacfa9664ad80ba0d4f5855
Merged-In: I04afd962ed45eac16aacfa9664ad80ba0d4f5855
(cherry picked from commit d293315d93)
2019-03-20 13:02:32 -07:00
Miao Wang
9c9fea329e Fix the documentation about paddings for SPACE_TO_BATCH_ND
Bug: 123929388
Test: mm
Change-Id: I3acbfc7b1205774d9852ce8dd8c3144f250c793c
2019-03-12 15:08:08 -07:00
Elliott Hughes
7b303e1670 Fix "tranpose" typo.
Test: N/A
Change-Id: I5c02f66b1fdf4ee77564809b5610ba53d93273af
2019-03-08 12:15:39 -08:00
Slava Shklyaev
1d2cd43476 Specify NNAPI extension name format
Fix: 125376611
Test: mma
Change-Id: I7d7fcb5d23b4c998c4cd6cd8c9b14ec932876a17
2019-03-08 11:19:40 +00:00
Lev Proleev
fdf3c0363a Fix operations docs
* Add missing float16-related docs
* Fix weights' shapes in QUANTIZED_16BIT_LSTM

Bug: 126872052
Bug: 126870779
Test: mma
Change-Id: Iba0b208b101db676b03b04e03e43c7378877843c
2019-03-05 11:07:39 +00:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Lev Proleev
603244cb70 Adds TENSOR_QUANT8_SYMM support to test infrastructure
This is needed to be able to test DEQUANTIZE after adding
TENSOR_QUANT8_SYMM support.

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: Iba9b286df70919d7b67cd77c91e625a044bd686c
Merged-In: Iba9b286df70919d7b67cd77c91e625a044bd686c
(cherry picked from commit bf26a9e3d7)
2019-02-21 14:11:34 +00:00
Michael Butler
80ad3f8449 Merge "Add presubmit tests to NNAPI -- hardware/interfaces/neuralnetworks" 2019-02-20 18:23:40 +00:00
Michael Butler
58caa831bd Add presubmit tests to NNAPI -- hardware/interfaces/neuralnetworks
This CL creates a new suite of tests to enable presubmit tests:
* PresubmitHalNeuralnetworksV1_0TargetTest
* PresubmitHalNeuralnetworksV1_1TargetTest
* PresubmitHalNeuralnetworksV1_2TargetTest

These tests are the same as the VTS tests, with the exception that they
will skip running all tests (but still pass) if the service cannot be
found and its name starts with "service-".

This change does not affect the existing NNAPI VTS tests.

Test: mma
Test: atest
Bug: 124040554
Change-Id: I36a38b66b21fd51d0ca381bb4e05a39266dd353f
(cherry picked from commit ed68233697)
2019-02-19 12:04:24 -08:00
Lev Proleev
fd1134a6f3 Update TRANSPOSE_CONV_2D docs
* Add info about per-channel quantization
* Update current.txt

Test: mma
Change-Id: I197d984c8b65b4c46bf526eb137f212ad8844926
Merged-In: I197d984c8b65b4c46bf526eb137f212ad8844926
(cherry picked from commit 44015c090a)
2019-02-18 09:00:19 +00:00
Michael Butler
857142085f Pretty-print ErrorStatus and DeviceStatus test failure logs
Argument-dependent lookup will only work for operator>> if the operator
is in one of the argument's namespaces. This caused the enumerations to
pretty-print for V1_0, but not for V1_1 or V1_2. This change ensures the
V1_0 namespace is used.

Test: mma
Test: atest VtsHalNeuralnetworksV1_0TargetTest (verified the test output "OFFLINE" for DeviceStatus and "DEVICE_UNAVAILABLE" for ErrorStatus instead of raw byte value representation)
Test: atest VtsHalNeuralnetworksV1_1TargetTest (verified the test output "OFFLINE" for DeviceStatus and "DEVICE_UNAVAILABLE" for ErrorStatus instead of raw byte value representation)
Test: atest VtsHalNeuralnetworksV1_2TargetTest (verified ran and passed tests)
Fixes: 124316129
Change-Id: I764a46e2d87615b1f3da0ab0e6edb134bb533887
(cherry picked from commit 42a35bee10)
2019-02-15 13:34:50 -08:00
Xusong Wang
3ee1f4a333 Modify several 1.2 nn operation specs.
- Add TENSOR_QUANT8_ASYMM to RESIZE_BILINEAR
- Change the spec of batch_split in
  * GENERATE_PROPOSALS
  * ROI_ALIGN
  * ROI_POOLING
  * AXIS_ALIGNED_BBOX_TRANSFORM
  * BOX_WITH_NMS_LIMIT
- Add new op RESIZE_NEAREST_NEIGHBOR
- Fix minor specification error in
  * AXIS_ALIGNED_BBOX_TRANSFORM
  * GENERATE_PROPOSALS

Bug: 124060811
Bug: 124061329
Bug: 124061327
Test: 1.2 VTS tests with sample driver
Change-Id: If8b8cabd249f17247d8a5278b8360685c97c68e6
Merged-In: If8b8cabd249f17247d8a5278b8360685c97c68e6
(cherry picked from commit b9319bd3bf)
2019-02-14 18:13:35 -08:00
Xusong Wang
6824cc1e64 Remove tmp directory after CompilationCachingTest if cache not supported.
The tmp directory is only removed when the driver reports caching not
supported, otherwise it is kept for debugging purpose.

Test: 1.2 VTS tests with sample driver
Change-Id: I5969beb1ec365c992765f40d7693630606f16e18
Merged-In: I5969beb1ec365c992765f40d7693630606f16e18
(cherry picked from commit 350d91b1df)
2019-02-14 10:16:41 -08:00
Hervé Guihot
ac7ac525b2 Added missing ASSERT_NE.
Test was failing with segmentation fault (and crashing whole VTS) when
device was not available.

Change-Id: Id0f28d061dc5858fa00ef1bac5f7aa467d860864
Merged-In: Id0f28d061dc5858fa00ef1bac5f7aa467d860864
(cherry picked from commit 70d25b813e)
2019-02-14 10:15:27 -08:00
Miao Wang
6e06a5ce41 Fix the usage of GTEST_SKIP
Test: mm
Test: VtsHalNeuralnetworksV1_0TargetTest
Change-Id: I6baaf54c626778129c1aab4f6622af570b34ec3f
Merged-In: I6baaf54c626778129c1aab4f6622af570b34ec3f
(cherry picked from commit 4135a8e94c)
2019-02-13 14:21:22 -08:00
Lev Proleev
dce38f1364 Fix VTS tests.
* Adds a specification of invalid scale and zero point for TENSOR_BOOL8.
This fixes vts failures for comparison ops.
* Removes (FUNDAMENTAL_MIN - 1) from invalid OperationTypes.
FUNDAMENTAL_MIN is equal to 0 and resulting -1 was statically casted to
uint32_t and passed 4294967295 as an invalid OperationType. However, our
validateOperation function interpreted this ID as an extension ID and
didn't fail.
* Adds mutateOperationOperandTypeSkip for QUANTIZE and DEQUANTIZE.
* Adds removeOperandSkip for BIDIRECTIONAL_SEQUENCE_RNN.

Fix: 121130841
Fix: 123247345
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Change-Id: Iefb502c6b9301d5470eb4cdaa46d398f1a0e512a
Merged-In: Iefb502c6b9301d5470eb4cdaa46d398f1a0e512a
(cherry picked from commit 923b8c5842)
2019-02-13 13:16:28 +00:00
Steven Moreland
e694cb2dad neuralnetworks: Update makefiles.
Bug: N/A
Test: N/A
Change-Id: I83a920c646cf03dcc161a6fbc928a6dc09b2d7f1
Merged-In: I5fb6c126a090a3fe0fa4829ea9224564133dc1ae
2019-02-12 17:10:15 -08:00
Lev Proleev
2756283e30 Sync docs between NeuralNetworks.h and HAL file
Test: VtsHalNeuralnetworksV1_2TargetTest
Bug: 116445845
Fixes: 124246635
(cherry picked from commit 5d2ec0f5f0)
Merged-In: I4287a947faa260f69ba50c746bd40a0981548e50
Change-Id: I4287a947faa260f69ba50c746bd40a0981548e50
2019-02-12 13:49:56 -08:00
Slava Shklyaev
7081726008 Deprecate OEM types in NNAPI
Fix: 119856868
Test: N/A
Change-Id: I12e0c98324c1310815e150d24e0b25e26073a424
Merged-In: I12e0c98324c1310815e150d24e0b25e26073a424
(cherry picked from commit 341f6b335d)
2019-02-12 10:23:16 +00:00
Slava Shklyaev
e94dc72150 Update NNAPI Extensions documentation
This is a follow-up to change Ia9b99015eec7a48bbf969cbe503862271f09adca

Bug: 118605927
Test: mma
Change-Id: I7ddafca04bce6fd37a9c0877270cee325111d833
Merged-In: I7ddafca04bce6fd37a9c0877270cee325111d833
(cherry picked from commit 1ffe69a8e9)
2019-02-12 10:09:51 +00:00
Hervé Guihot
86a9fa0900 Added TENSOR_QUANT8_SYMM type.
Test: none
Change-Id: I02fc8698b3f80e1ae2a318e5cde593c6d7222bac
Merged-In: I02fc8698b3f80e1ae2a318e5cde593c6d7222bac
(cherry picked from commit bae91697b5)
2019-02-08 10:35:43 -08:00
Xusong Wang
cf6a9111cc Add new OperandType TENSOR_QUANT16_ASYMM.
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I8fcd6b30c32f8fbc181d2b43f9ac0b94fdc57e2f
Merged-In: I8fcd6b30c32f8fbc181d2b43f9ac0b94fdc57e2f
(cherry picked from commit d49f665c42)
2019-02-08 10:17:17 -08:00
Xusong Wang
96e68dc8e0 Add VTS tests for NNAPI compilation caching.
Add the following tests for compilation caching:
- validation tests
  - Test isCachingSupported
  - Test prepareModelFromCache with invalid numFd and invalid access mode
  - Test saveToCache with invalid numFd, invalid access mode,
    invalid file size, and invalid fd offset
- execution test
  - Save a mobilenet model to cache and then retrieve and run accuracy
    evaluation.
  - The same test but the file offsets for prepareModelFromCache is not at zero.
- security test
  - CompilationCachingSecurityTest.CorruptedSecuritySensitiveCache
    Randomly flip one bit of security-sensitive cache.
  - CompilationCachingSecurityTest.WrongLengthSecuritySensitiveCache
    Randomly append bytes to security-sensitive cache.
  - CompilationCachingSecurityTest.WrongToken
    Randomly flip one bit of cache token.

Bug: 119616526
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Change-Id: Iae9211cb28ce972b29572dfedd45d1ade4dfdaf5
Merged-In: Iae9211cb28ce972b29572dfedd45d1ade4dfdaf5
(cherry picked from commit 3405878e5e)
2019-02-08 10:17:17 -08:00
Slava Shklyaev
c9ff099c01 Add getSupportedExtensions to NNAPI IDevice
Bug: 118603011
Test: mma
Change-Id: I5bd1cf2dfd8c4700819d52a87931df2959ef6929
Merged-In: I5bd1cf2dfd8c4700819d52a87931df2959ef6929
(cherry picked from commit 6148d0f446)
2019-02-08 10:17:17 -08:00
Slava Shklyaev
bbcdc42abb Define NNAPI Extensions types
Machine Learning is a fast moving domain: new operations and data types
are introduced at a staggering speed. The Android API, on the other
hand, evolves on a yearly cycle. Many application developers, OEMs, and
SoC vendors would like to be able to define new operations at a faster
cycle.

In OC-MR1, NNAPI provided a simple mechanism to mitigate this problem:
two OEM data types and an OEM operation. The downside of this mechanism is that
it is simplistic: There’s no guarantee of consistency between vendors.

Examples of features that are required by the first parties' use cases
that we would like to be able to define outside of the normal Android
release cycle:
- New data types:
  - Sparse tensor (used by some speech generation models).
  - 16 bit int tensor (needed by OCR).
  - 16 bit float tensor.
- New operations:
  - 16 bit quantized LSTM (needed by OCR).
  - Basic primitives like sqrt and floor.
  - Logical operations.
  - Complex neural network layers.
  - Control flow.
- Enhancement to existing operations:
  - Concatenate supporting different scales/zeroPoints for arguments.
  - High-dimensional tensors.
  - Ordering of dimensions.

We are going to provide support for two types of extensions:
- NNAPI Platform extension. This is functionality that will become part of
  future releases of NNAPI. These extensions provide generic,
  non-vendor-specific functionality. Only the Android team can define new
  platform extensions. These extensions will be defined in the master
  branch of AOSP. Each extension comes with:
  - Documentation defining the extension,
  - A header file for the new constants,
  - A parameter validation library to be used by drivers, and
  - Validation tests akin to the CTS and VTS tests.
- Vendor extension. A vendor-specific extension is an alternative to OEM
  operation and data types. Its usage will be limited only to first party apps
  preinstalled on the /vendor or /odm partition.
  Each vendor will be identified by a specific value to
  prevent collisions between multiple IPs found on the same SoC. This
  effectively creates a vendor-specific namespace. These identifiers are
  assigned by Google.

This change only defines the new interface. The implementation follows
in changes Ie4e2530e4c81fabe4eb59b7a6ba4a3b4bb483bd1,
I02aa12f4a8444012ddf3b20c2bfbba6a21ce9ce9, and
Icf59ed04e602aa7a730eb1eb45e5f6b1204fafb3.

Bug: 118605927
Test: mma
Change-Id: Ia9b99015eec7a48bbf969cbe503862271f09adca
Merged-In: Ia9b99015eec7a48bbf969cbe503862271f09adca
(cherry picked from commit 9212018558)
2019-02-08 10:17:17 -08:00
Steven Moreland
941f105b60 Update makefiles.
Some of these are out of date.

Bug: N/A
Test: N/A
Change-Id: Ibf87fad9981d4e430a0bf797feadbb0bede232fc
2019-02-05 13:14:26 -08:00
Xusong Wang
4faf072e22 Add VTS test for dynamic output shape.
Test dynamic output shape with generated models when
- Dimensions of output operands are fully specified
- Dimensions of output operands are unspecified with sufficient buffer
- Dimensions of output operands are unspecified with insufficient buffer

Test: VTS on 1.2 sample driver
Change-Id: I4d26395ce443687ccbd47445b36e3356d70035cc
Merged-In: I4d26395ce443687ccbd47445b36e3356d70035cc
(cherry picked from commit 929fd21e06)
2019-01-30 11:18:24 -08:00
Slava Shklyaev
2739b2ef57 Shorten NNAPI enum range names
Test: mma
Change-Id: I5138589acc127336e8c0e72ca7d6b49532a4eeb9
Merged-In: I5138589acc127336e8c0e72ca7d6b49532a4eeb9
(cherry picked from commit 794703db84)
2019-01-30 10:49:49 -08:00
Miao Wang
d2668b5b9d Report "SKIPPED" for unsupported tests.
- Instead of reporting PASS for unsupported tests, use GTEST_SKIP to
  skip the tests at runtime.

Bug: 113356629
Test: mm
Test: VTS tests on HVX driver
Change-Id: I6a870b61809e58490e66dd4ea36ddeb64fc68a07
Merged-In: I6a870b61809e58490e66dd4ea36ddeb64fc68a07
(cherry picked from commit bb685a4a97)
2019-01-29 15:16:10 -08:00
Xusong Wang
fc67805f4a Implement NN HAL for compilation caching.
Add three methods
- IDevice::isCachingSupported
- IDevice::prepareModelFromCache
- IPreparedModel::saveToCache

Bug: 119616526
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: If28ffe0be48bcb9f4715293fc1201c8d2dbeb946
Merged-In: If28ffe0be48bcb9f4715293fc1201c8d2dbeb946
(cherry picked from commit 89dfafb42f)
2019-01-29 15:00:49 -08:00
Michael Butler
29471a8935 NNAPI Burst -- HAL VTS tests
FastMessageQueue is a Treble-compliant data structure that enables fast
communication between two processes. The FMQ object itself is an atomic
circular buffer that is optionally synchronized with a futex. However,
FMQ has no notion of ownership or lifetime across processes, so it must
be paired with higher-level constructs to manage the lifetime and
ownership.

The NNAPI is introducing the notion of an "Execution Burst" object (or
more simply a "Burst" object), which is similar to an
ANeuralNetworksExecution, but is intended to be reused across multiple
executions and has lower IPC overheads. It achieves this low IPC
overhead by replacing HIDL HwBinder calls with FMQ messages.
Specifically, it replaces IPreparedModel::executeSynchronously's call
from the client into the service with fmq_sync<FmqRequestDatum> (an FMQ
channel used to pass a serialized Request object) and it replaces
the return from the service into the client with
fmq_sync<FmqResultDatum> (an FMQ channel used to return serialized
result status and OutputShapes information).

Each channel is a unidirectional flow of information with exactly one
producer and exactly one consumer. The channels are created by the NN
runtime and passed to the service via
IPreparedModel::configureExecutionBurst.

This CL tests the Burst in both the execution path and validation path
in the Vendor Test Suite (VTS) in neuralnetworks/1.*/vts/functional/.

The VTS binary--VtsHalNeuralnetworksV1_2TargetTest--can be built and run
as any previous version could.

Bug: 119570067
Test: mma
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I3a36484eff9565c2d028c07c099804a0289f294a
Merged-In: I3a36484eff9565c2d028c07c099804a0289f294a
(cherry picked from commit 814d8372f3)
2019-01-29 18:34:34 +00:00
Xusong Wang
d22c5232f3 Test dynamic output shape in GeneratedTests.
Enable VTS unit test for dynamic output shape deduction.

Only test dynamic output shape for V1_2::IDevice with V1_2::Model.

Bug: 73506513
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: I4134e1ec54a15554eb8533134897279651b57da3
Merged-In: I4134e1ec54a15554eb8533134897279651b57da3
(cherry picked from commit a316581b21)
2019-01-24 19:11:36 -08:00
David Gross
55a3d328b7 Update neuralnetworks HAL to allow collecting execution duration.
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
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all

Bug: 115390094

Change-Id: If67a5ffe39cfdd78498e01f26251734fdc8e66c7
Merged-In: If67a5ffe39cfdd78498e01f26251734fdc8e66c7
(cherry picked from commit e301349b05)
2019-01-24 16:07:03 -08:00
Xusong Wang
5d67a0bf05 Clean and reorder operation enums.
Four operation enums are removed:
- DETECTION_OUTPUT
- PRIOR_BOX
- SPARSE_TO_DENSE
- EMBEDDING_LOOKUP_SPARSE

Operation enums are reorder into alphabetic order.

Bug: 123253865
Bug: 122744669
Test: NeuralNetworksTest_static
Change-Id: Ie5d2bff6fac061bdca0a99e5b8c8ac05733fac4b
Merged-In: Ie5d2bff6fac061bdca0a99e5b8c8ac05733fac4b
(cherry picked from commit 28a33a9cb1)
2019-01-24 16:05:33 -08:00
Lev Proleev
2d98264026 mutateOperationOperandTypeSkip for new TRANSPOSE_CONV_2D variant
Bug: 119255406
Test: Vts NNAPI tests.
Change-Id: I63f7fc67cedcc2a9db8c359ff96be3c9403b9a20
Merged-In: I63f7fc67cedcc2a9db8c359ff96be3c9403b9a20
(cherry picked from commit 1509a2664c)
2019-01-24 16:05:08 -08:00
Xusong Wang
b50bc313d7 Add 1.2 NN HAL interface for dynamic output shape.
Let notify_1_2() notify output shapes.

Document unspecified dimensions and rank.

Bug: 73506513
Bug: 77234888
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: I01108913212d9f4aa47daf2f293ea19259925865
Merged-In: I01108913212d9f4aa47daf2f293ea19259925865
(cherry picked from commit 187c59715c)
2019-01-24 14:19:00 -08:00
Miao Wang
e586a23815 Update NNAPI VTS test makefile after adding AHardwareBuffer support
Test: mm
Test: VTS
Change-Id: Ib98c08ce5cbbcd46f66ade80af28569f9cb14449
Merged-In: Ib98c08ce5cbbcd46f66ade80af28569f9cb14449
(cherry picked from commit 276b55b900)
2019-01-24 14:04:39 -08:00
Michael Butler
a06e261af9 NNAPI Burst -- HAL interface
FastMessageQueue is a Treble-compliant data structure that enables fast
communication between two processes. The FMQ object itself is an atomic
circular buffer that is optionally synchronized with a futex. However,
FMQ has no notion of ownership or lifetime across processes, so it must
be paired with higher-level constructs to manage the lifetime and
ownership.

The NNAPI is introducing the notion of an "Execution Burst" object (or
more simply a "Burst" object), which is similar to an
ANeuralNetworksExecution, but is intended to be reused across multiple
executions and has lower IPC overheads. It achieves this low IPC
overhead by replacing HIDL HwBinder calls with FMQ messages.
Specifically, it replaces IPreparedModel::executeSynchronously's call
from the client into the service with fmq_sync<FmqRequestDatum> (an FMQ
channel used to pass a serialized Request object) and it replaces
the return from the service into the client with
fmq_sync<FmqResultDatum> (an FMQ channel used to return serialized
result status and OutputShapes information).

Each channel is a unidirectional flow of information with exactly one
producer and exactly one consumer. The channels are created by the NN
runtime and passed to the service via
IPreparedModel::configureExecutionBurst.

This CL defines the FmqRequestDatum and FmqResultDatum types in
types.hal. IBurstContext.hal defines IBurstContext, a HIDL object used
by the service to manage the resources of a Burst. IBurstCallback.hal
defines IBurstCallback, a HIDL callback object that can be used to
retrieve the handle to a resource the service has either not yet seen or
has evicted from its cache. Finally, IPreparedModel.hal is extended with
IPreparedModel::configureExecutionBurst to create the burst object.

Bug: 119570067
Test: mma
Change-Id: I333da70201531b1396efc714d096c277e8e1d47b
Merged-In: I333da70201531b1396efc714d096c277e8e1d47b
(cherry picked from commit 7e91e24fe1)
2019-01-24 14:04:35 -08:00
Lev Proleev
b35eb1eabc mutateOperationOperandTypeSkip for new GROUPED_CONV_2D variant
Bug: 119255406
Test: Vts NNAPI tests.
Change-Id: I234727f5abba546c1392f7096b7d411d36566bbf
Merged-In: I234727f5abba546c1392f7096b7d411d36566bbf
(cherry picked from commit b0762ccb2f)
2019-01-24 14:04:01 -08:00
Miao Wang
7176fe7a63 Add HAL entry to allow querying the device type
Bug: 111425781
Bug: 112661050
Test: mm
Test: NeuralNetworksTest_static
Change-Id: Iced35c24eb2905c10fbf86d55319fdb5c7488703
Merged-In: Iced35c24eb2905c10fbf86d55319fdb5c7488703
(cherry picked from commit e3b93534c0)
2019-01-24 14:03:59 -08:00
Przemyslaw Szczepaniak
725f68487a mutateOperationOperandTypeSkip for new DEPTHWISE_CONV_2D variant.
Bug: 119255406
Test: Vts NNAPI tests.
Change-Id: Iaeb1ef1095dde51e9324f526a2126ed5d0491586
Merged-In: Iaeb1ef1095dde51e9324f526a2126ed5d0491586
(cherry picked from commit 47b9141609)
2019-01-10 18:12:28 +00:00