Commit graph

403 commits

Author SHA1 Message Date
TreeHugger Robot
c6145e4327 Merge "Statically check test enums against HIDL definitions." 2019-08-27 18:04:32 +00:00
Xusong Wang
323ba2ee8b Modify validateBurstSanitized to take a single request.
This CL is to modify validateBurstSanitized implementation in accordance
with the new test generator and test harness change in the same topic.

Bug: 123092187
Test: 1.2 VTS
Change-Id: Iacfe0e3bba8b4b44b7aee023d1c8129cbd089d4a
Merged-In: Iacfe0e3bba8b4b44b7aee023d1c8129cbd089d4a
(cherry picked from commit 8fc4622bf1)
2019-08-27 10:45:03 -07:00
Xusong Wang
6d0270b056 Modify 1.2 VTS tests to consume test struct directly.
Comparing with v1.1, the converter for 1.2 HIDL model has additional support
for extraParam, dynamic output shape, and zero-sized output.

Modify CompilationCachingTests to use the new test struct.

Bug: 123092187
Bug: 138718240
Test: All VTS
Change-Id: I54ac97f62898e47a338b51cc6d895a0309ab001f
Merged-In: I54ac97f62898e47a338b51cc6d895a0309ab001f
(cherry picked from commit 491b0a8913)
2019-08-27 10:44:29 -07:00
Xusong Wang
ead950d402 Modify 1.2 VTS tests to consume test struct directly.
Comparing with v1.1, the converter for 1.2 HIDL model has additional support
for extraParam, dynamic output shape, and zero-sized output.

Modify CompilationCachingTests to use the new test struct.

Bug: 123092187
Bug: 138718240
Test: All VTS
Change-Id: I54ac97f62898e47a338b51cc6d895a0309ab001f
Merged-In: I54ac97f62898e47a338b51cc6d895a0309ab001f
(cherry picked from commit 491b0a8913)
2019-08-26 15:10:18 -07:00
Xusong Wang
cbfa6b998e Statically check test enums against HIDL definitions.
Fixes: 123092187
Test: mma all VTS
Test: Attempt to modify test enum value,
      confirm that there is build error with proper error message.

Change-Id: I0129378c87637b33bb145ec93307634273a9d2fd
2019-08-26 14:47:30 -07:00
Xusong Wang
9e2b97b83c Update VTS tests with the new test harness.
Bug: 120601396
Test: All VTS
Change-Id: I539e75585b2cc01d153565814491361adfa048be
2019-08-26 14:15:15 -07:00
Xusong Wang
8fc4622bf1 Modify validateBurstSanitized to take a single request.
This CL is to modify validateBurstSanitized implementation in accordance
with the new test generator and test harness change in the same topic.

Bug: 123092187
Test: 1.2 VTS
Change-Id: Iacfe0e3bba8b4b44b7aee023d1c8129cbd089d4a
2019-08-21 17:35:10 -07:00
Xusong Wang
491b0a8913 Modify 1.2 VTS tests to consume test struct directly.
Comparing with v1.1, the converter for 1.2 HIDL model has additional support
for extraParam, dynamic output shape, and zero-sized output.

Modify CompilationCachingTests to use the new test struct.

Bug: 123092187
Bug: 138718240
Test: All VTS
Change-Id: I54ac97f62898e47a338b51cc6d895a0309ab001f
2019-08-21 17:35:05 -07:00
Slava Shklyaev
1c4b95fb56 Merge "Refactor generated NNAPI tests (follow-up)" am: 651869e0c6 am: adf64d6cbe am: 6c1d24473f am: 0deb8aa21b
am: 20763ef488

Change-Id: I9e96057d994c322157588b818de58bc09089e796
2019-08-15 13:39:20 -07:00
Slava Shklyaev
adf64d6cbe Merge "Refactor generated NNAPI tests (follow-up)"
am: 651869e0c6

Change-Id: Ia3bdfbfc6abbdc970efcd0cf31df2b58676eebe8
2019-08-15 10:15:52 -07:00
Slava Shklyaev
e2f9d55a26 Merge "Refactor generated NNAPI tests"
am: caedc76b18

Change-Id: I5087c042a51954a7276d7d20167f526884c987c0
2019-08-15 09:14:24 -07:00
Slava Shklyaev
0da5c34a3a Refactor generated NNAPI tests (follow-up)
Bug: 136097638
Test: m
Change-Id: I0688a843ab04caca9d62f95d38179804eb1b0f80
2019-08-07 12:29:38 +01:00
Slava Shklyaev
e8b2446b35 Refactor generated NNAPI tests
See change I2c0366fb87c96851fa6e0f8fe9ceac012d8e3513

Bug: 136097638
Test: m VtsHalNeuralnetworksV1_0TargetTest
Test: m VtsHalNeuralnetworksV1_1TargetTest
Test: m VtsHalNeuralnetworksV1_2TargetTest
Test: m VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Change-Id: I6fdede028422145d313d46532b5d2154ef0d40bc
Merged-In: I6fdede028422145d313d46532b5d2154ef0d40bc
(cherry picked from commit 2bcfdc82a0)
2019-08-07 12:17:59 +01:00
Michael Butler
8f77ce7442 NNAPI VTS fix from NNAPI CL: Cleanup HalInterfaces.h
am: 3835f61986

Change-Id: If5d04badade5bc72470aafd186468701d21ee2ee
2019-07-26 14:18:35 -07:00
Xusong Wang
6e8f9859c2 Move strided_slice_invalid_output_dims to spec directory.
am: ee7fe25e99

Change-Id: If3ac5efaf33acfe3f8aa3808e631f877216d3ead
2019-07-26 14:18:19 -07:00
Michael Butler
3835f61986 NNAPI VTS fix from NNAPI CL: Cleanup HalInterfaces.h
Prior to this CL, HalInterfaces.h polluted the global namespace through
the "using" declarations. To fix b/72880287, those names were put in a
new ::android::nn::hal namespace. This CL fixes the compilation errors
that occur due to this cleanup.

