Commit graph

41 commits

Author SHA1 Message Date
Slava Shklyaev
a37c2c84aa Add NNAPI loop timeout VTS test
Fix: 149554639
Bug: 145906499
Bug: 136735929
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I642772d3c00c12d72380598d9d86743706179d72
Merged-In: I642772d3c00c12d72380598d9d86743706179d72
(cherry picked from commit cc873aee8f)
2020-02-26 10:36:07 +00:00
Slava Shklyaev
a96ab7407d Add NNAPI loop timeout API
Bug: 145906499
Bug: 136735929
Test: NNT_static
Change-Id: Ie40c248b174964676985403f9f1a5127b408a00a
Merged-In: Ie40c248b174964676985403f9f1a5127b408a00a
(cherry picked from commit f034bf9c92)
2020-02-19 11:58:35 +00:00
Slava Shklyaev
0fff59b961 Add control flow support to NNAPI VTS tests
See change I98a3edd1.

Bug: 148077633
Bug: 148601177
Bug: 136735929
Test: VtsHalNeuralnetworksV1_0TargetTest
Test: VtsHalNeuralnetworksV1_1TargetTest
Test: VtsHalNeuralnetworksV1_2TargetTest
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I1e436cdba404b68026a45797ac4fb3a34f8be76a
Merged-In: I1e436cdba404b68026a45797ac4fb3a34f8be76a
(cherry picked from commit 1f98e2e929)
2020-02-19 11:58:34 +00:00
Slava Shklyaev
315e9b8924 Add control flow performance to NNAPI Capabilities
Bug: 139181916
Test: m
Change-Id: I62696a6519191e33568c9664c0047fb57426b99f
Merged-In: I62696a6519191e33568c9664c0047fb57426b99f
(cherry picked from commit 8a9b306571)
2020-02-19 11:58:32 +00:00
Michael Butler
36902cbc2f NNAPI VTS: use max time point instead of uint64_t max
Bug: 149441015
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ic74f83242cbe04a4cec47adbfc51002fdf8bb47d
Merged-In: Ic74f83242cbe04a4cec47adbfc51002fdf8bb47d
(cherry picked from commit 79d6bb1ad2)
2020-02-19 11:58:30 +00:00
Lev Proleev
17689aa67d NNAPI: Add state outputs for {UNI|BI}DIRECTIONAL_SEQUENCE_{RNN|LSTM}
Fix: 138443991
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I0a3af22826d438f6f38de1f64042a50f98265e2d
Merged-In: I0a3af22826d438f6f38de1f64042a50f98265e2d
(cherry picked from commit 188a8f90f0)
2020-02-19 11:58:27 +00:00
Michael Butler
c3e1a29a60 NN 1.3 HAL: ANAPIC review follow up
This CL makes the following three interface changes:
* Removes @1.3::Operand.ExtraParams, because it was the same as
  @1.2::Operand.ExtraParams
* Changes int32_t token to uint32_t for IDevice::allocate and for
  @1.3::Request.MemoryPool
* Renames OptionalTimePoint::nanoseconds to
  OptionalTimePoint::nanosecondsSinceEpoch

This CL also makes test changes in response to the interface changes,
and fixes a minor comment issue in @1.2::types.hal and @1.3::types.hal.

Bug: 148617339
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I95b49ab34b0b79f587dda035ede700b73dc44a38
Merged-In: I95b49ab34b0b79f587dda035ede700b73dc44a38
(cherry picked from commit 6a4172cd3d)
2020-02-12 17:52:34 -08:00
Miao Wang
aaa3c24f10 Update VTS tests for executeFenced
- Remove the DEVICE_UNAVAILABLE check
 - Pass deadline down to the driver.

Bug: 148979873
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: If90a0dce8c8907a2f8f806455074fa27e3f397ef
Merged-In: If90a0dce8c8907a2f8f806455074fa27e3f397ef
(cherry picked from commit 15a25f6ec1)
2020-02-11 12:37:36 -08:00
Michael Butler
68a868b2ac NNAPI HAL: Remove priority from prepareModelFromCache_1_3
prepareModelFromCache_1_3 uses model cache and data cache that
represent a prepared model. Any argument that contributes in a
meaningful way to the prepared model is implicitly included in
this model cache and data cache. For example, "model" and
"executionPreference" appear in prepareModel_1_3 but not in
prepareModelFromCache_1_3 because they are implicitly included
in the model cache and data cache. In a similar way, because
it could affect the resulting model, "priority" should be
removed from prepareModelFromCache_1_3.

