Commit graph

521 commits

Author SHA1 Message Date
Slava Shklyaev
af1c77d74f Exclude unused operands from removeOperandTest
Bug: 148208229
Test: TestGenerated/ValidationTest.Test/nnapi_sample*_while*_unused_output*
Change-Id: I39bebefd0e40d370882d614d4beb97ab36c9da8f
Merged-In: I39bebefd0e40d370882d614d4beb97ab36c9da8f
(cherry picked from commit baa4cf02f2)
2020-04-20 13:19:00 +01:00
Slava Shklyaev
17a0b4fcdc Merge changes I866fe138,I0096a2fc
* changes:
  Remove BLOB AHWB tests from 1.2 VTS.
  Update loopTimeoutDuration documentation in NNAPI
2020-04-16 12:45:32 +00:00
Miao Wang
6048fd9dd5 Update the specification for the following operations
- RANDOM_MULTINOMIAL
 - L2_NORMALIZATION

Bug: 136279892
Bug: 140177375
Test: mm
Change-Id: Iab38ef29ebf6d1f5c0a408436b3d564e45e537a0
Merged-In: Iab38ef29ebf6d1f5c0a408436b3d564e45e537a0
(cherry picked from commit 077c0339d4)
2020-04-14 19:29:51 +01:00
Lev Proleev
f0401fe0b0 Clarify supported ranks for new ops in R
Fix: 151108533
Test: mma
Change-Id: I85b66ab5940d09b2786ecb14bff5bc1c1dee894a
Merged-In: I85b66ab5940d09b2786ecb14bff5bc1c1dee894a
(cherry picked from commit f161cc74a1)
2020-04-14 19:29:43 +01:00
Xusong Wang
b79c31aba8 Remove BLOB AHWB tests from 1.2 VTS.
Bug: 153282844
Test: 1.2 VTS
Change-Id: I866fe1388a64a36372f90c60fef340d2fe4c8682
Merged-In: I866fe1388a64a36372f90c60fef340d2fe4c8682
(cherry picked from commit b642700c7f)
2020-04-14 16:30:01 +01:00
Slava Shklyaev
6cf5f3e2a6 Update loopTimeoutDuration documentation in NNAPI
Bug: 149686804
Test: m
Change-Id: I0096a2fc2e579d39a2d59a605a4217d53a381691
Merged-In: I0096a2fc2e579d39a2d59a605a4217d53a381691
(cherry picked from commit 6a222a3eec)
2020-04-14 16:29:57 +01:00
Dan Shi
ba894f81db Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 15:17:02 -07:00
Michael Butler
b1865b6593 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
Merged-In: I0699ed6703e48b6c4bc0e7a392b79c12770f04c9
(cherry picked from commit 678a10600c)
2020-03-27 11:44:10 +00:00
Miao Wang
702a91acf5 Fix the timing initialization error for failed executeFenced case
Fixes: 152075771
Test: mm
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: I5829397346354ee3fc4a58b0a418197a1eee47cc
Merged-In: I5829397346354ee3fc4a58b0a418197a1eee47cc
(cherry picked from commit ad7678c8cb)
2020-03-27 11:44:08 +00:00
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
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
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
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
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
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
Treehugger Robot
20a5d89241 Merge "Revert "Remove VtsHalNeuralnetworksV1_2TargetTest from vts-core suite"" 2020-02-11 18:48:38 +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
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
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
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