Bug: 72880287
Test: mma
Change-Id: Idb228e37615af7c0343a09f9a51de378e63bdb5a
Merged-In: Idb228e37615af7c0343a09f9a51de378e63bdb5a
(cherry picked from commit 4745a3d96e)
2019-07-26 13:55:25 +01:00
Xusong Wang
ee7fe25e99 Move strided_slice_invalid_output_dims to spec directory.
Bug: 132155416
Test: 1.2 VTS
Change-Id: I0479b8172c55e5e290f3fc8530a428ac5f54998f
Merged-In: I0479b8172c55e5e290f3fc8530a428ac5f54998f
(cherry picked from commit c99ced161c)
2019-07-26 13:55:24 +01:00
Slava Shklyaev
2bcfdc82a0 Refactor generated NNAPI tests
See change I2c0366fb87c96851fa6e0f8fe9ceac012d8e3513

Bug: 136097638
Test: m VtsHalNeuralnetworksV1_0TargetTest
Test: m VtsHalNeuralnetworksV1_1TargetTest
Test: m VtsHalNeuralnetworksV1_2TargetTest
Test: m VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Change-Id: I6fdede028422145d313d46532b5d2154ef0d40bc
2019-07-23 15:30:49 +01:00
Michael Butler
734a3020ac Merge "NNAPI VTS fix from NNAPI CL: Cleanup HalInterfaces.h" 2019-07-22 21:06:24 +00:00
Xusong Wang
0d0af2cbe3 Merge "Move strided_slice_invalid_output_dims to spec directory." 2019-07-22 19:47:38 +00:00
Michael Butler
6fd5eaec52 Update NN VTS callback objects
am: 051cf39f99

Change-Id: Ibab8657b851d56af18965766303e0f26bc51bded
2019-07-19 13:25:15 -07:00
Xusong Wang
237bfc9854 Remove compiler flag for dynamic output shape tests.
am: e108bc15e6

Change-Id: Icf4f851b0ed919f7041620d1e7a4b40ccfcbae34
2019-07-19 13:25:00 -07:00
Slava Shklyaev
868ef4ac7a Update paths to NNAPI VTS models
am: cac83eefa5

Change-Id: I72034e2205fb7a6052894271974d3bedcae71f6b
2019-07-19 13:24:44 -07:00
Slava Shklyaev
bc50034109 Refactor NNAPI VTS to remove unreasonable dependence between versions
am: 73ee79dafa

Change-Id: Ie79a5693ceb255d0e44579cc6627254840166d8f
2019-07-19 13:10:50 -07:00
Michael Butler
051cf39f99 Update NN VTS callback objects
The VTS Callback files are a subset of the Callback files in
frameworks/ml/nn/runtime/Callbacks.*. This CL syncs the implementations,
removing the functionality that is not needed in VTS.

Fixes: 132322149
Test: mma
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I114ce7f3b6c3d58de0196e9508209614d0a73e11
Merged-In: I114ce7f3b6c3d58de0196e9508209614d0a73e11
(cherry picked from commit 23d0e562e0)
2019-07-19 14:00:40 +01:00
Xusong Wang
e108bc15e6 Remove compiler flag for dynamic output shape tests.
Having separate VTS models and tests for difference HAL version. This
compiler flag is no longer needed.

Bug: 122740334
Test: All VTS 1.x and 1.xCompat1.y
Change-Id: Idbd96a954da9bd5a0e0e66afd9120d84a1efc784
Merged-In: Idbd96a954da9bd5a0e0e66afd9120d84a1efc784
(cherry picked from commit 7763d53545)
2019-07-19 14:00:38 +01:00
Slava Shklyaev
cac83eefa5 Update paths to NNAPI VTS models
See change If3bfbdfa016cd32a39b8a63028481da7318d6e02

Bug: 124040454
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
Change-Id: I17dd4377ee5110ac10ae8142fa7403329eda067c
Merged-In: I17dd4377ee5110ac10ae8142fa7403329eda067c
(cherry picked from commit 8226861489)
2019-07-19 14:00:35 +01:00
Slava Shklyaev
73ee79dafa Refactor NNAPI VTS to remove unreasonable dependence between versions
To make it easier to create the next version of NNAPI, this change
removes the following nonsensical dependence:
- NNAPI 1.0 VTS depends on NNAPI 1.1 and 1.2
- NNAPI 1.1 VTS depends on NNAPI 1.2

In particular, I made the following changes:
- split GeneratedTestHarness.cpp into three separate implementations,
- created a restricted version of Callbacks.h for 1.0 and 1.1,
- removed the dependency on frameworks/ml/nn/HalInterfaces.h,
- refactored Android.bp files for more autonomy between 1.0, 1.1, and 1.2,
- consolidated some common code into Utils.h,
- created structure for sharing code between VTS versions (VtsHalNeuralNetworksV1_0_utils).

Bug: 74827824
Bug: 124462414
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
Change-Id: I4243d0b5e574255cef1070850f4d0a284f65f54e
Merged-In: I4243d0b5e574255cef1070850f4d0a284f65f54e
(cherry picked from commit 1d6b465997)
2019-07-19 14:00:29 +01:00
Xusong Wang
c99ced161c Move strided_slice_invalid_output_dims to spec directory.
Bug: 132155416
Test: 1.2 VTS
Change-Id: I0479b8172c55e5e290f3fc8530a428ac5f54998f
2019-07-18 13:31:04 -07:00
Michael Butler
4745a3d96e NNAPI VTS fix from NNAPI CL: Cleanup HalInterfaces.h
Prior to this CL, HalInterfaces.h polluted the global namespace through
the "using" declarations. To fix b/72880287, those names were put in a
new ::android::nn::hal namespace. This CL fixes the compilation errors
that occur due to this cleanup.

Bug: 72880287
Test: mma
Change-Id: Idb228e37615af7c0343a09f9a51de378e63bdb5a
2019-07-17 21:25:37 +00:00
Michael Butler
23d0e562e0 Update NN VTS callback objects
The VTS Callback files are a subset of the Callback files in
frameworks/ml/nn/runtime/Callbacks.*. This CL syncs the implementations,
removing the functionality that is not needed in VTS.

Fixes: 132322149
Test: mma
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I114ce7f3b6c3d58de0196e9508209614d0a73e11
2019-07-16 17:13:13 -07:00
Xusong Wang
7763d53545 Remove compiler flag for dynamic output shape tests.
Having separate VTS models and tests for difference HAL version. This
compiler flag is no longer needed.