Fixes: 148802784
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I518e493ead8aa97220b16370cce8523b425c378c
Merged-In: I518e493ead8aa97220b16370cce8523b425c378c
(cherry picked from commit c90250ff57)
2020-02-06 11:38:08 +00:00
David Gross
0db1b54e9a redefine _Float16 as __fp16 for x86[_64] to allow removing workaround from inhouse clang
At present, the tests might not actually use _Float16 (the generated
tests that are incorporated into the functional tests are built in
frameworks/ml rather than in hardware/interfaces); but the makefiles
are changed anyway, in case _Float16 is added in the future.

Bug: 138709788

Test: for (walleye, aosp_x86 [on emulator], aosp_x86_64 [on emulator])
        Use clang where _Float16 is disabled for x86[_64]
        $ cd $ANDROID_BUILD_TOP/neuralnetworks/1.0/vts/functional
        inspect build commands for tests as to whether or not
          expected options related to redefinition are present
        $ cd $ANDROID_BUILD_TOP/neuralnetworks/1.1/vts/functional
        inspect build commands for tests as to whether or not
          expected options related to redefinition are present

Change-Id: I9225b228947696d249771b3a35b1f82de9c26b6e
(cherry picked from commit 2452ee5a80)
2020-02-05 11:09:22 -08:00
Miao Wang
99753d9e90 Update sync fence related API for NNAPI
- Allow IPreparedModel::executeFenced to measure gated durations.
 - Allow IPreparedModel::executeFenced to specify an optional deadline
 and aa optional post-gate-release maximum duration.

Bug: 142778241
Bug: 141363565
Test: mm
Change-Id: I1687ec5543f93ed9bb5d7fcf14dbe15ed5b5cd0d
Merged-In: I1687ec5543f93ed9bb5d7fcf14dbe15ed5b5cd0d
(cherry picked from commit 3fd70b020e)
2020-01-30 15:23:23 -08:00
Miao Wang
e51e4a9f26 Fix the NNAPI vts tests about validateExecuteFenced
- Skip the test if the driver reject executeFenced.
  - remove the -1 fd for hidl_handle as it causes error before reaching
  the driver.

Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Idc3f815040efccbbfa95b70d5d437441d0bd8682
Merged-In: Idc3f815040efccbbfa95b70d5d437441d0bd8682
(cherry picked from commit 33173a3e68)
2020-01-27 12:59:07 -08:00
Miao Wang
2b5c4cda77 Add VTS tests for NNAPI IPreparedModel::executeFenced
- Validation tests
  - Generated tests to exercise executeFenced path

