Commit graph

816 commits

Author SHA1 Message Date
Xusong Wang
75e63ad743 Add BLOB AHWB tests in VTS.
Bug: 149847930
Test: 1.3 VTS
Change-Id: I9c795dcb7696c843afd12551927463c5529a4b60
Merged-In: I9c795dcb7696c843afd12551927463c5529a4b60
(cherry picked from commit 41adc5bc11)
2020-03-27 11:44:06 +00:00
Xusong Wang
2844165bf3 Add fenced compute path to memory domain validation test.
Bug: 147777318
Test: 1.3 VTS
Change-Id: I0b731d10384ef2024241af1d908acf3ba760d73f
Merged-In: I0b731d10384ef2024241af1d908acf3ba760d73f
(cherry picked from commit 9c415917e0)
2020-03-27 11:44:04 +00:00
Xusong Wang
5b0c58d1fb Add memory domain VTS validation tests.
Bug: 147777318
Test: 1.3 VTS with sample driver
Change-Id: Ia2097345924726d8fb627845fd7438cc3eb35eb6
Merged-In: Ia2097345924726d8fb627845fd7438cc3eb35eb6
(cherry picked from commit fed2f5213f)
2020-03-27 11:44:00 +00:00
Miao Wang
077c0339d4 Update the specification for the following operations
- RANDOM_MULTINOMIAL
 - L2_NORMALIZATION

Bug: 136279892
Bug: 140177375
Test: mm
Change-Id: Iab38ef29ebf6d1f5c0a408436b3d564e45e537a0
2020-03-25 16:46:13 -07:00
Michael Butler
3c8593c0fe Merge "Remove extra tests from NNAPI VTS validation tests" into rvc-dev 2020-03-23 22:07:32 +00:00
Miao Wang
1be73e85a1 Merge "Fix the timing initialization error for failed executeFenced case" into rvc-dev 2020-03-23 20:47:22 +00:00
Miao Wang
ad7678c8cb Fix the timing initialization error for failed executeFenced case
Fixes: 152075771
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I5829397346354ee3fc4a58b0a418197a1eee47cc
2020-03-23 20:46:58 +00:00
Xusong Wang
e71fa3a11a Merge "Add BLOB AHWB tests in VTS." into rvc-dev 2020-03-21 06:38:36 +00:00
Xusong Wang
9c415917e0 Add fenced compute path to memory domain validation test.
Bug: 147777318
Test: 1.3 VTS
Change-Id: I0b731d10384ef2024241af1d908acf3ba760d73f
2020-03-20 14:49:54 -07:00
Xusong Wang
fed2f5213f Add memory domain VTS validation tests.
Bug: 147777318
Test: 1.3 VTS with sample driver
Change-Id: Ia2097345924726d8fb627845fd7438cc3eb35eb6
2020-03-20 13:56:40 -07:00
Xusong Wang
3e64ecc347 Exclude invalid test models from QuantizationCouplingTest.
Bug: 151674996
Test: 1.3 VTS
Change-Id: I381eb6d39926054279f1791bd71d28a963acc0b9
Merged-In: I381eb6d39926054279f1791bd71d28a963acc0b9
(cherry picked from commit 962fdb26ca)
2020-03-20 12:29:16 -07:00
Michael Butler
678a10600c Remove extra tests from NNAPI VTS validation tests
Do not run validation on "inputs_as_internal" and
"all_tensors_as_inputs" variants.

Bug: 138149072
Bug: 149840439
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: I0699ed6703e48b6c4bc0e7a392b79c12770f04c9
2020-03-19 18:37:23 -07:00
Xusong Wang
962fdb26ca Exclude invalid test models from QuantizationCouplingTest.
Bug: 151674996
Test: 1.3 VTS
Change-Id: I381eb6d39926054279f1791bd71d28a963acc0b9
2020-03-16 17:13:41 -07:00
Xusong Wang
f07a957ce2 Fix VTS of fenced execution with zero-sized output.
Fixes: 151441390
Test: 1.3 VTS
Change-Id: I100329e18c34c377d217af155c2abc8e67078778
Merged-In: I100329e18c34c377d217af155c2abc8e67078778
(cherry picked from commit 9fcccf8b85)
2020-03-16 11:08:06 +00:00
Michael Butler
68a6de7abe NNAPI VTS: Add validation for Priority
This CL also cleans up the validation framework code.

Bug: 67828197
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: I84661fb2b8204148788d10425ca0ac986158b15f
Merged-In: I84661fb2b8204148788d10425ca0ac986158b15f
(cherry picked from commit da1a692880)
2020-03-16 11:05:59 +00:00
Michael Butler
d09c0eef0b NNAPI VTS: decouple 1.2 tests from 1.3 types
Bug: 141718368
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: Ied7b95e146e4d2d95622642bfbb959cf134b5a7a
Merged-In: Ied7b95e146e4d2d95622642bfbb959cf134b5a7a
(cherry picked from commit 4876af1ba1)
2020-03-16 11:05:57 +00:00
Miao Wang
406890769a Add tests to make sure executeFenced validate unspecified output shapes
Bug: 148979873
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ib4960c71ca46ca034777cc7b02d7d2885a98691d
Merged-In: Ib4960c71ca46ca034777cc7b02d7d2885a98691d
(cherry picked from commit fa161c7a0a)
2020-03-16 11:01:09 +00:00
Miao Wang
2d74d7dfae Add more tests exercising IPreparedModel::executeFenced API
- executeFenced with device memory
  - executeFenced with depending sync fences