Bug: 122740334
Test: All VTS 1.x and 1.xCompat1.y
Change-Id: Idbd96a954da9bd5a0e0e66afd9120d84a1efc784
2019-07-11 10:01:41 -07:00
Slava Shklyaev
8226861489 Update paths to NNAPI VTS models
See change If3bfbdfa016cd32a39b8a63028481da7318d6e02

Bug: 124040454
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
Change-Id: I17dd4377ee5110ac10ae8142fa7403329eda067c
2019-07-03 15:58:08 +01:00
Slava Shklyaev
1d6b465997 Refactor NNAPI VTS to remove unreasonable dependence between versions
To make it easier to create the next version of NNAPI, this change
removes the following nonsensical dependence:
- NNAPI 1.0 VTS depends on NNAPI 1.1 and 1.2
- NNAPI 1.1 VTS depends on NNAPI 1.2

In particular, I made the following changes:
- split GeneratedTestHarness.cpp into three separate implementations,
- created a restricted version of Callbacks.h for 1.0 and 1.1,
- removed the dependency on frameworks/ml/nn/HalInterfaces.h,
- refactored Android.bp files for more autonomy between 1.0, 1.1, and 1.2,
- consolidated some common code into Utils.h,
- created structure for sharing code between VTS versions (VtsHalNeuralNetworksV1_0_utils).

Bug: 74827824
Bug: 124462414
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
Change-Id: I4243d0b5e574255cef1070850f4d0a284f65f54e
2019-07-03 15:58:08 +01:00
David Gross
491d626c89 Merge "Improve documentation related to execution." am: b575cedd74 am: 3059c66d53 am: 9c59f1d42b
am: 653714d3bb

Change-Id: Ib0a93f03cfa7bf1138fac44930d6eb95a8deb269
2019-06-21 12:28:33 -07:00
David Gross
9c59f1d42b Merge "Improve documentation related to execution." am: b575cedd74
am: 3059c66d53

Change-Id: Ie1b4244f9267a96df67f8f64c42b91f3b455f416
2019-06-21 12:11:13 -07:00
David Gross
b575cedd74 Merge "Improve documentation related to execution." 2019-06-21 18:40:03 +00:00
David Gross
f406bf9b1e Improve documentation related to execution.
Bug: 121347610 document that NNAPI Execution inputs/outputs and HAL Request inputs/outputs must not be modified

Test: cd hardware/interfaces/neuralnetworks/1.0/vts/functional ; mma
Test: cd hardware/interfaces/neuralnetworks/1.2/vts/functional ; mma

Change-Id: Iac71d6d5ad92a90afd1b6babb7cfa128d7484c64
2019-06-21 11:28:19 -07:00
Slava Shklyaev
a29dd23938 Ensure that drivers return an error if STRIDED_SLICE parameters are invalid am: 95a5978983
am: 87dff647e1

Change-Id: I92774e7aeff1376e354d6624d60e1add21810d33
2019-06-20 13:59:21 -07:00
Slava Shklyaev
95a5978983 Ensure that drivers return an error if STRIDED_SLICE parameters are invalid
We don't have a framework for handcrafting tests resulting in execution
failure. To produce this test, I created
strided_slice_invalid_output_dims.mod.py and used our VTS test generator
to create the corresponding example.cpp and model.cpp files. I put those
under the new directory neuralnetworks/1.2/vts/functional/generated to
distinguish them from the streamlined generated tests.

Bug: 79856511
Bug: 132155416
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: Ib331778605c2e3828195e1e7d1651091873985a0
Merged-In: Ib331778605c2e3828195e1e7d1651091873985a0
(cherry picked from commit 1a18c08052)
2019-06-19 11:16:48 +01:00
Lev Proleev
e61b7b98c9 Fix LSTM documentation
The documentation said that cell-to-input weights are required to be
present when input-to-input weights, recurrent-to-input weights and
input gate bias are present. This was incorrect since this weights can
be omitted if peephole connections are not used even if all the other
tensors are present.

Another bug that is fixed in this change is that for output #0 the docs
said "of shape [batch_size, num_units * 4] with CIFG, or [batch_size,
num_units * 3] without CIFG" when in fact it is the opposite, i.e.  "of
shape [batch_size, num_units * 3] with CIFG, or [batch_size, num_units *
4] without CIFG."

Existing CTS/VTS tests expect behaviour described in the fixed documentation.
Existing CPU implementation is also compliant with the fixed documentation.

Fix: 111842951
Test: mma
Change-Id: Id011783e33672ae65dc6fe3784cb26feb832acf9
Merged-In: Id011783e33672ae65dc6fe3784cb26feb832acf9
(cherry picked from commit e0537f09fb)
2019-05-15 14:57:34 +01:00
Slava Shklyaev
1a18c08052 Ensure that drivers return an error if STRIDED_SLICE parameters are invalid
We don't have a framework for handcrafting tests resulting in execution
failure. To produce this test, I created
strided_slice_invalid_output_dims.mod.py and used our VTS test generator
to create the corresponding example.cpp and model.cpp files. I put those
under the new directory neuralnetworks/1.2/vts/functional/generated to
distinguish them from the streamlined generated tests.

Bug: 79856511
Bug: 132155416
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: Ib331778605c2e3828195e1e7d1651091873985a0
2019-05-15 10:36:55 +00:00
Xusong Wang
8fe6f244f0 Merge "Add quant8 variant of VTS CompilationCachingTest." into qt-dev am: c9d90efcc7
am: 5d8fec169e

Change-Id: I71acf1cabd83d0f9e70736990fc9305c5d133429
2019-05-09 20:23:37 -07:00
Xusong Wang
5d8fec169e Merge "Add quant8 variant of VTS CompilationCachingTest." into qt-dev
am: c9d90efcc7

Change-Id: Iccc7cbb84462e07d8f3462d3ef4eb4f3edf59459
2019-05-09 17:42:51 -07:00
Xusong Wang
0e0721f56e Add quant8 variant of VTS CompilationCachingTest.
Prior to this CL, the VTS compilation caching tests are using float32
models. However, there exists several drivers that only support QUANT8
operations, and most of the tests are simply skipped.

This CL makes the CompilationCachingTest fixture parameterized that
every test will run twice, with the first pass running with float32
models and the second pass running with quant8 models.

