Commit graph

133 commits

Author SHA1 Message Date
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
Xusong Wang
8e8b70c439 Modify 1.0 VTS tests to consume test struct directly.
Implement converter utilities constructing HIDL model and request from
TestModel.

Bug: 123092187
Bug: 138718240
Test: All VTS
Change-Id: I0b26b7f41d31d5e63ed083ab5f6f269a3620f034
2019-08-20 15:33:38 -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
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
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
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
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
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
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
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
Pirama Arumuga Nainar
8e0b1c09b8 Merge "Re-enable asan for *VtsHalNeuralnetworksV1_0Test" 2019-04-18 21:22:18 +00:00
Pirama Arumuga Nainar
43562bdd74 Re-enable asan for *VtsHalNeuralnetworksV1_0Test
Bug: http://b/74200014

This is no longer broken after switching to lld.

Test: mmma SANITIZE_TARGET=address
hardware/interfaces/neuralnetworks/1.0/vts/functional

Change-Id: I0920da7db83222d089c7a571e9478fb7ad9ad9d4
2019-04-18 11:34:12 -07: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Przemyslaw Szczepaniak
c3da78ad14 Add support for QUANT8_SYMM_PER_CHANNEL as graph input
Bug: 119255406
Test: Vts/Cts NNAPI tests.
Change-Id: If7407355f7c1ac878f919369c06ec98592e3f3d4
Merged-In: If7407355f7c1ac878f919369c06ec98592e3f3d4
(cherry picked from commit 429096160d)
2019-01-09 14:15:52 +00:00
David Gross
4592ed15cd Add @1.2::IPreparedModel::executeSynchronously() and corresponding VTS tests.
Bug: 119274127

Test: all of the following, with the appropriate android.hardware.neuralnetworks@1.${X}::IDevice/sample-all
    VtsHalNeuralnetworksV1_0TargetTest
    VtsHalNeuralnetworksV1_0TargetTest
    VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
    VtsHalNeuralnetworksV1_1CompatV1_0TargetTest
    VtsHalNeuralnetworksV1_1TargetTest
    VtsHalNeuralnetworksV1_1TargetTest
    VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
    VtsHalNeuralnetworksV1_2CompatV1_0TargetTest
    VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
    VtsHalNeuralnetworksV1_2CompatV1_1TargetTest
    VtsHalNeuralnetworksV1_2TargetTest
    VtsHalNeuralnetworksV1_2TargetTest

Change-Id: Iedfa485b4008d9cec3b81ff4c0ce3ebc0b83c823
(cherry picked from commit 49e41678f5)
2019-01-02 11:13:11 -08:00
Xusong Wang
1a06e77831 Add 1.2 NN HAL: IPreparedModel & callbacks.
Create 1.2 version IPreparedModel, IPreparedModelCallback, and
IExecutionCallback.

Currently the new interfaces are created the same as 1.0 version,
but will have more methods introduced in later CLs.

Bug: 73506513
Test: VtsHalNeuralnetworksV1_xTargetTest with 1.2 sample driver
Change-Id: Icf4d04c22f88e825d87562f1489377fdf6bf585d
Merged-In: Icf4d04c22f88e825d87562f1489377fdf6bf585d
(cherry picked from commit b5cb8f7632)
2018-12-13 13:56:51 -08:00
Slava Shklyaev
dc98cb0a6b Add TENSOR_BOOL8 support to generated tests
Bug: 119096815
Test: mma
Change-Id: I6a9c49d5c4312a37a91943c668ff8c8ed5ef38c5
Merged-In: I6a9c49d5c4312a37a91943c668ff8c8ed5ef38c5
(cherry picked from commit 9e3fad1801)
2018-12-13 09:18:53 +00:00
Keun Soo YIM
68ae05dd2d pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Merged-In: I363450d205868f900e4925ccff1430e2a569f2a4
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-12-07 10:49:56 -08:00
Michael K. Sanders
650fd186e4 Adds float16 support to generated tests.
Uses the _Float16 type (ISO/IEC TS 18661-3:2015) for storage.

Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Bug: 113563458
Change-Id: I1779b828d397b5354dc854c68d21c159cd5b582c
Merged-In: I1779b828d397b5354dc854c68d21c159cd5b582c
(cherry picked from commit efa4c814fb)
2018-11-29 18:46:36 +00:00
Michael K. Sanders
a8efddc558 Autogenerates VTS ValidationTest tests.
This removes the use of a separately updated list of models
that has fallen out of sync.