Bug: 148979873
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I772c5c85f75cee56e2af06470c2de5b810f8078d
Merged-In: I772c5c85f75cee56e2af06470c2de5b810f8078d
(cherry picked from commit 34dfa2f74c)
2020-03-16 11:01:08 +00:00
Xusong Wang
41adc5bc11 Add BLOB AHWB tests in VTS.
Bug: 149847930
Test: 1.3 VTS
Change-Id: I9c795dcb7696c843afd12551927463c5529a4b60
2020-03-13 20:04:38 -07:00
TreeHugger Robot
140597c6a0 Merge "Fix VTS of fenced execution with zero-sized output." into rvc-dev 2020-03-14 02:16:31 +00:00
Xusong Wang
5882d6d911 Fix VTS of fenced execution with zero-sized output.
Fixes: 151441390
Test: 1.3 VTS
Change-Id: I100329e18c34c377d217af155c2abc8e67078778
Merged-In: I100329e18c34c377d217af155c2abc8e67078778
(cherry picked from commit 9fcccf8b85)
2020-03-13 15:15:39 -07:00
Michael Butler
b715967a15 Merge "NNAPI VTS: Add validation for Priority" into rvc-dev 2020-03-13 22:13:12 +00:00
Michael Butler
f0d0616d7c Merge "NNAPI VTS: decouple 1.2 tests from 1.3 types" into rvc-dev 2020-03-13 20:04:25 +00:00
Michael Butler
4876af1ba1 NNAPI VTS: decouple 1.2 tests from 1.3 types
Bug: 141718368
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: Ied7b95e146e4d2d95622642bfbb959cf134b5a7a
2020-03-13 19:59:43 +00:00
Michael Butler
da1a692880 NNAPI VTS: Add validation for Priority
This CL also cleans up the validation framework code.

Bug: 67828197
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: I84661fb2b8204148788d10425ca0ac986158b15f
2020-03-12 11:29:08 -07:00
Lev Proleev
f161cc74a1 Clarify supported ranks for new ops in R
Fix: 151108533
Test: mma
Change-Id: I85b66ab5940d09b2786ecb14bff5bc1c1dee894a
2020-03-12 13:34:18 +00:00
Miao Wang
fa161c7a0a Add tests to make sure executeFenced validate unspecified output shapes
Bug: 148979873
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ib4960c71ca46ca034777cc7b02d7d2885a98691d
2020-03-04 14:56:46 -08:00
Miao Wang
34dfa2f74c Add more tests exercising IPreparedModel::executeFenced API
- executeFenced with device memory
  - executeFenced with depending sync fences

Bug: 148979873
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I772c5c85f75cee56e2af06470c2de5b810f8078d
2020-02-26 13:17:22 -08:00
Lev Proleev
e3080db4e8 Add align_corners and half_pixel_centers parameters to resize ops
Fix: 135147454
Test: NNTest_static
Change-Id: I4115120c8b6261c5518d561c043cda913d47dd45
Merged-In: I4115120c8b6261c5518d561c043cda913d47dd45
(cherry picked from commit 3ab17d6b02)
2020-02-26 10:36:15 +00:00
Michael Butler
5c40bcc475 Fix NNAPI QoS Deadline test
The Deadline test was directly loading into the field of a std::optional
instead of emplacing, which is undefined behavior. This has been
corrected to emplace.

Additionally, previously the deadline test always checked the tensor
results of the execution. This is changed to only check the results
when the driver reports that the execution completed successfully.

Finally, this CL merges similar switch case statements.

Bug: 149766387
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I1068fe70e74a12006dea3cdf4ae9da50004ad24b
Merged-In: I1068fe70e74a12006dea3cdf4ae9da50004ad24b
(cherry picked from commit c7327c57f9)
2020-02-26 10:36:13 +00:00
Michael Butler
ff7d6c5493 Relax NNAPI QoS deadline parameter
Prior to this CL, the NNAPI QoS deadline is a strict deadline: a task
with a deadline must either complete or abort by the deadline. To
avoid as much overhead as possible, it is requested for Android R to
have a relaxed deadline, where the task *may* be aborted after the
deadline has passed or when the task is estimated to take too long.

Because the deadline is now relaxed, the querying method
IDevice::supportsDeadlines can be removed.

Bug: 149766387
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ib9937b5bb95646c2fd82e1aa17f2b0b639e2c420
Merged-In: Ib9937b5bb95646c2fd82e1aa17f2b0b639e2c420
(cherry picked from commit 9b9a804fe4)
2020-02-26 10:36:09 +00:00
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
Lev Proleev
6be8f3ea67 Add parallel linking support for BIDIRECTIONAL_SEQUENCE_{LSTM|RNN}
Change-Id: I51396f82de8dd7282db85a26b0a1be84b236b8c1
Merged-In: I51396f82de8dd7282db85a26b0a1be84b236b8c1
Fix: 138653129
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
(cherry picked from commit 13c43c0059)
2020-02-26 10:35:43 +00:00
Lev Proleev
3ab17d6b02 Add align_corners and half_pixel_centers parameters to resize ops
Fix: 135147454
Test: NNTest_static
Change-Id: I4115120c8b6261c5518d561c043cda913d47dd45
2020-02-20 11:01:07 +00:00
Michael Butler
c7327c57f9 Fix NNAPI QoS Deadline test
The Deadline test was directly loading into the field of a std::optional
instead of emplacing, which is undefined behavior. This has been
corrected to emplace.