Bug: 132112463
Test: 1.2 VTS with sample drivers
Test: 1.2 VTS with test drivers that can read and write cache entries
Change-Id: Iaf28065e46c2d90ab8b347b9848be1e6546cce86
Merged-In: Iaf28065e46c2d90ab8b347b9848be1e6546cce86
(cherry picked from commit 35e7599eb2)
2019-05-09 15:45:35 -07:00
Xusong Wang
4f71afc50d Move getSupportedOperations out of saveToCache.
Before this change, getSupportedOperations_1_2 was invoked in
saveModelToCache prior to prepareModel_1_2, which delayed the model
preparation and cache overwriting always ran faster in
SaveToCache_TOCTOU test.

This change increases the chance that the model is overwritten after it
is saved in SaveToCache_TOCTOU test by moving getSupportedOperations_1_2
out of saveToCache.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Test: TOCTOU tests with a sample driver that is deliberately broken

Change-Id: Ieba6a82252623ac429d5fcb6950b99db949f9886
Merged-In: Ieba6a82252623ac429d5fcb6950b99db949f9886
(cherry picked from commit f8c5987bbd)
2019-05-09 15:45:01 -07:00
Xusong Wang
e371f6f85e Test corrupted data cache in CompilationCachingTests.
We only expect the driver to not crash.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries

Change-Id: Ic9bd7ad6e42d77d505955cb9dda597a39e95cdb6
Merged-In: Ic9bd7ad6e42d77d505955cb9dda597a39e95cdb6
(cherry picked from commit 83ab17f224)
2019-05-09 15:44:46 -07:00
Xusong Wang
7cc0cccf5d Test TOCTOU in VTS CompilationCachingTests.
Two tests are added into VTS:

1. The TOCTOU test, for a fixed number of iterations.

We try to attack the driver by replacing the model cache with another
cache entry from a similar model while the driver is saving to or
preparing from cache, and see if the driver crashes or falsely prepares
an unexpected model (by checking the execution result). Either of the
following results are acceptable

* Fails -> the driver detects this corruption.
* Succeeds and produces correct execution result -> the corruption
happens before saving to cache or after preparing from cache.

Due to the racy nature, this test is probabilistic and we run it several
times.

2. Similar to the TOCTOU test but replace the content between
compile-to-cache and compile-from-cache (once only).

Additionally, remove tmp cache directory if test succeeds.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Test: Check /data/local/tmp and confirm that
      * dirs are preserved on failure
      * dirs are removed on success

Change-Id: Ie04fa905f465c3775979f0ca74359d185dcacea9
Merged-In: Ie04fa905f465c3775979f0ca74359d185dcacea9
(cherry picked from commit a44e130a92)
2019-05-09 15:44:28 -07:00
Xusong Wang
c9d90efcc7 Merge "Add quant8 variant of VTS CompilationCachingTest." into qt-dev 2019-05-09 22:38:54 +00:00
Michael Butler
353a624bd4 Follow up CL to "Add validation tests for NNAPI Burst serialized format"
Bug: 129779280
Bug: 129157135
Test: mma
Test: atest NeuralNetworksTest_static
Test: atest VtsHalNeuralnetworksV1_0TargetTest (with sample-all)
Test: atest VtsHalNeuralnetworksV1_1TargetTest (with sample-all)
Test: atest VtsHalNeuralnetworksV1_2TargetTest (with sample-all)
Change-Id: I6bd088f01c051a76561c0ecf9bbf878bb21c5754
Merged-In: I6bd088f01c051a76561c0ecf9bbf878bb21c5754
(cherry picked from commit 0a1ad962bb)
2019-05-08 22:46:10 +00:00
Michael Butler
d6e38fd71b Add validation tests for NNAPI Burst serialized format
This CL adds the following two types of validation tests on the NNAPI
Burst serialized format:
(1) it directly modifies the serialized data (invalidating it) to ensure
    that vendor  driver services properly validates the serialized
    request
(2) it ensures that vendor driver services properly fail when the result
    channel is not large enough to return the data

This CL additionally includes miscellaneous cleanups:
(1) having a generic "validateEverything" function
(2) moving the "prepareModel" function that's common across
    validateRequest and validateBurst to a common area

Fixes: 129779280
Bug: 129157135
Test: mma
Test: VtsHalNeuralnetworksV1_2TargetTest (with sample-all)
Change-Id: Ib90fe7f662824de17db5a254a8c501855e45f6bd
Merged-In: Ib90fe7f662824de17db5a254a8c501855e45f6bd
(cherry picked from commit 20f28a24e9)
2019-05-08 22:40:22 +00:00
Xusong Wang
35e7599eb2 Add quant8 variant of VTS CompilationCachingTest.
Prior to this CL, the VTS compilation caching tests are using float32
models. However, there exists several drivers that only support QUANT8
operations, and most of the tests are simply skipped.

This CL makes the CompilationCachingTest fixture parameterized that
every test will run twice, with the first pass running with float32
models and the second pass running with quant8 models.

Bug: 132112463
Test: 1.2 VTS with sample drivers
Test: 1.2 VTS with test drivers that can read and write cache entries
Change-Id: Iaf28065e46c2d90ab8b347b9848be1e6546cce86
2019-05-08 15:22:34 -07:00
Michael Butler
7b1c33dd07 Merge "Follow up CL to "Add validation tests for NNAPI Burst serialized format"" into qt-dev am: e84f442c4c
am: 720f869dd9

Change-Id: I2aa81b9466c42b995d0aab27184a42d8939980c5
2019-05-08 15:05:04 -07:00
Michael Butler
720f869dd9 Merge "Follow up CL to "Add validation tests for NNAPI Burst serialized format"" into qt-dev
am: e84f442c4c

Change-Id: I4f40772d30e3b0fa5aeb41edbf9a7d8a26d2ef51
2019-05-08 14:35:43 -07:00
Lev Proleev
41cb1c3265 Merge "Fix LSTM documentation" into qt-dev am: 881e261f0e
am: 9201bd34ca

Change-Id: Ie838e84c562e584fb5588ebc96cb259b439c2c54
2019-05-08 14:23:19 -07:00
Michael Butler
e84f442c4c Merge "Follow up CL to "Add validation tests for NNAPI Burst serialized format"" into qt-dev 2019-05-08 21:04:12 +00:00
Lev Proleev
9201bd34ca Merge "Fix LSTM documentation" into qt-dev
am: 881e261f0e