Bug: 142778241
Test: mm
Change-Id: I509f0b5713fc86885d597940aae5ade0502c97ad
Merged-In: I509f0b5713fc86885d597940aae5ade0502c97ad
(cherry picked from commit 2c4e02329b)
2020-01-27 12:58:50 -08:00
Lev Proleev
53a51cb352 Add FILL and RANK ops
Bug: 148050168
Bug: 148049333
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Iebdfa600d84e31532807740c21d95cae41c76ad5
Merged-In: Iebdfa600d84e31532807740c21d95cae41c76ad5
(cherry picked from commit 8b3f240ea3)
2020-01-27 12:58:14 -08:00
Michael Butler
95899b3d39 Create VTS tests for QoS in NNAPI
Bug: 136739795
Bug: 142902514
Bug: 145300530
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: If3ab91cfb3158e4c33e809ff3b149dff47cda76f
Merged-In: If3ab91cfb3158e4c33e809ff3b149dff47cda76f
(cherry picked from commit 616701d3cd)
2020-01-27 12:51:42 -08:00
Michael Butler
79a41d77c0 Update NNAPI 1.3 VTS tests with new types
Bug: 136739795
Bug: 142902514
Bug: 145300530
Test: mma
Test: atest VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ie76da9dc9d6993a56bf644cfe20c5f5b421672c9
Merged-In: Ie76da9dc9d6993a56bf644cfe20c5f5b421672c9
(cherry picked from commit 9449a28b2f)
2020-01-27 12:51:34 -08:00
Slava Shklyaev
f8124a861f Add NNAPI control flow
Bug: 136735929
Bug: 139181916
Test: m
Change-Id: I7a75175f00fc98df626c40ea669021ccd40130e0
Merged-In: I7a75175f00fc98df626c40ea669021ccd40130e0
(cherry picked from commit a785a3faac)
2020-01-27 12:51:09 -08:00
Xusong Wang
e9da9852a5 Add memory domain VTS generated tests.
Bug: 141353602
Bug: 141363565
Test: 1.3 VTS
Change-Id: Ifc7eb3fd6f15e28ba403f02bdf66b4568bddcb64
Merged-In: Ifc7eb3fd6f15e28ba403f02bdf66b4568bddcb64
(cherry picked from commit 1f50e54cf8)
2020-01-24 14:25:32 -08:00
Xusong Wang
b345a4688f Memory Domain HAL: Define HAL APIs.
- Add and document memory domain HAL APIs.
- Make necessary changes to the existing VTS codes to make them work
  with V1_3::Request.

Bug: 141353602
Bug: 141363565
Test: mma
Test: NNT_static
Test: 1.3 VTS
Change-Id: Ia32555d4fef149fad4a79728981c5d9cca675a1a
Merged-In: Ia32555d4fef149fad4a79728981c5d9cca675a1a
(cherry picked from commit 931d5a18bc)
2020-01-21 15:15:39 -08:00
Lev Proleev
3c68b3412f Enable QuantizationCouplingTest in NNAPI VTS
Bug: 137828994
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I9b4f20ab0287be9cae9fc1b69a8f64cc8f1996b0
Merged-In: I9b4f20ab0287be9cae9fc1b69a8f64cc8f1996b0
(cherry picked from commit baac15d5fd)
2020-01-16 13:22:33 +00:00
Viet Dang
232cfebd5b Add quantized LSTM op.
Bug: 144841609

Test: NeuralNetworksTest_static

Change-Id: I8aab51695382211e003d8fc442d33bae3006dc13
Merged-In: I8aab51695382211e003d8fc442d33bae3006dc13
(cherry picked from commit c8b0cd33b9)
2020-01-10 11:15:14 +00:00
Lev Proleev
da779f322c Add quant8 signed generated tests
Fixes ValidateModel test for AXIS_ALIGNED_BBOX_TRANSFORM.

Bug: 136735770
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ie2959ba7258d8106d5b3dd36970181519b75e3b3
Merged-In: Ie2959ba7258d8106d5b3dd36970181519b75e3b3
(cherry picked from commit 16e8c9cc02)
2020-01-07 13:36:00 +00:00
Lev Proleev
673fdcf4e6 Add exceptions to the signed quantization coupling tests
Main commit is in frameworks/ml/nn. This one only renames
testModel.hasQuant8AsymmOperands() to
testModel.hasQuant8CoupledOperands().

Bug: 143935412
Bug: 143934188
Bug: 143935353
Bug: 143934467
Bug: 143934184
Test: quantization coupling tests in CTS and VTS
Change-Id: I0f7c331c355fe61ee06605786f09bc1ca7cdef57
Merged-In: I0f7c331c355fe61ee06605786f09bc1ca7cdef57
(cherry picked from commit 6a1d5e405f)
2020-01-07 13:35:58 +00:00
Lev Proleev
ae643ae705 Add TENSOR_QUANT8_ASYMM_SIGNED support for DEQUANTIZE
Add TENSOR_QUANT8_ASYMM_SIGNED to the list of exceptions when mutating
DEQUANTIZE for validation.