Additionally, previously the deadline test always checked the tensor
results of the execution. This is changed to only check the results
when the driver reports that the execution completed successfully.

Finally, this CL merges similar switch case statements.

Bug: 149766387
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I1068fe70e74a12006dea3cdf4ae9da50004ad24b
2020-02-19 18:33:16 +00:00
Michael Butler
9b9a804fe4 Relax NNAPI QoS deadline parameter
Prior to this CL, the NNAPI QoS deadline is a strict deadline: a task
with a deadline must either complete or abort by the deadline. To
avoid as much overhead as possible, it is requested for Android R to
have a relaxed deadline, where the task *may* be aborted after the
deadline has passed or when the task is estimated to take too long.

Because the deadline is now relaxed, the querying method
IDevice::supportsDeadlines can be removed.

Bug: 149766387
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ib9937b5bb95646c2fd82e1aa17f2b0b639e2c420
2020-02-19 10:07:56 -08: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
Slava Shklyaev
f283a54fcc Merge "Add NNAPI loop timeout VTS test" 2020-02-19 11:19:58 +00:00
Slava Shklyaev
cc873aee8f Add NNAPI loop timeout VTS test
Fix: 149554639
Bug: 145906499
Bug: 136735929
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I642772d3c00c12d72380598d9d86743706179d72
2020-02-19 11:10:13 +00:00
Lev Proleev
13c43c0059 Add parallel linking support for BIDIRECTIONAL_SEQUENCE_{LSTM|RNN}
Change-Id: I51396f82de8dd7282db85a26b0a1be84b236b8c1
Fix: 138653129
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
2020-02-18 21:00:44 +00:00
Slava Shklyaev
f034bf9c92 Add NNAPI loop timeout API
Bug: 145906499
Bug: 136735929
Test: NNT_static
Change-Id: Ie40c248b174964676985403f9f1a5127b408a00a
2020-02-18 13:37:37 +00:00
TreeHugger Robot
5efd0f7194 Merge "Add control flow support to NNAPI VTS tests" 2020-02-17 16:56:44 +00:00
TreeHugger Robot
372b792efe Merge "Add control flow performance to NNAPI Capabilities" 2020-02-15 09:54:45 +00:00
Michael Butler
c16a7603fc Merge "NNAPI VTS: use max time point instead of uint64_t max" 2020-02-14 00:26:58 +00:00
Michael Butler
79d6bb1ad2 NNAPI VTS: use max time point instead of uint64_t max
Bug: 149441015
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ic74f83242cbe04a4cec47adbfc51002fdf8bb47d
2020-02-12 19:06:13 -08: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
Slava Shklyaev
1f98e2e929 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
2020-02-12 14:29:27 +00:00
Slava Shklyaev
8a9b306571 Add control flow performance to NNAPI Capabilities
Bug: 139181916
Test: m
Change-Id: I62696a6519191e33568c9664c0047fb57426b99f
2020-02-12 14:29:27 +00:00
Lev Proleev
0b0d69e74f Merge "NNAPI: Add state outputs for {UNI|BI}DIRECTIONAL_SEQUENCE_{RNN|LSTM}" 2020-02-12 11:12:57 +00: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
Miao Wang
cc18d3fede Add a VTS test to validate NNAPI driver name string.
Bug: 134755158
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: Iead93f0a251fdbbf94df6dfdf27919d3f6fd71a8
Merged-In: Iead93f0a251fdbbf94df6dfdf27919d3f6fd71a8
(cherry picked from commit 2729d825cb)
2020-02-11 12:37:20 -08:00
Automerger Merge Worker
c231f0be30 Merge "Revert "Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite"" am: 20a5d89241 am: 3251b30fb2 am: 38d5f26305
Change-Id: I0db62643a33ad66d76da15455afc7a4e35efd895
2020-02-11 19:27:18 +00:00
Treehugger Robot
20a5d89241 Merge "Revert "Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite"" 2020-02-11 18:48:38 +00:00
Lev Proleev
188a8f90f0 NNAPI: Add state outputs for {UNI|BI}DIRECTIONAL_SEQUENCE_{RNN|LSTM}
Fix: 138443991
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I0a3af22826d438f6f38de1f64042a50f98265e2d
2020-02-11 11:05:48 +00:00
Dan Shi
6e48bde237 Revert "Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite"
This reverts commit 07f4235b53.

Reason for revert: b/144527956

Change-Id: I70c3e99689901556e279200751a90e77fb4fd840
2020-02-11 01:04:07 +00:00
Miao Wang
78743e19b2 Merge "Update VTS tests for executeFenced" 2020-02-10 21:51:45 +00:00
Michael Butler
aba3fc08f2 Merge "NN 1.3 HAL: ANAPIC review follow up" 2020-02-07 02:16:13 +00:00
Miao Wang
15a25f6ec1 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
2020-02-06 16:10:54 -08:00
Miao Wang
e3966e907f Merge "Add a VTS test to validate NNAPI driver name string." 2020-02-06 23:09:55 +00: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
Lev Proleev
124659e450 NNAPI: Add OptionalTimeoutDuration to 1.3/types.t
To sync 1.3/types.t with 1.3/types.hal