Change-Id: Iaae38e885aa2f60d9d39030b2db06e7039cc0872
2019-05-08 13:49:14 -07:00
Lev Proleev
e0537f09fb Fix LSTM documentation
The documentation said that cell-to-input weights are required to be
present when input-to-input weights, recurrent-to-input weights and
input gate bias are present. This was incorrect since this weights can
be omitted if peephole connections are not used even if all the other
tensors are present.

Another bug that is fixed in this change is that for output #0 the docs
said "of shape [batch_size, num_units * 4] with CIFG, or [batch_size,
num_units * 3] without CIFG" when in fact it is the opposite, i.e.  "of
shape [batch_size, num_units * 3] with CIFG, or [batch_size, num_units *
4] without CIFG."

Existing CTS/VTS tests expect behaviour described in the fixed documentation.
Existing CPU implementation is also compliant with the fixed documentation.

Fix: 111842951
Test: mma
Change-Id: Id011783e33672ae65dc6fe3784cb26feb832acf9
2019-05-08 17:28:53 +01:00
Slava Shklyaev
cc0b0d4509 Document that quantized PAD behavior is undefined before NNAPI 1.2
We had no tests for quantized PAD in NNAPI 1.1 and think that vendors might have implemented different behaviors.

Bug: 122243484
Test: N/A
Change-Id: Ibfc0801ab746fc271dc5f8efc764b818c6d49df4
Merged-In: Ibfc0801ab746fc271dc5f8efc764b818c6d49df4
(cherry picked from commit b01ce9644e)
2019-05-08 15:34:41 +01:00
Miao Wang
9bfecb5591 Fix the order of width and height for NNAPI RESIZE_BILINEAR and
RESIZE_NEAREST_NEIGHBOR

  - The CPU implementation always had the order of {width, height}.
  - In P, the documentation was incorrectly changed to {height, width}.

Bug: 131623949
Bug: 130035110
Test: mm
Change-Id: I6c79459fa73347fb51fc34a76ad78d5ac207f210
Merged-In: I6c79459fa73347fb51fc34a76ad78d5ac207f210
(cherry picked from commit 286339b4c8)
2019-05-08 15:33:55 +01:00
Michael Butler
0a1ad962bb Follow up CL to "Add validation tests for NNAPI Burst serialized format"
Bug: 129779280
Bug: 129157135
Test: mma
Test: atest NeuralNetworksTest_static
Test: atest VtsHalNeuralnetworksV1_0TargetTest (with sample-all)
Test: atest VtsHalNeuralnetworksV1_1TargetTest (with sample-all)
Test: atest VtsHalNeuralnetworksV1_2TargetTest (with sample-all)
Change-Id: I6bd088f01c051a76561c0ecf9bbf878bb21c5754
2019-05-07 15:45:48 -07:00
Michael Butler
7dc791d1cd Merge "NNAPI: validate that FmqResultDatum padding is 0 -- VTS" into qt-dev am: 2cd02a4121
am: 557b9a9581

Change-Id: Ice778d3f6d5b31bc2d3e7f570b04196973fd2d63
2019-05-07 13:21:10 -07:00
Michael Butler
557b9a9581 Merge "NNAPI: validate that FmqResultDatum padding is 0 -- VTS" into qt-dev
am: 2cd02a4121

Change-Id: I6bbb1c4247ca7279edb35db1565afdb56b75f114
2019-05-07 12:54:12 -07:00
Michael Butler
ddb770f0e4 NNAPI: validate that FmqResultDatum padding is 0 -- VTS
FmqResultDatum::OperandInformation has padding that may not be
initialized by an NN HAL service instance. This CL adds a validation
check to ensure that services are not leaking uninitialized data through
this padding region.

Bug: 131356202
Test: mma
Test: atest VtsHalNeuralnetworksV1_2TargetTest
      (for ValidationTest with sample-all)
Test: altered sample-driver to randomly set a padding byte to 1;
      the new validation test successfully failed the test

Change-Id: I6661945392b3fc773493d8f2f306f29b39e09bab
2019-05-07 18:42:47 +00:00
Slava Shklyaev
796842078d Merge "Document that quantized PAD behavior is undefined before NNAPI 1.2" into qt-dev am: 7af01ada85
am: bb840a986a

Change-Id: Id09e8dc3a6ff6f9496274702be954cfd6209cf6b
2019-05-02 03:36:08 -07:00
Slava Shklyaev
bb840a986a Merge "Document that quantized PAD behavior is undefined before NNAPI 1.2" into qt-dev
am: 7af01ada85

Change-Id: Ie720d5e1010d5dfc40f7b05c212fa1e56a028a96
2019-05-02 03:31:09 -07:00
Michael Butler
b3b579659c Merge "Add validation tests for NNAPI Burst serialized format" into qt-dev am: ef85db2b65
am: 852820c4ed

Change-Id: I82295fb8c25f0a392ea8de449023f4a12368d954
2019-04-30 17:54:44 -07:00
Michael Butler
852820c4ed Merge "Add validation tests for NNAPI Burst serialized format" into qt-dev
am: ef85db2b65

Change-Id: I8c8cdab2b2ea67322601f7d35146430b555e821a
2019-04-30 14:05:38 -07:00
Slava Shklyaev
b01ce9644e Document that quantized PAD behavior is undefined before NNAPI 1.2
We had no tests for quantized PAD in NNAPI 1.1 and think that vendors might have implemented different behaviors.

Bug: 122243484
Test: N/A
Change-Id: Ibfc0801ab746fc271dc5f8efc764b818c6d49df4
2019-04-30 15:27:53 +01:00
Miao Wang
66c1e14e25 Merge "Fix the order of width and height for NNAPI RESIZE_BILINEAR and RESIZE_NEAREST_NEIGHBOR" into qt-dev am: e867be8b40
am: 0221549cfb

Change-Id: I795b47ee8e8a6640dcbfd69ea6a9606c003dffd4
2019-04-29 23:43:50 -07:00
Xusong Wang
35afac9757 Merge "Move getSupportedOperations out of saveToCache." into qt-dev am: 3ca195bf02
am: d49c50c270