Bug: 119293899
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.0::IDevice/sample-all

Change-Id: I2d8804d78331b8fceab4c622c871802aa0f0a4b4
Merged-In: I2d8804d78331b8fceab4c622c871802aa0f0a4b4
(cherry picked from commit b5fe58b95a)
2018-11-29 18:46:36 +00:00
Michael K. Sanders
fc2b10ec86 Separates VTS tests by HAL version.
This prevents a fatal relocation error trying to link
VtsHalNeuralnetworksV1_2TargetTest if it exceeds 1GB.

Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_2CompatV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_2CompatV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_1CompatV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.1::IDevice/sample-all
Test: VtsHalNeuralnetworksV1_0TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.0::IDevice/sample-all
Bug: 119135172

Change-Id: Id5cfdeddc2f0d810b4eb47084640ae1dbf297ea1
Merged-In: Id5cfdeddc2f0d810b4eb47084640ae1dbf297ea1
(cherry-pick from 0fb3892c93)
2018-11-29 18:46:31 +00:00
Lev Proleev
ed7ce7afdf Add int16_t to MixedTyped
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I223a36cd2106b54155e0a80ffabe4f7a1c1f23f9
Merged-In: I223a36cd2106b54155e0a80ffabe4f7a1c1f23f9
(cherry picked from commit ca80ff0840)
2018-11-09 20:57:12 -08:00
Lev Proleev
d36b7a8d52 Add static asserts to functions using MixedTyped
This makes it easier to find all the places that need to be changed
after adding a new type to MixedTyped.

Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I92867de6574ec6dc1a17e30d889c79501ea93063
Merged-In: I92867de6574ec6dc1a17e30d889c79501ea93063
(cherry picked from commit 9b490f4833)
2018-11-09 20:56:33 -08:00
Michael K. Sanders
da3bdbc918 Implements RANDOM_MULTINOMIAL CTS/VTS tests.
Bug: 113562775
Test: VtsHalNeuralnetworksV1_2TargetTest --hal_service_instance=android.hardware.neuralnetworks@1.2::IDevice/sample-all
Change-Id: I3d39d056bf5034e01ce9c5c5e3f416a63d7ec8eb
Merged-In: I3d39d056bf5034e01ce9c5c5e3f416a63d7ec8eb
(cherry picked from commit 941d61a62d)
2018-11-05 18:04:09 -08:00
Miao Wang
a57eb5bcd8 Update OWNERS
Test: none
Change-Id: I96db4de3f34837c9f3174fd01e7d06d3355617f3
Merged-In: I96db4de3f34837c9f3174fd01e7d06d3355617f3
(cherry picked from commit 6653e69dc6)
2018-10-09 13:10:11 +00:00
Slava Shklyaev
af528bc51c Sync docs with NeuralNetworks.h
Bug: 115855152
Test: none
Change-Id: I15b5207f3ffbea57a4c8313ce744a22ce72b402e
2018-09-24 12:31:03 +00:00
Slava Shklyaev
feb87a9cf8 Add VTS tests for NeuralNetworks v1.2
This is a copy the v1.1 tests since we don't have any new ops
implemented in v1.2 yet.

Bug: 114365802
Test: mm
Test: NNAPI VTS
Change-Id: Ida7525fcd3ae0fd6f88ff9591e06aba922bdae64
Merged-In: Ida7525fcd3ae0fd6f88ff9591e06aba922bdae64
(cherry-picked from 871be94770)
2018-09-21 14:46:24 +01:00
Xusong Wang
f6235f8a09 Fix logics for floating-point comparision in VTS test.
Set the acceptable error range based on both absolute tolerance and
relative tolerance.

Currently, absolute tolerance is set to 1e-5 for FP32 and 5 epsilon
(~5e-3) for FP16 relaxed computation. The relative tolerance is set to
5ULP of the corresponding precision. Add a TODO mark for potential
future adjustment on error limit based on testing.

Bug: 111768023

Test: none
Change-Id: Idedcec3e09fd7de9696811b93c81d0f180e896ef
2018-09-06 13:20:12 -07:00
David Gross
c6625a71e4 resolve merge conflicts of ad2db12b3a to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I11175cd1624734e50adc30e63cb32f652c8f1380
2018-06-19 11:49:35 -07:00
David Gross
f839bbedd7 resolve merge conflicts of 2a970cb851 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I587517c463d2d334f1f16eb614923d06d2dcaaaf
2018-06-19 10:00:21 -07:00