Test: generate_api.sh
Change-Id: I6a6e46ec82b4f25d77f7e1af18cc9d6f9478e5b7
Merged-In: I6a6e46ec82b4f25d77f7e1af18cc9d6f9478e5b7
(cherry picked from commit a9c097abec)
2020-02-06 11:38:06 +00:00
Miao Wang
2729d825cb Add a VTS test to validate NNAPI driver name string.
Bug: 134755158
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: Iead93f0a251fdbbf94df6dfdf27919d3f6fd71a8
2020-02-05 17:24:02 -08: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
David Gross
2ca858a491 Merge "redefine _Float16 as __fp16 for x86[_64] to allow removing workaround from inhouse clang" 2020-02-05 19:01:31 +00:00
Michael Butler
6a4172cd3d 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
2020-02-05 03:09:13 +00:00
Michael Butler
e8d82de36c Merge "NNAPI HAL: Remove priority from prepareModelFromCache_1_3" 2020-02-04 18:43:04 +00:00
Michael Butler
c90250ff57 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
2020-02-03 15:06:00 -08:00
David Gross
2452ee5a80 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
2020-02-03 11:55:38 -08:00
Lev Proleev
a9c097abec NNAPI: Add OptionalTimeoutDuration to 1.3/types.t
To sync 1.3/types.t with 1.3/types.hal

Test: generate_api.sh
Change-Id: I6a6e46ec82b4f25d77f7e1af18cc9d6f9478e5b7
2020-01-31 14:20:43 +00: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
3fd70b020e 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
2020-01-28 14:31:57 -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
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
Miao Wang
33173a3e68 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
2020-01-23 15:08:15 -08:00
Miao Wang
6604e51458 Merge changes from topic "nn_sync_fence"
* changes:
  Add VTS tests for NNAPI IPreparedModel::executeFenced
  Support sync fence in NNAPI
2020-01-23 08:01:42 +00:00
Miao Wang
2c4e02329b Add VTS tests for NNAPI IPreparedModel::executeFenced
- Validation tests
  - Generated tests to exercise executeFenced path

Bug: 142778241
Test: mm
Change-Id: I509f0b5713fc86885d597940aae5ade0502c97ad
2020-01-22 18:01:58 -08:00
Miao Wang
90cf3dd37c 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
2020-01-22 09:45:47 -08:00
Lev Proleev
8b3f240ea3 Add FILL and RANK ops
Bug: 148050168
Bug: 148049333
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Iebdfa600d84e31532807740c21d95cae41c76ad5
2020-01-22 17:16:43 +00:00
Lev Proleev
aee67f83f9 Add ELU and HARD_SWISH
Bug: 147482068
Bug: 147481241
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Iab8da2a666ad9775dfb53d9297e94962fb651353
2020-01-22 17:16:41 +00:00
Lev Proleev
2d7c489f67 NNAPI: Regenerate types.hal to sync with types.spec
Bug: 147765446
Test: mma
Change-Id: I2b41bd959b7084ecb89674c659c66ebb158ac77d
2020-01-22 17:16:07 +00:00
Michael Butler
616701d3cd Create VTS tests for QoS in NNAPI
Bug: 136739795
Bug: 142902514
Bug: 145300530
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: If3ab91cfb3158e4c33e809ff3b149dff47cda76f
2020-01-21 16:02:05 -08:00
Michael Butler
9449a28b2f Update NNAPI 1.3 VTS tests with new types
Bug: 136739795
Bug: 142902514
Bug: 145300530
Test: mma
Test: atest VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ie76da9dc9d6993a56bf644cfe20c5f5b421672c9
2020-01-21 16:02:05 -08:00
Michael Butler
c2499ecda1 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
2020-01-21 15:55:49 -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
Slava Shklyaev
a785a3faac Add NNAPI control flow
Bug: 136735929
Bug: 139181916
Test: m
Change-Id: I7a75175f00fc98df626c40ea669021ccd40130e0
2020-01-21 13:39:22 +00:00
Slava Shklyaev
8a179f3499 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
2020-01-21 11:39:02 +00:00
Xusong Wang
1f50e54cf8 Add memory domain VTS generated tests.
Bug: 141353602
Bug: 141363565
Test: 1.3 VTS
Change-Id: Ifc7eb3fd6f15e28ba403f02bdf66b4568bddcb64
2020-01-16 16:11:38 -08:00
Xusong Wang
931d5a18bc 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
2020-01-16 16:10:13 -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
Lev Proleev
da5079c5cd 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
2020-01-10 17:01:43 +00:00
TreeHugger Robot
fde81ba688 Merge "Enable QuantizationCouplingTest in NNAPI VTS" 2020-01-10 14:03: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
baac15d5fd Enable QuantizationCouplingTest in NNAPI VTS
Bug: 137828994
Test: NNTest_static and VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I9b4f20ab0287be9cae9fc1b69a8f64cc8f1996b0
2020-01-09 16:40:41 +00:00
Viet Dang
c8b0cd33b9 Add quantized LSTM op.
Bug: 144841609