Change-Id: I995d3ac2a416fb38483cd931bfd0489f2fa745d8
2019-04-29 23:15:33 -07:00
Miao Wang
0221549cfb Merge "Fix the order of width and height for NNAPI RESIZE_BILINEAR and RESIZE_NEAREST_NEIGHBOR" into qt-dev
am: e867be8b40

Change-Id: Ic98819efbddfba1be56fd4202806470aabdc29cf
2019-04-29 23:07:35 -07:00
Xusong Wang
d49c50c270 Merge "Move getSupportedOperations out of saveToCache." into qt-dev
am: 3ca195bf02

Change-Id: I391d730ee0c7d8965fe4066f303e8348d35013f8
2019-04-29 22:37:05 -07:00
Michael Butler
ef85db2b65 Merge "Add validation tests for NNAPI Burst serialized format" into qt-dev 2019-04-30 03:58:12 +00:00
TreeHugger Robot
e867be8b40 Merge "Fix the order of width and height for NNAPI RESIZE_BILINEAR and RESIZE_NEAREST_NEIGHBOR" into qt-dev 2019-04-30 03:23:31 +00:00
Miao Wang
286339b4c8 Fix the order of width and height for NNAPI RESIZE_BILINEAR and
RESIZE_NEAREST_NEIGHBOR

  - The CPU implementation always had the order of {width, height}.
  - In P, the documentation was incorrectly changed to {height, width}.

Bug: 131623949
Bug: 130035110
Test: mm
Change-Id: I6c79459fa73347fb51fc34a76ad78d5ac207f210
2019-04-30 00:06:17 +00:00
Michael Butler
20f28a24e9 Add validation tests for NNAPI Burst serialized format
This CL adds the following two types of validation tests on the NNAPI
Burst serialized format:
(1) it directly modifies the serialized data (invalidating it) to ensure
    that vendor  driver services properly validates the serialized
    request
(2) it ensures that vendor driver services properly fail when the result
    channel is not large enough to return the data

This CL additionally includes miscellaneous cleanups:
(1) having a generic "validateEverything" function
(2) moving the "prepareModel" function that's common across
    validateRequest and validateBurst to a common area

Fixes: 129779280
Bug: 129157135
Test: mma
Test: VtsHalNeuralnetworksV1_2TargetTest (with sample-all)
Change-Id: Ib90fe7f662824de17db5a254a8c501855e45f6bd
2019-04-29 23:56:48 +00:00
Xusong Wang
f8c5987bbd Move getSupportedOperations out of saveToCache.
Before this change, getSupportedOperations_1_2 was invoked in
saveModelToCache prior to prepareModel_1_2, which delayed the model
preparation and cache overwriting always ran faster in
SaveToCache_TOCTOU test.

This change increases the chance that the model is overwritten after it
is saved in SaveToCache_TOCTOU test by moving getSupportedOperations_1_2
out of saveToCache.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Test: TOCTOU tests with a sample driver that is deliberately broken

Change-Id: Ieba6a82252623ac429d5fcb6950b99db949f9886
2019-04-29 11:47:54 -07:00
Xusong Wang
988f9033ae Test corrupted data cache in CompilationCachingTests. am: 83ab17f224
am: 9f4cd602ec

Change-Id: I179aeb0816794c9f36a553d8adfd3baa1242c7c6
2019-04-26 19:19:53 -07:00
Xusong Wang
c3ecc2978b Test TOCTOU in VTS CompilationCachingTests. am: a44e130a92
am: 98bd9a6884

Change-Id: I05677c72259ccacdda8e05e041d74e0354c58228
2019-04-26 19:19:34 -07:00
Xusong Wang
9f4cd602ec Test corrupted data cache in CompilationCachingTests.
am: 83ab17f224

Change-Id: I25a761d0982a8eb4dc5b32d8925feab9f66f61a1
2019-04-26 19:08:43 -07:00
Xusong Wang
98bd9a6884 Test TOCTOU in VTS CompilationCachingTests.
am: a44e130a92

Change-Id: I2e55bfd50ae29981dbc2334b4dbc7dc8e43d02fa
2019-04-26 19:08:33 -07:00
Slava Shklyaev
8066e27ad8 Specify ranks supported by MAXIMUM and MINIMUM am: 6e15578156
am: e5c74550ac

Change-Id: Ide8e91f4f16d1f2cb2d3e2234396cac998c93eca
2019-04-26 16:45:43 -07:00
Slava Shklyaev
e5c74550ac Specify ranks supported by MAXIMUM and MINIMUM
am: 6e15578156

Change-Id: I98e4a1d9b83307967f68948c6f9c6f2a2ba14d43
2019-04-26 16:38:54 -07:00
Xusong Wang
83ab17f224 Test corrupted data cache in CompilationCachingTests.
We only expect the driver to not crash.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries

Change-Id: Ic9bd7ad6e42d77d505955cb9dda597a39e95cdb6
2019-04-26 15:35:03 -07:00
Xusong Wang
a44e130a92 Test TOCTOU in VTS CompilationCachingTests.
Two tests are added into VTS:

1. The TOCTOU test, for a fixed number of iterations.

We try to attack the driver by replacing the model cache with another
cache entry from a similar model while the driver is saving to or
preparing from cache, and see if the driver crashes or falsely prepares
an unexpected model (by checking the execution result). Either of the
following results are acceptable

* Fails -> the driver detects this corruption.
* Succeeds and produces correct execution result -> the corruption
happens before saving to cache or after preparing from cache.

Due to the racy nature, this test is probabilistic and we run it several
times.

2. Similar to the TOCTOU test but replace the content between
compile-to-cache and compile-from-cache (once only).

Additionally, remove tmp cache directory if test succeeds.

Bug: 123433989
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Test: VtsHalNeuralnetworksV1_xTargetTest with a test driver that can
      read and write cache entries
Test: Check /data/local/tmp and confirm that
      * dirs are preserved on failure
      * dirs are removed on success

Change-Id: Ie04fa905f465c3775979f0ca74359d185dcacea9
2019-04-26 15:35:03 -07:00
Slava Shklyaev
2331d7588e Specify ranks supported by MAXIMUM and MINIMUM
Note that this change documents existing behavior.