Bug: 143934768
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I1b3b0a362d3949d4e31708388100d4794846ca3a
Merged-In: I1b3b0a362d3949d4e31708388100d4794846ca3a
(cherry picked from commit 2bd0b3339c)
2020-01-06 15:20:16 +00:00
Xusong Wang
d4a060bb29 NN HAL: Upgrade IPreparedModel::executeSynchronously to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I4b74e8ac031c5d793cf7e5d66190734949367538
Merged-In: I4b74e8ac031c5d793cf7e5d66190734949367538
(cherry picked from commit ebd88ba8d2)
2020-01-06 15:20:14 +00:00
Przemyslaw Szczepaniak
2326dd1a88 Add TENSOR_QUANT8_ASYMM_SIGNED support for ARG(MIN|MAX)
Test: CTS/VTS
Change-Id: I4a90642f4d8500237fd41de76687fbe4c021b652
Merged-In: I4a90642f4d8500237fd41de76687fbe4c021b652
(cherry picked from commit e9f0b92568)
2020-01-06 15:20:10 +00:00
Lev Proleev
56cda83f8c Fix use-after-free error in NNAPI VTS tests
Replace std::initializer_list with std::vector.

Fix: 145705114
Test: VtsHalNeuralnetworksV1_[23]TargetTest
Change-Id: I92cbc56b2b8fbb36b3f3225e7cd0d4b05c84041e
2019-12-09 14:56:09 +00:00
Przemyslaw Szczepaniak
90fc2cc193 Add TENSOR_QUANT8_ASYMM_SIGNED support for more ops
Updated:
 BATCH_TO_SPACE_ND
 CHANNEL_SHUFFLE
 DEPTH_TO_SPACE
 GROUPED_CONV_2D
 PAD
 PAD_V2
 QUANTIZE
 RESIZE_BILINEAR
 RESIZE_NEAREST_NEIGHBOR
 SPACE_TO_BATCH_ND
 SPACE_TO_DEPTH
 SPLIT
 TILE
 TOPK_V2
 TRANSPOSE

Bug: 143934582
Bug: 143934585
Bug: 143934628
Bug: 143934630
Bug: 143934721
Bug: 143935039
Bug: 143935052
Bug: 143935113
Bug: 143935115
Bug: 143935141
Bug: 143935353
Bug: 143935355
Bug: 143935392
Bug: 143935394
Bug: 143935413
Test: quantization coupling tests in CTS and VTS
Change-Id: I7e1b65507ea0f7dcdfdb5fd98e7871d84f569ed7
Merged-In: I7e1b65507ea0f7dcdfdb5fd98e7871d84f569ed7
(cherry picked from commit 6d3cdc322b)
2019-12-02 11:40:40 +00:00
Lev Proleev
9226c1e910 Add quantization coupling test
Quantization coupling test is ran only on models that contain only one
operator and at least one of its inputs has a type of
TENSOR_QUANT8_ASYMM. The test verifies that a model with all the
operands converted to TENSOR_QUANT8_ASYMM_SIGNED will produce the same
result (OK/SKIPPED/FAILED).

Bug: 137828994
Test: VtsHalNeuralNetworksV1_3TargetTest --gtest_filter="*QuantizationCouplingTest*"
Change-Id: I5a2e09b2b1bd790e7e37dde133554e516155a34d
Merged-In: I5a2e09b2b1bd790e7e37dde133554e516155a34d
(cherry picked from commit c88f4c60a8)
2019-11-21 12:06:34 +00:00
Lev Proleev
0d4ba3f33a Combine test parameters into TestConfig structure
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter="GeneratedTests*"
Change-Id: I928aaa42e4745b4a8e0e461046e9632b052d0135
Merged-In: I928aaa42e4745b4a8e0e461046e9632b052d0135
(cherry picked from commit 66f598e10d)
2019-11-21 12:06:31 +00:00
Lev Proleev
3b60d80ff6 Add NNAPI 1.3 OperationType
* Add 1.3 OperationType.
* Remove "using V1_2::OperationType" from 1.3 VTS tests.
* Update current.txt