Test: NeuralNetworksTest_static

Change-Id: I8aab51695382211e003d8fc442d33bae3006dc13
2020-01-09 15:20:15 +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
TreeHugger Robot
6744b76ef4 Merge "NNAPI: Update docs for ops with signed quantization" 2020-01-07 09:55:01 +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
eb7f175613 NNAPI: Update docs for ops with signed quantization
types.hal files are generated from current types.spec.

Bug: 136735770
Test: mma
Change-Id: Ide24606f8b1d5e755a71d46f230409942d8df7e9
2020-01-06 12:52:06 +00:00
Lev Proleev
16e8c9cc02 Add quant8 signed generated tests
Fixes ValidateModel test for AXIS_ALIGNED_BBOX_TRANSFORM.

Bug: 136735770
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ie2959ba7258d8106d5b3dd36970181519b75e3b3
2020-01-03 15:22:33 +00:00
Lev Proleev
6a1d5e405f 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
2020-01-02 18:34:03 +00:00
TreeHugger Robot
019b0c47e6 Merge "Add TENSOR_QUANT8_ASYMM_SIGNED support for DEQUANTIZE" 2019-12-12 12:15:05 +00:00
Xusong Wang
f4f2a0d6bf Merge "NN HAL: Upgrade IPreparedModel::executeSynchronously to 1.3." 2019-12-11 20:24:12 +00:00
Przemyslaw Szczepaniak
e9f0b92568 Add TENSOR_QUANT8_ASYMM_SIGNED support for ARG(MIN|MAX)
Test: CTS/VTS
Change-Id: I4a90642f4d8500237fd41de76687fbe4c021b652
2019-12-10 13:08:48 +00:00
Lev Proleev
af5fc2374d Fix use-after-free error in NNAPI VTS tests am: 56cda83f8c am: 0854f5f759
am: 5f688eb948

Change-Id: Ibea07442f2d230caef39f6a3f73e3acf40f5cf00
2019-12-09 12:08:38 -08: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
2bd0b3339c 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
2019-12-05 16:59:20 +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
91134e7fb9 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
2019-11-28 11:54:29 +00:00
Przemyslaw Szczepaniak
6d3cdc322b 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
2019-11-27 15:09:09 +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
3466c78b04 Add TENSOR_QUANT8_ASYMM_SIGNED support for activations
Ops updated: RELU, RELU1, RELU6, TANH, LOGISTIC

Change-Id: Id5e7a8c6b30463708bd93dbf6a3f30d05c2bcf40
Fix: 143933951
Fix: 143934720
Fix: 143933831
Fix: 143934770
Fix: 143934743
Test: quantization coupling tests in CTS and VTS
2019-11-21 17:35:30 +00:00
Lev Proleev
3f17cc3daa 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
2019-11-21 14:39:40 +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
Lev Proleev
122bc2c0cc 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
2019-11-20 11:15:02 +00:00
Lev Proleev
5c305e52ef Merge changes from topic "quant_coupling"
* changes:
  Add QUANT8_ASYMM_SIGNED support to SELECT op
  Add quantization coupling test
2019-11-20 10:56:14 +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
4c3a94d48d Merge "Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite" am: 86c7aabcc0 am: 572970bcc6
am: 2327f621e7

Change-Id: Ibf66f98dd9d5d82d620f8907629eb56dae65ca81
2019-11-18 13:05:14 -08:00
Xusong Wang
ebd88ba8d2 NN HAL: Upgrade IPreparedModel::executeSynchronously to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I4b74e8ac031c5d793cf7e5d66190734949367538
2019-11-18 11:20:37 -08:00
Lev Proleev
04bf939c7a 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
2019-11-18 17:20:55 +00:00
Lev Proleev
c88f4c60a8 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
2019-11-18 17:20:55 +00: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
Lev Proleev
66f598e10d Combine test parameters into TestConfig structure
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter="GeneratedTests*"
Change-Id: I928aaa42e4745b4a8e0e461046e9632b052d0135
2019-11-12 15:38:36 +00:00
Lev Proleev
8774f10b76 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
2019-11-11 18:11:50 +00:00
Xusong Wang
62a760c32d NN HAL: Upgrade IPreparedModel::execute to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I9ca1e28ddc97fe880a72885afe7afb6c93903697
2019-11-07 17:30:56 -08:00
Xusong Wang
68c3234ad3 NN HAL: Upgrade IPreparedModelCallback::notify to 1.3.
Bug: 143242728
Test: 1.3 VTS with sample driver
Change-Id: I56bc7a2fb179a9576036ad0c2aae0e1f41ec4e2c
2019-11-07 17:30:43 -08:00
Michael Butler
b2e17dd9cd Merge "Change NNAPI VTS TEST_MAPPING to restrict testing on sample drivers" am: 3d3c792bb8 am: fb196c4365
am: b64ab1daa4

Change-Id: Ie9ba34ca05702a7a254c6f07db5d975032e3ae86
2019-11-01 12:00:55 -07:00
Michael Butler
3076228e92 Merge "Add VtsHalNeuralnetworksV1_3TargetTest to TEST_MAPPING" am: 70798b6b10 am: ed9ade26de
am: 463118ec7d