Bug: 131210955
Test: mma
Change-Id: I8d877153e1acc8ca2ad5179d7fd7cdc136838ca3
Merged-In: I8d877153e1acc8ca2ad5179d7fd7cdc136838ca3
(cherry picked from commit 6e15578156)
2019-04-26 15:34:31 +01:00
Slava Shklyaev
6e15578156 Specify ranks supported by MAXIMUM and MINIMUM
Note that this change documents existing behavior.

Bug: 131210955
Test: mma
Change-Id: I8d877153e1acc8ca2ad5179d7fd7cdc136838ca3
2019-04-25 10:42:43 +00:00
Lev Proleev
0a9895d9b7 Fix docs: clarify usage of float16 scalars in operations
Update the docs for ops:
- LOG_SOFTMAX
- LOCAL_RESPONSE_NORMALIZATION

The docs mentioned possibility to use float16 as an input type but
didn't specify that other inputs must be float16 as well in that case.

Fix: 123500722
Test: mma
Change-Id: I9028c4a109c80f0b8571fab45555818e9e4bc783
Merged-In: I9028c4a109c80f0b8571fab45555818e9e4bc783
(cherry picked from commit 6d13ba258b)
2019-04-24 13:55:25 +01:00
Slava Shklyaev
16a5cb1947 Clarify NNAPI documentation for MEAN
Bug: 113673389
Test: mma
Change-Id: Icd1ce2fb9054ab9ac6f660dce84823c73563ddb8
Merged-In: Icd1ce2fb9054ab9ac6f660dce84823c73563ddb8
(cherry picked from commit d6e605985b)
2019-04-24 13:55:17 +01:00
Slava Shklyaev
e19c19113d Clarify NNAPI documentation for RESHAPE
Bug: 117176461
Test: mma
Change-Id: I620873536ed99ac79b7eced286a8f2621524290b
Merged-In: I620873536ed99ac79b7eced286a8f2621524290b
(cherry picked from commit 5f5d5f9a54)
2019-04-24 13:55:11 +01:00
Slava Shklyaev
dcf92d4e95 Merge "Fix docs: clarify usage of float16 scalars in operations" into qt-dev am: 34e718703d
am: 59342bedd4

Change-Id: Ibe40288e9812fc3385cc345578813ef28950ad42
2019-04-23 09:36:49 -07:00
Slava Shklyaev
b019708ace Merge changes Icd1ce2fb,I62087353 into qt-dev am: f22bc9099e
am: f189a0b2ef

Change-Id: I4e0bbd56cfd0d94a363702b7b764db1801279bc1
2019-04-23 09:30:34 -07:00
Slava Shklyaev
59342bedd4 Merge "Fix docs: clarify usage of float16 scalars in operations" into qt-dev
am: 34e718703d

Change-Id: I62baf5479fa4fb80b7c54de9eb574cd4b99a5f93
2019-04-23 09:22:31 -07:00
Slava Shklyaev
f189a0b2ef Merge changes Icd1ce2fb,I62087353 into qt-dev
am: f22bc9099e

Change-Id: I496e65cd536d3629eb1eb2a773855ddfa6fb7a6f
2019-04-23 09:12:59 -07:00
Slava Shklyaev
34e718703d Merge "Fix docs: clarify usage of float16 scalars in operations" into qt-dev 2019-04-23 14:26:21 +00:00
Slava Shklyaev
f22bc9099e Merge changes Icd1ce2fb,I62087353 into qt-dev
* changes:
  Clarify NNAPI documentation for MEAN
  Clarify NNAPI documentation for RESHAPE
2019-04-23 14:25:54 +00:00
Steven Moreland
efd67db7ac Merge "Update hidl makefiles for bpfmt" am: ff0bd741ca am: 96f40f7b02
am: 6d494b2346

Change-Id: I25d4f6591506e1a84a3a302dfec82f59c30e67a4
2019-04-18 15:32:26 -07:00
Steven Moreland
6d494b2346 Merge "Update hidl makefiles for bpfmt" am: ff0bd741ca
am: 96f40f7b02

Change-Id: Idbf030e4993067bdb8181321bca2de00c9b6f7ef
2019-04-18 14:34:45 -07:00
Steven Moreland
ff0bd741ca Merge "Update hidl makefiles for bpfmt" 2019-04-18 20:59:48 +00:00
Viet Dang
014dd02f6e Merge "BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs" into qt-dev 2019-04-18 10:22:13 +00:00
Michael Butler
04878fd29a Fix IBurstCallback.hal typo
am: 248eaba9c1

Change-Id: I560703f4c19db1148411e094370a505c4e4e3d0c
2019-04-17 11:41:10 -07:00
Michael Butler
a1707a6b58 Fix IBurstCallback.hal typo
Test: mma
Bug: N/A
Change-Id: If753c6618c31a11672c4449f798fb57aa4bb7831
Merged-In: If753c6618c31a11672c4449f798fb57aa4bb7831
(cherry picked from commit f1ca6754a8)
(cherry picked from commit 24f9c4aa3f4e85d375da5e7df90b54bdf938b481)
2019-04-17 17:37:30 +00:00
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Viet Dang
ea551fd12a BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs
Bug: 123644584

Test: VtsHalNeuralnetworksV1_xTargetTest
Change-Id: I8829fd47094ca4af05e5d60da917499ce61acc5e
Merged-In: I8829fd47094ca4af05e5d60da917499ce61acc5e
(cherry picked from commit a8f33f7dbf)
2019-04-17 15:49:05 +00:00
Michael Butler
248eaba9c1 Fix IBurstCallback.hal typo
Test: mma
Bug: 126892442
Change-Id: If753c6618c31a11672c4449f798fb57aa4bb7831
(cherry picked from commit f1ca6754a8)
2019-04-17 01:23:46 +00:00
Michael Butler
f1ca6754a8 Fix IBurstCallback.hal typo
Test: mma
Bug: N/A
Change-Id: If753c6618c31a11672c4449f798fb57aa4bb7831
2019-04-16 15:13:50 -07:00
Lev Proleev
6d13ba258b Fix docs: clarify usage of float16 scalars in operations
Update the docs for ops:
- LOG_SOFTMAX
- LOCAL_RESPONSE_NORMALIZATION

The docs mentioned possibility to use float16 as an input type but
didn't specify that other inputs must be float16 as well in that case.