Test: mma
Change-Id: Ieaede9b7a6cecb16dbcc753f347f7ff04c009f20
Merged-In: Ieaede9b7a6cecb16dbcc753f347f7ff04c009f20
(cherry picked from commit 8774f10b76)
2019-11-21 12:06:27 +00:00
Xusong Wang
1b3f426648 NN HAL: Upgrade IPreparedModel::execute to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I9ca1e28ddc97fe880a72885afe7afb6c93903697
Merged-In: I9ca1e28ddc97fe880a72885afe7afb6c93903697
(cherry picked from commit 62a760c32d)
2019-11-19 12:18:41 -08:00
Xusong Wang
cc47dffa57 NN HAL: Upgrade IPreparedModelCallback::notify to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I56bc7a2fb179a9576036ad0c2aae0e1f41ec4e2c
Merged-In: I56bc7a2fb179a9576036ad0c2aae0e1f41ec4e2c
(cherry picked from commit 68c3234ad3)
2019-11-19 12:18:33 -08:00
Michael Butler
62b76902fb Add VtsHalNeuralnetworksV1_3TargetTest to TEST_MAPPING
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: Ic903a45fbb6487f2b8b18dfd32d356c987a98b14
2019-10-29 19:08:27 -07:00
Michael Butler
648ada5fcf NNAPI VTS update in response to utility function change
The frameworks/ml/nn CL "Improve performance of Burst executions"
changed the signature of a utility function used by NNAPI's VTS tests.
This CL modifies the test accordingly.

Bug: 132073143
Test: mma
Test: VtsHalNeuralnetworksV1_2TargetTest (with sample-all)
Test: VtsHalNeuralnetworksV1_3TargetTest (with sample-all)
Change-Id: I56c3b04e6fec11d526e2a1ff5b896f31cb12eb5f
Merged-In: I56c3b04e6fec11d526e2a1ff5b896f31cb12eb5f
(cherry picked from commit 5756887a7b)
2019-10-28 13:17:08 -07:00
Lev Proleev
26d1bc8a4e Modify NNAPI VTS tests to run on version 1.3
Bug: 139120468
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I4654dc75c17f8801103015dc1da91663dfa28d52
Merged-In: I4654dc75c17f8801103015dc1da91663dfa28d52
(cherry picked from commit b49dadfb64)
2019-10-17 18:34:51 +01:00
Lev Proleev
13fdfcd44f Copy VTS tests from v1.2 to v1.3
So that it's easier to see what actually has changed in VTS tests for
version 1.3

Bug: 139120468
Test: m
Change-Id: I09797f5f3898501a008186a22dd411b00e9e2c67
Merged-In: I09797f5f3898501a008186a22dd411b00e9e2c67
(cherry picked from commit 3b13b55ac1)
2019-10-17 18:34:51 +01:00
Lev Proleev
9613b4649b Revert "Copy VTS tests from v1.2 to v1.3"
This reverts commit d0e339e1da.

Reason for revert: the topic breaks git_qt-dev-plus-aosp

Change-Id: I68d31526cc7699b9a6c69a1ccc669fdb7605124e
2019-10-10 13:58:56 +00:00
Lev Proleev
64f9eb4bd5 Revert "Modify NNAPI VTS tests to run on version 1.3"
This reverts commit 543606fb92.

Reason for revert: the topic breaks git_qt-dev-plus-aosp

Change-Id: I74859bae687d65d344ed7edc617e1a7d086960a1
2019-10-10 13:54:38 +00:00
Lev Proleev
543606fb92 Modify NNAPI VTS tests to run on version 1.3
Bug: 139120468
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Id9e4d99852da8a3d5167ab7464c0e71885250501
Merged-In: Id9e4d99852da8a3d5167ab7464c0e71885250501
(cherry picked from commit b49dadfb64)
2019-10-09 14:18:49 +01:00
Lev Proleev
d0e339e1da Copy VTS tests from v1.2 to v1.3
So that it's easier to see what actually has changed in VTS tests for
version 1.3

Bug: 139120468
Test: m
Change-Id: Ief294d21349ca6531595612a16fa3ae3382f83ac
Merged-In: Ief294d21349ca6531595612a16fa3ae3382f83ac
(cherry picked from commit 3b13b55ac1)
2019-10-09 14:18:49 +01:00