Change-Id: Id0fc549c0c3de87c14f54f298c183d6a2c2e471f
2019-10-31 16:18:04 -07:00
Michael Butler
24f83d497b Merge "Simplify NNAPI VTS TEST_MAPPING options" am: 950dcb63cf am: cf57e42449
am: 2951b226a2

Change-Id: I98e6aafcac065e5040652acdf9865733b3898722
2019-10-30 11:26:33 -07: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
ecbc1ab590 Merge "Add VtsHalLightV2_0TargetTest and VtsHalNeuralnetworksV1_* to vts-core" am: 0e1efc568c am: 7626cc8cd5 am: 86395146bf
am: 9154805dce

Change-Id: Ic87df0df72d87be833bc408af5bc6a9139dcf7f4
2019-10-14 09:12:32 -07:00
Dan Shi
0e1efc568c Merge "Add VtsHalLightV2_0TargetTest and VtsHalNeuralnetworksV1_* to vts-core" 2019-10-14 15:35:48 +00:00
Michael Butler
50d76d6cfe Merge "NNAPI VTS update in response to utility function change" 2019-10-11 17:31:20 +00:00
Colin Cross
552c7a66ea Revert "Revert "Modify NNAPI VTS tests to run on version 1.3" am: 64f9eb4bd5 am: 7973d7dec5 am: 8bde98b027"
This reverts commit 496320b1ec.

Reason for revert: revert of a cherry-pick broke master

Change-Id: I4654dc75c17f8801103015dc1da91663dfa28d52
2019-10-10 23:13:36 +00:00
Colin Cross
b098d21e0c Revert "Revert "Copy VTS tests from v1.2 to v1.3" am: 9613b4649b am: 432f6d1609 am: fe2cd91115"
This reverts commit 1ea542bd1a.

Reason for revert: revert of a cherry-pick broke master

Change-Id: I09797f5f3898501a008186a22dd411b00e9e2c67
2019-10-10 23:13:02 +00:00
Lev Proleev
1ea542bd1a Revert "Copy VTS tests from v1.2 to v1.3" am: 9613b4649b am: 432f6d1609 am: fe2cd91115
am: 42fb310936

Change-Id: Icf12606c6d9d8efae82e35de09581fcdfa24f6f6
2019-10-10 14:54:49 -07:00
Lev Proleev
496320b1ec Revert "Modify NNAPI VTS tests to run on version 1.3" am: 64f9eb4bd5 am: 7973d7dec5 am: 8bde98b027
am: edadec3f9e

Change-Id: Idb6d7245c58afd0aba52db67cb1a540604ed8e33
2019-10-10 14:54:42 -07: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
Michael Butler
5756887a7b 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
2019-10-09 11:15:08 -07:00
Lev Proleev
e98e6793be 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
2019-10-09 16:32:11 +01: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
Lev Proleev
bd2b4e78ac Create NNAPI HAL v1.3 and add TENSOR_QUANT8_ASYMM_SIGNED OperandType
Bug: 137828494
Bug: 139120468
Bug: 136735770
Test: mma
Change-Id: I1f615047d1c0c208a90082ffb6ffc43f252f77b4
Merged-In: I1f615047d1c0c208a90082ffb6ffc43f252f77b4
(cherry picked from commit 5a7b67ab8f)
2019-10-09 14:18:49 +01:00
David Gross
8c0a48bceb Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal
There are certain pieces of NeuralNetworks.h and of our various *.hal
files that ought to be kept in sync -- most notably the operand type
and operation type definitions and descriptions in our
NeuralNetworks.h and types.hal files.  To avoid having to do this
manually, a tool can be employed.

The old solution to this problem is sync_enums_to_hal.py, which parses
the existing NeuralNetworks.h and types.hal files, and then rewrites
the types.hal files: It identifies the operand type and operation type
portions of the files, and in the types.hal files replaces them with
transformed versions of the portions from NeuralNetworks.h.  This
approach is brittle -- it is very sensitive to the structure of the
files, as was recognized when this tool was created.  Changes to those
files since the script was last updated essentially broke the script,
as noted in http://b/140132458.

The new solution employs a new tool generate_api.py to combine a
single "specification file" with one "template file" per API file
(NeuralNetworks.h or types.hal) to produce that API file.  The script
generate_api.sh invokes generate_api.py once per API file, passing
appropriate arguments.  See frameworks/ml/nn/tools/api/README.md for
more details.

In the process of combining information from NeuralNetworks.h and
*/types.hal, some formatting, syntactic, and semantic changes have
been made to those files.  For example:
- types.hal files no longer refer to API levels or (similarly)
  to HAL versions other than earlier HAL versions

Bug: 130169064
Bug: 140132458

Test: cd neuralnetworks ; mma

Change-Id: Iceb38effc2c7e6c32344e49225b85256144c0945
Merged-In: Iceb38effc2c7e6c32344e49225b85256144c0945
(cherry picked from commit 2cae5c8b01)
2019-10-09 14:18:06 +01:00
Lev Proleev
b58075603a Merge changes from topic "NNAPI v1.3"
* changes:
  Modify NNAPI VTS tests to run on version 1.3
  Copy VTS tests from v1.2 to v1.3
  Create NNAPI HAL v1.3 and add TENSOR_QUANT8_ASYMM_SIGNED OperandType