Fix: 123500722
Test: mma
Change-Id: I9028c4a109c80f0b8571fab45555818e9e4bc783
2019-04-12 17:49:54 +01:00
Slava Shklyaev
d6e605985b Clarify NNAPI documentation for MEAN
Bug: 113673389
Test: mma
Change-Id: Icd1ce2fb9054ab9ac6f660dce84823c73563ddb8
2019-04-12 17:49:54 +01:00
Slava Shklyaev
5f5d5f9a54 Clarify NNAPI documentation for RESHAPE
Bug: 117176461
Test: mma
Change-Id: I620873536ed99ac79b7eced286a8f2621524290b
2019-04-12 17:49:54 +01:00
Slava Shklyaev
ee4ee60689 Update documentation for MAXIMUM and MINIMUM
Fix: 130029167
Test: mma
Change-Id: Ieb0c3327a85331243af5e20a1f29f1be316267ee
Merged-In: Ieb0c3327a85331243af5e20a1f29f1be316267ee
(cherry picked from commit 901ac77a69)
2019-04-10 16:15:07 +01:00
Slava Shklyaev
80695d9b84 Merge "Update documentation for MAXIMUM and MINIMUM" into qt-dev am: fc192d58ce
am: 846ff982ae

Change-Id: If7874f42c6f92bb7abc790f347757c655b460f08
2019-04-09 12:45:49 -07:00
Slava Shklyaev
846ff982ae Merge "Update documentation for MAXIMUM and MINIMUM" into qt-dev
am: fc192d58ce

Change-Id: I0ca92822b11b8584cba334d59c77b9ce50cc9ce6
2019-04-09 11:13:06 -07:00
Viet Dang
80d016b7b8 Merge "BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs" am: 77f7fdfb70
am: aea0439a91

Change-Id: I09f5e1be87170b1403f6431d54702d09cd31b891
2019-04-09 08:23:01 -07:00
Treehugger Robot
77f7fdfb70 Merge "BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs" 2019-04-09 15:00:55 +00:00
Slava Shklyaev
901ac77a69 Update documentation for MAXIMUM and MINIMUM
Bug: 130029167
Test: mma
Change-Id: Ieb0c3327a85331243af5e20a1f29f1be316267ee
2019-04-09 09:34:18 +00:00
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
Viet Dang
723ff2dbfd BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs
Bug: 123644584

Test: VtsHalNeuralnetworksV1_xTargetTest
Change-Id: I8829fd47094ca4af05e5d60da917499ce61acc5e
Merged-In: I8829fd47094ca4af05e5d60da917499ce61acc5e
(cherry picked from commit a8f33f7dbf)
2019-04-05 17:20:13 +00:00
Viet Dang
c33407cd08 Merge "BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs" 2019-04-05 17:14:44 +00: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
8a4c1f5e12 Merge "Propagate ANNMemory_free to IBurstContext::freeMemory -- VTS update" 2019-04-02 21:57: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
Lev Proleev
778accda64 Merge "LSTM: require input layer norm weights to be omitted in case CIFG is used." 2019-04-01 10:36:19 +00:00
Michael Butler
102e0442d8 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
2019-03-29 13:25:53 -07:00
Viet Dang
a8f33f7dbf BidirectionalSequenceLSTM op: Fixes VTS test for merge_outputs
Bug: 123644584

Test: VtsHalNeuralnetworksV1_xTargetTest
Change-Id: I8829fd47094ca4af05e5d60da917499ce61acc5e
2019-03-29 10:57:43 +00:00
Michael Butler
e68668f65b 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
2019-03-28 13:41:14 -07:00
Lev Proleev
0480af9aa8 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
2019-03-28 15:56:33 +00:00
Xusong Wang
7b277acbd0 Sync operation docs between NeuralNetworks.h and HAL file am: 66baf74114 am: e265b746b9
am: 094a06c28e

Change-Id: I34c9eba2b4fa207486416a2b0a04c569aac76a69
2019-03-22 17:37:30 -07: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
David Gross
632b4bd9b0 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
2019-03-21 19:37:36 -07:00
Xusong Wang
b61ba1ed0b 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
2019-03-21 14:17:08 -07:00
Viet Dang
f404a1e894 BidirectionalSequenceLSTM op: Adds layer norm support.
Also updates documentation for this op and UnidirectionalSequenceLSTM
op.

Bug: 123644584

Test: in ag/6758764

Change-Id: I72d029fef6d890eb1771c21814b028b09af280c7
2019-03-21 18:23:30 +00:00
Lev Proleev
0b074a9ba5 Update scale restrictions in NN API ops docs am: c8b3d162c2 am: 28c60ff868
am: 1c94eb7c5d

Change-Id: Ie6e9cbe78a4182dc23d8916dcd220c5c51064b0a
2019-03-21 07:11:00 -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
8804423ca1 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
2019-03-13 16:27:05 -07:00
Miao Wang
8e501a7d31 Fix the documentation about paddings for SPACE_TO_BATCH_ND am: 9c9fea329e am: f29553e3e1
am: e9100c8b88

Change-Id: Iec682b2ea2dcbc5435d6d6f0ad3894f36f5f0ed8
2019-03-13 12:32:27 -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
9e53c0ddd6 Fix "tranpose" typo. am: 7b303e1670 am: 1d58b00848
am: 988ff70cd8

Change-Id: Ic7c3fbe9a9b6afbb4182c479be8d41df942e3988
2019-03-08 16:22:11 -08:00
Slava Shklyaev
b45f700b34 Specify NNAPI extension name format am: 1d2cd43476 am: f6bdc6a983
am: 1d3588a789

Change-Id: Ib97cd492c51a3ce463f17fb3a14905d8c2092e57
2019-03-08 12:35:26 -08: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
b4e306782c Fix operations docs am: fdf3c0363a am: 0775d27fe6
am: efc791ed73

Change-Id: Ib59ed39d256fe446df3ae820a122cdd01e98166e
2019-03-05 04:27:01 -08: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
7f4e21adda Merge "Update makefies: no 'types'" am: 4ee5ec1469 am: bab622f6a6
am: 7224bc9bcf

Change-Id: I434939e0770afa436c532a945542fce30a71ef7d
2019-03-04 16:05:59 -08:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Michael Butler
80ad3f8449 Merge "Add presubmit tests to NNAPI -- hardware/interfaces/neuralnetworks" 2019-02-20 18:23:40 +00:00