Commit graph

484 commits

Author SHA1 Message Date
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
Miao Wang
12ea0d4ed6 Support sync fence in NNAPI
- Add IPreparedModel::dispatchRequest to NNAPI 1.3 HAL
  - Add IDispatchExecutionCallback to allow clients query information
  related to the actual evaluation.

Bug: 142778241
Test: mm
Change-Id: I87cbb7f2aee87342b0418fce04eb4050e2bc1920
Merged-In: I87cbb7f2aee87342b0418fce04eb4050e2bc1920
(cherry picked from commit 90cf3dd37c)
2020-01-27 12:58:31 -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
Lev Proleev
503d850369 Add ELU and HARD_SWISH
Bug: 147482068
Bug: 147481241
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Iab8da2a666ad9775dfb53d9297e94962fb651353
Merged-In: Iab8da2a666ad9775dfb53d9297e94962fb651353
(cherry picked from commit aee67f83f9)
2020-01-27 12:57:58 -08:00
Lev Proleev
e4f1583337 NNAPI: Regenerate types.hal to sync with types.spec
Bug: 147765446
Test: mma
Change-Id: I2b41bd959b7084ecb89674c659c66ebb158ac77d
Merged-In: I2b41bd959b7084ecb89674c659c66ebb158ac77d
(cherry picked from commit 2d7c489f67)
2020-01-27 12:57:05 -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
Michael Butler
ed8e77bf12 Add Quality of Service to NNAPI HAL
This CL makes the following changes:
* introduces a new Priority enum
* extends ErrorStatus with new error codes
* adds "supportsDeadline" method to IDevice
* adds priority and deadline arguments to IDevice::prepareModel*
* adds deadline argument to IPreparedModel::execute*
* updates IExecutionCallback with new ErrorStatus
* updates current.txt accordingly

Bug: 136739795
Bug: 142902514
Bug: 145300530
Test: mma
Change-Id: Iaa7877bde1f463635b8bbdb4e8a001d7b79b9c65
Merged-In: Iaa7877bde1f463635b8bbdb4e8a001d7b79b9c65
(cherry picked from commit c2499ecda1)
2020-01-27 12:51:25 -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
Slava Shklyaev
351ca59582 Remove neuralnetworks@1.3::Model.Extension* in favor of 1.2 counterparts
The types are the same as in 1.2. No changes are expected.

Bug: 136735929
Test: m
Change-Id: I7431d2e9263fafa0e63b8b1b40f6715e3832d17c
Merged-In: I7431d2e9263fafa0e63b8b1b40f6715e3832d17c
(cherry picked from commit 8a179f3499)
2020-01-27 12:50:50 -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
Lev Proleev
e4c8f5fe23 Fix quantized LSTM doc
The CL changes explicit prefixes for types in types.spec to a macro, so
that the prefixes of tensor types are correct both in NDK and HAL docs.

Bug: 144841609
Test: mma
Change-Id: I6d904bd3a858f555beed9270f141f080f96e429a
Merged-In: I6d904bd3a858f555beed9270f141f080f96e429a
(cherry picked from commit da5079c5cd)
2020-01-13 09:56:06 +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
c9d7f1cdc4 NNAPI: Update docs for ops with signed quantization
types.hal files are generated from current types.spec.

Bug: 136735770
Test: mma
Change-Id: Ide24606f8b1d5e755a71d46f230409942d8df7e9
Merged-In: Ide24606f8b1d5e755a71d46f230409942d8df7e9
(cherry picked from commit eb7f175613)
2020-01-07 13:36:03 +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
Lev Proleev
5595da3741 Add TENSOR_QUANT8_ASYMM_SIGNED support for more ops
Updated:
  CONCATENATION
  REDUCE_MIN
  REDUCE_MAX
  STRIDED_SLICE
  RESHAPE
  SQUEEZE
  MEAN

Bug: 143934554
Bug: 143935314
Bug: 143934726
Bug: 143934771
Bug: 143934557
Bug: 143934306
Bug: 143935140
Test: quantization coupling tests in CTS and VTS
Change-Id: Ie73d070fd6f0a27185c1f26561710635b6e03b26
Merged-In: Ie73d070fd6f0a27185c1f26561710635b6e03b26
(cherry picked from commit 91134e7fb9)
2019-12-02 11:40:55 +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
cdb67453de Add TENSOR_QUANT8_ASYMM_SIGNED support for activations
Ops updated: RELU, RELU1, RELU6, TANH, LOGISTIC