2019-10-04 15:34:10 +00:00
David Gross
2cae5c8b01 Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal
There are certain pieces of NeuralNetworks.h and of our various *.hal
files that ought to be kept in sync -- most notably the operand type
and operation type definitions and descriptions in our
NeuralNetworks.h and types.hal files.  To avoid having to do this
manually, a tool can be employed.

The old solution to this problem is sync_enums_to_hal.py, which parses
the existing NeuralNetworks.h and types.hal files, and then rewrites
the types.hal files: It identifies the operand type and operation type
portions of the files, and in the types.hal files replaces them with
transformed versions of the portions from NeuralNetworks.h.  This
approach is brittle -- it is very sensitive to the structure of the
files, as was recognized when this tool was created.  Changes to those
files since the script was last updated essentially broke the script,
as noted in http://b/140132458.

The new solution employs a new tool generate_api.py to combine a
single "specification file" with one "template file" per API file
(NeuralNetworks.h or types.hal) to produce that API file.  The script
generate_api.sh invokes generate_api.py once per API file, passing
appropriate arguments.  See frameworks/ml/nn/tools/api/README.md for
more details.

In the process of combining information from NeuralNetworks.h and
*/types.hal, some formatting, syntactic, and semantic changes have
been made to those files.  For example:
- types.hal files no longer refer to API levels or (similarly)
  to HAL versions other than earlier HAL versions

Bug: 130169064
Bug: 140132458

Test: cd neuralnetworks ; mma

Change-Id: Iceb38effc2c7e6c32344e49225b85256144c0945
2019-10-03 14:14:20 -07:00
Lev Proleev
b49dadfb64 Modify NNAPI VTS tests to run on version 1.3
Bug: 139120468
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Id9e4d99852da8a3d5167ab7464c0e71885250501
2019-10-02 13:45:02 +01:00
Lev Proleev
3b13b55ac1 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
2019-10-02 13:45:02 +01:00
Lev Proleev
5a7b67ab8f Create NNAPI HAL v1.3 and add TENSOR_QUANT8_ASYMM_SIGNED OperandType
Bug: 137828494
Bug: 139120468
Bug: 136735770
Test: mma
Change-Id: I1f615047d1c0c208a90082ffb6ffc43f252f77b4
2019-10-02 13:44:52 +01:00
Michael Butler
0763328464 Change NNAPI VTS to use TEST_P to iterate across all service instances
This CL removes a dependency on the VTS test runner by dynamically
discovering all NN HAL service instances in the gtest binary itself,
and runs through all service instances with parameterized tests.

This CL converts TEST_F cases to TEST_P cases, where the test parameter
is the name of the service instance. For existing TEST_P cases (such as
the generated test cases), the service instance name is made to be the
first test parameter.

This CL enables the NN VTS tests to be more portable, e.g., they can
run directly as a presubmit test.

Fixes: 124540002
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest (with sample-all)
Test: cd $ANDROID_BUILD_TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: I1e301d7c9f9342bb8f35a267bef180f510944b19
Merged-In: I1e301d7c9f9342bb8f35a267bef180f510944b19
(cherry picked from commit 7076f629b7)
2019-09-20 11:20:48 -07:00
Michael Butler
b3c8032b12 Specify NNAPI Burst FMQ read/write requirements
This CL additionally adds missing documentation for timing
information when returning results on the resultChannel.

Bug: 133773876
Test: mma
Change-Id: I1eb1affbb4a912d5fdeab012e2be7e7005deb04d
Merged-In: I1eb1affbb4a912d5fdeab012e2be7e7005deb04d
(cherry picked from commit f99bffd08a)
2019-09-19 13:31:01 -07:00
Michael Butler
7b19ebb5c8 Merge "Change NNAPI VTS to use TEST_P to iterate across all service instances" 2019-09-19 17:46:56 +00:00
Michael Butler
7076f629b7 Change NNAPI VTS to use TEST_P to iterate across all service instances
This CL removes a dependency on the VTS test runner by dynamically
discovering all NN HAL service instances in the gtest binary itself,
and runs through all service instances with parameterized tests.

This CL converts TEST_F cases to TEST_P cases, where the test parameter
is the name of the service instance. For existing TEST_P cases (such as
the generated test cases), the service instance name is made to be the
first test parameter.

This CL enables the NN VTS tests to be more portable, e.g., they can
run directly as a presubmit test.

Fixes: 124540002
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest (with sample-all)
Test: cd $ANDROID_BUILD_TOP/hardware/interfaces/neuralnetworks && atest
Change-Id: I1e301d7c9f9342bb8f35a267bef180f510944b19
2019-09-16 16:34:20 -07:00
Michael Butler
f99bffd08a Specify NNAPI Burst FMQ read/write requirements
This CL additionally adds missing documentation for timing
information when returning results on the resultChannel.

Bug: 133773876
Test: mma
Change-Id: I1eb1affbb4a912d5fdeab012e2be7e7005deb04d
2019-09-12 15:58:16 -07:00
David Gross
29d90d1455 "successful preparation means successful execution" guarantee neglects bad operation inputs
Under certain circumstances, we guarantee that a prepared model can be
executed successfully.  In describing those circumstances, we
neglected to specify that operation input operands must have legal
values for the guarantee to hold.  For example, the guarantee doesn't
hold if an ADD operation has an activation input that is not one of
the defined values; or if a RESHAPE operation has a shape input in
which two or more components are -1.

This change modifies the guarantee to apply only when operation input
operands have legal values.  It also documents this guarantee for
burst execution.

Note that if an operation has an input operand that can be proven to
have an illegal value at preparation time (e.g., a constant value that
is illegal), model preparation might (but is not required to) fail for
that reason.

Bug: 135933040

Test: $ cd neuralnetworks ; mma
Change-Id: I8b421550dd89e4bbbdae899e7cb5e9e88a46d2fb
(cherry picked from commit 48544cc38a)
2019-09-12 14:27:35 -07:00
Michael Butler
13b0516e56 Consolidate NNAPI VTS utility code
This CL does additional NNAPI VTS test cleanup, including consolidating
duplicate functionality. Specifically, this CL:
* consolidates the createPreparedModel function, removing the duplicate
* consolidates the std::out ErrorStatus and DeviceStatus code into Utils
* changes non-null constant pointers to constant references
* removes redudant leading namespace specifiers (V1_0::, ::testing, etc.)
* makes the Valdiation tests free functions
* renames device to kDevice and mTestModel to kTestModel

Bug: N/A
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest (with sample-all)
Change-Id: Ic401bb1f1760cc10384ac0d30c0c93409b63a9c7
Merged-In: Ic401bb1f1760cc10384ac0d30c0c93409b63a9c7
(cherry picked from commit e16af0a44b)
2019-09-11 11:04:54 -07:00
David Gross
48544cc38a "successful preparation means successful execution" guarantee neglects bad operation inputs
Under certain circumstances, we guarantee that a prepared model can be
executed successfully.  In describing those circumstances, we
neglected to specify that operation input operands must have legal
values for the guarantee to hold.  For example, the guarantee doesn't
hold if an ADD operation has an activation input that is not one of
the defined values; or if a RESHAPE operation has a shape input in
which two or more components are -1.

This change modifies the guarantee to apply only when operation input
operands have legal values.  It also documents this guarantee for
burst execution.

Note that if an operation has an input operand that can be proven to
have an illegal value at preparation time (e.g., a constant value that
is illegal), model preparation might (but is not required to) fail for
that reason.

Bug: 135933040

Test: $ cd neuralnetworks ; mma
Change-Id: I8b421550dd89e4bbbdae899e7cb5e9e88a46d2fb
2019-09-09 14:35:49 -07:00
Michael Butler
e16af0a44b Consolidate NNAPI VTS utility code
This CL does additional NNAPI VTS test cleanup, including consolidating
duplicate functionality. Specifically, this CL:
* consolidates the createPreparedModel function, removing the duplicate
* consolidates the std::out ErrorStatus and DeviceStatus code into Utils
* changes non-null constant pointers to constant references
* removes redudant leading namespace specifiers (V1_0::, ::testing, etc.)
* makes the Valdiation tests free functions
* renames device to kDevice and mTestModel to kTestModel

Bug: N/A
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest (with sample-all)
Change-Id: Ic401bb1f1760cc10384ac0d30c0c93409b63a9c7
2019-08-30 14:01:38 -07:00
Michael Butler
f952adda07 Cleanup NNAPI VTS tests
am: 62749b917e

Change-Id: Ia71e9765a810b2f07c4dbec5e101e357c64ba91d
2019-08-30 11:17:32 -07:00
Michael Butler
62749b917e Cleanup NNAPI VTS tests
This CL includes the following cleanups:
* namespace compression
* remove "using" from header files
* remove no-op code, default no-op constructors
* clang-formats the code

Bug: N/A
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: I023997d8686ca65223858eed3a0881f5444ed2d6
Merged-In: I023997d8686ca65223858eed3a0881f5444ed2d6
(cherry picked from commit bbe5dad266)
2019-08-29 12:55:56 -07:00
David Gross
c9981f9592 Merge "Fix V1_2::IDevice::getType documentation: was @param instead of @return"
am: 15b826ad6a

Change-Id: I81b920f6c0edb6f1709af8d8b609e21d64e5755e
2019-08-29 11:14:21 -07:00
Michael Butler
8bc15b59ae Merge "Cleanup NNAPI VTS tests" 2019-08-29 18:04:01 +00:00
David Gross
15b826ad6a Merge "Fix V1_2::IDevice::getType documentation: was @param instead of @return" 2019-08-29 17:44:04 +00:00
Michael Butler
bbe5dad266 Cleanup NNAPI VTS tests
This CL includes the following cleanups:
* namespace compression
* remove "using" from header files
* remove no-op code, default no-op constructors
* clang-formats the code

Bug: N/A
Test: mma
Test: VtsHalNeuralnetworksV1_*TargetTest
Change-Id: I023997d8686ca65223858eed3a0881f5444ed2d6
2019-08-28 17:29:40 -07:00
Michael Butler
52da1b820c NNAPI Combine Compatability test with VTS test
am: 3247f76e35

Change-Id: If447a9db2d0a9d5906396eb5f927a0df13f868ae
2019-08-28 14:12:36 -07:00