Fix: 143933951
Fix: 143934720
Fix: 143933831
Fix: 143934770
Fix: 143934743
Test: quantization coupling tests in CTS and VTS
Change-Id: Id5e7a8c6b30463708bd93dbf6a3f30d05c2bcf40
Merged-In: Id5e7a8c6b30463708bd93dbf6a3f30d05c2bcf40
(cherry picked from commit 3466c78b04)
2019-11-27 14:55:49 +00:00
Lev Proleev
d1b3450b3d Add TENSOR_QUANT8_ASYMM_SIGNED support for pooling ops
* Update AVERAGE_POOL_2D and MAX_POOL_2D

Bug: 143934716
Bug: 143934303
Test: quantization coupling tests in CTS and VTS
Change-Id: I15f36d6f819c92f96a46c40f9cc1491627644278
Merged-In: I15f36d6f819c92f96a46c40f9cc1491627644278
(cherry picked from commit 3f17cc3daa)
2019-11-27 14:55:13 +00:00
Lev Proleev
53c79d179a Add TENSOR_QUANT8_ASYMM_SIGNED support to ADD, MUL and SUB.
Bug: 143934463
Bug: 143934627
Bug: 143935040
Test: NNTest_static and 1.3 VTS
Change-Id: I47ffc2c264390f3c6b98aa9567fb47f2c58333fe
Merged-In: I47ffc2c264390f3c6b98aa9567fb47f2c58333fe
(cherry picked from commit 122bc2c0cc)
2019-11-27 14:54:27 +00:00
Lev Proleev
3683c785f2 Add QUANT8_ASYMM_SIGNED support to SELECT op
Also fix repo hook complaining about comment formatting.

Bug: 143935354
Test: NNTest_static and VTS_1_3  with --gtest_filter="*QuantizationCouplingTest*select*"
Change-Id: I1b0d1e987ebccc6700dd172b4222f9996105513d
Merged-In: I1b0d1e987ebccc6700dd172b4222f9996105513d
(cherry picked from commit 04bf939c7a)
2019-11-21 12:06:36 +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
Dan Shi
07f4235b53 Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite
The test takes over 12 hours to run. Remove it from vts-core suite.

Bug: 144527956
Test: None
Change-Id: If37a7b04e6d7b044d1594dcb4df07432236a1cf3
2019-11-18 08:40:19 -08:00
Michael Butler
c9c0d5bef9 Change NNAPI VTS TEST_MAPPING to restrict testing on sample drivers
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: If06740718e7cfebbe92058779b19282913cd5fc7
2019-10-29 19:08:38 -07: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
3104464c7f Simplify NNAPI VTS TEST_MAPPING options
Bug: N/A
Test: cd $TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: I1eb0f25fe13c641cc661484021629ecd811ed984
2019-10-29 18:43:17 -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
e5376fea95 Add template for 1.3 types.hal and regenerate it
After this update, types.hal v1.3 no longer refers to API level 30.

Test: none needed
Bug: 140132458
Change-Id: If707dfbcade6be1a0885fc21f6ddf47f3c27b244
Merged-In: If707dfbcade6be1a0885fc21f6ddf47f3c27b244
(cherry picked from commit e98e6793be)
2019-10-28 13:03:00 +00: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
ce8c632a09 Create NNAPI HAL v1.3 and add TENSOR_QUANT8_ASYMM_SIGNED OperandType
Bug: 137828494
Bug: 139120468
Bug: 136735770
Test: mma
Change-Id: I28f74e4b364fec1d7431a96cf5687256b3106069
Merged-In: I28f74e4b364fec1d7431a96cf5687256b3106069
(cherry picked from commit 5a7b67ab8f)
2019-10-17 18:34:51 +01:00
Dan Shi
0e1efc568c Merge "Add VtsHalLightV2_0TargetTest and VtsHalNeuralnetworksV1_* to vts-core" 2019-10-14 15:35:48 +00:00
Dan Shi
4856370e54 Add VtsHalLightV2_0TargetTest and VtsHalNeuralnetworksV1_* to vts-core
Bug: None
Test: None
Change-Id: I3fbbba0dc283bec2de025f0b743d97ded5874bf9
2019-10-10 13:45:43 -07:00
Lev Proleev
839ca3c428 Revert "Create NNAPI HAL v1.3 and add TENSOR_QUANT8_ASYMM_SIGNED OperandType"
This reverts commit bd2b4e78ac.

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

Change-Id: Ic72dcbb7ac4ef8e6ed597eb778289b39475f03f8
2019-10-10 14:01:05 +00: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