Commit graph

67 commits

Author SHA1 Message Date
Treehugger Robot
2a3972288c Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I651a99927a137c7401750274b505e30e548e7858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:05:34 +00:00
David Gross
79324920f7 Make VtsHalNeuralnetworks* tests more binder-friendly.
Certain mutation testing -- mutateOperandLifeTimeTest and
mutateOperandInputOutputTest -- can introduce potentially very large
CONSTANT_COPY operands, which can in turn create potentially very
large Models which must be passed across binder.  To avoid overflowing
the binder buffer, we estimate the size of the mutated Model, and skip
the test if that size is too high.  The old logic recognizes that our
tests only have a single active binder transaction at a time, and
assumes that there are no other clients using the same service at the
same time, and so we should have the binder buffer to ourselves; to be
conservative, we reject any Model whose estimated size exceeds half
the binder buffer size.  Unfortunately, sometimes the binder buffer
still overflows, because it unexpectedly contains an allocation from
some other transaction: It appears that binder buffer memory
management is not serialized with respect to transactions from our
tests, and therefore depending on scheduler behavior, there may be a
sizeable allocation still in the buffer when we attempt to pass the
large Model.  To fix this problem we become even more conservative,
and instead of limiting the Model to half the binder buffer size, we
limit it to half IBinder.MAX_IPC_SIZE (the recommended transaction
size limit).  To confirm that this change does not exclude too many
tests, I checked how may times the size filter function
exceedsBinderSizeLimit is called, how many times it rejects a model
under the new logic (modelsExceedHalfMaxIPCSize), and how many times
it rejects a model under the old logic (modelsExceedHalfMaxIPCSize).

Test: VtsHalNeuralnetworksV1_0TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  3592, modelsExceedHalfMaxIPCSize = 212, modelsExceedHalfBufferSize = 18
Test: VtsHalNeuralnetworksV1_1TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  7228, modelsExceedHalfMaxIPCSize = 330, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 52072, modelsExceedHalfMaxIPCSize = 506, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_3TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 73342, modelsExceedHalfMaxIPCSize = 568, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksTargetTest

Bug: 227719657
Bug: 227719752
Bug: 231928847
Bug: 238777741
Bug: 242271308

Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
2022-08-25 23:11:41 +00:00
David Gross
96e9eeb19d Freeze neuralnetworks AIDL version as v2 for FL6
$ m android.hardware.neuralnetworks-update-api
$ m android.hardware.neuralnetworks-freeze-api

Cherrypicked from I35dbd32695acdffc552790dc7396bc8c724e9242

Bug: 206089870

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I35dbd32695acdffc552790dc7396bc8c724e9242
Merged-In: I35dbd32695acdffc552790dc7396bc8c724e9242
(cherry picked from commit 2a889d50b7)
2022-05-23 13:30:56 -07:00
Ian Hua
5dde02c7f6 Add FL6 spec tests to AIDL VTS.
Also skip FL6 (AIDL_V2) tests for older AIDL drivers.

Cherrypicked from I689fef0945428f6548977628e3c43628dd1e5bf7

Bug: 206089870
Test: VtsHalNeuralnetworksTargetTest
Specifically, for old driver such as AIDL_V1 sample driver, it can pass
HIDL tests and skip AIDL_V2 tests. For new driver such as AIDL_V2
sample driver, it can pass all tests.

Change-Id: I689fef0945428f6548977628e3c43628dd1e5bf7
(cherry picked from commit 23d4e5e298)
2022-05-23 13:06:30 -07:00
David Gross
a8cf3aefd8 Add PACK operation to NNAPI feature level 6.
Cherrypicked from Ic15d047b70c62437b4f0db6f2ca10127591ae07c

Bug: 206089870

Test: m -j NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest

Change-Id: Ic15d047b70c62437b4f0db6f2ca10127591ae07c
Merged-In: Ic15d047b70c62437b4f0db6f2ca10127591ae07c
(cherry picked from commit 0af4ac2ec4)
2022-05-23 13:06:04 -07:00
Ian Hua
b0cf0db3b0 AIDL interface changes for NNAPI feature level 6.
- Add BATCH_MATMUL operation
- Support TENSOR_INT32 for RESHAPE operation.

Also update "current" version snapshot and use
android.hardware.neuralnetworks-V2-ndk since AIDL v1 has been frozen.

Cherrypicked from Iabe45c57e2306d61055f711eda03b80b9cbe906d

Bug: 206089870
Test: mm
Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d
Merged-In: Iabe45c57e2306d61055f711eda03b80b9cbe906d
(cherry picked from commit aaeda0e84f)
2022-05-23 13:05:06 -07:00
David Gross
810aaa0a8d FL7: Refine MIRROR_PAD specification
Test: N/A

Bug: 202280925
Merged-In: If19d45d806f6ba33f9aa6c7af9bc411957cdc706
Change-Id: If19d45d806f6ba33f9aa6c7af9bc411957cdc706
(cherry picked from commit 4718025a6c)
2022-01-19 14:27:06 -08:00
David Gross
146b38685a FL7: Refine REVERSE specification
Test: N/A

Bug: 202280925

Merged-In: Iae1f177254023c750c701e6594a61f3958de538c
Change-Id: Iae1f177254023c750c701e6594a61f3958de538c
(cherry picked from commit 91a30c1cea)
2022-01-19 14:27:06 -08:00
David Gross
da4682aa6f FL7: Add some AIDL_V3 test infrastructure
Test: atest VtsHalNeuralnetworksTargetTest -- --test-arg com.android.tradefed.testtype.GTest:native-test-flag:"--gtest_filter=*abs*:*floor*:*log*:*rsqrt*:*sin*:*sqrt*"

Bug: 202280925
Merged-In: I848add0ddb94e1500a5d4d6af5d51ddf5ebba045
Change-Id: I848add0ddb94e1500a5d4d6af5d51ddf5ebba045
(cherry picked from commit 8e9fbfc592)
2022-01-19 14:27:05 -08:00
David Gross
061d3411c8 Freeze neuralnetworks AIDL version as v3 for FL7
$ m android.hardware.neuralnetworks-update-api
$ m android.hardware.neuralnetworks-freeze-api

(This cherry pick required hand editing to ensure makefile
references are changed from
android.hardware.neuralnetworks-V2-ndk_platform to
android.hardware.neuralnetworks-V3-ndk_platform.)

Bug: 202280925

Test: adb shell NeuralNetworksTest_static
Test: atest VtsHalNeuralnetworksTargetTest
Merged-In: I2b2755d7376bb847b15b395e280bf352b5b9ef55
Change-Id: I2b2755d7376bb847b15b395e280bf352b5b9ef55
(cherry picked from commit 68e4300c72)
2022-01-19 14:26:19 -08:00
David Gross
88ec0799db Add NNAPI specification and infrastructure for FL7.
Adds operations MIRROR_PAD and REVERSE.
Extends RSQRT to support QUANT8_ASYMM and QUANT8_ASYMM_SIGNED.

DOES NOT include tests or CPU reference implementation.

(This is a slightly non-trivial cherry pick that had to be
hand-edited to compensate for the fact that certain nn::Version
changes and makefile restructurings are absent from the target branch.)

Bug: 202280917

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest

Merged-In: I0b2133346b996849faac00c46885e3633c78f024
Change-Id: I0b2133346b996849faac00c46885e3633c78f024
(cherry picked from commit 04ed8595b5)
2022-01-19 14:20:48 -08:00
David Gross
2a889d50b7 Freeze neuralnetworks AIDL version as v2 for FL6
$ m android.hardware.neuralnetworks-update-api
$ m android.hardware.neuralnetworks-freeze-api

Cherrypicked from I35dbd32695acdffc552790dc7396bc8c724e9242

Bug: 206089870

Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I35dbd32695acdffc552790dc7396bc8c724e9242
Merged-In: I35dbd32695acdffc552790dc7396bc8c724e9242
2021-12-10 16:19:42 +00:00
Ian Hua
23d4e5e298 Add FL6 spec tests to AIDL VTS.
Also skip FL6 (AIDL_V2) tests for older AIDL drivers.

Cherrypicked from I689fef0945428f6548977628e3c43628dd1e5bf7

Bug: 206089870
Test: VtsHalNeuralnetworksTargetTest
Specifically, for old driver such as AIDL_V1 sample driver, it can pass
HIDL tests and skip AIDL_V2 tests. For new driver such as AIDL_V2
sample driver, it can pass all tests.

Change-Id: I689fef0945428f6548977628e3c43628dd1e5bf7
2021-12-10 16:19:19 +00:00
David Gross
0af4ac2ec4 Add PACK operation to NNAPI feature level 6.
Cherrypicked from Ic15d047b70c62437b4f0db6f2ca10127591ae07c

Bug: 206089870

Test: m -j NeuralNetworksTest_static
Test: VtsHalNeuralnetworksTargetTest

Change-Id: Ic15d047b70c62437b4f0db6f2ca10127591ae07c
2021-12-10 16:18:25 +00:00
Ian Hua
aaeda0e84f AIDL interface changes for NNAPI feature level 6.
- Add BATCH_MATMUL operation
- Support TENSOR_INT32 for RESHAPE operation.

Also update "current" version snapshot and use
android.hardware.neuralnetworks-V2-ndk since AIDL v1 has been frozen.

Cherrypicked from Iabe45c57e2306d61055f711eda03b80b9cbe906d

Bug: 206089870
Test: mm
Change-Id: Iabe45c57e2306d61055f711eda03b80b9cbe906d
Merged-In: Iabe45c57e2306d61055f711eda03b80b9cbe906d
2021-12-10 16:17:59 +00:00
Xusong Wang
dee204e13f Fix use-after-free crash in VtsHalNeuralnetworksTargetTest.
Prior to this CL, the AHardwareBuffer in TestBlobAHWB is released in the
destructor, but later used (unlock) during the destruction of the
mMapping member. This CL fixed this issue by managing the lifetime of
AHardwareBuffer with SharedMemory.

Bug: 197199690
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I00748aaaa1a3a3d9b3b62bedb77a655ddb6e210f
Merged-In: I00748aaaa1a3a3d9b3b62bedb77a655ddb6e210f
(cherry picked from commit d2ecde5c54)
2021-08-27 11:51:24 -07:00
Michael Butler
8472d91b57 Quickly exit VtsHalNeuralnetworks*TargetTest on failure
This change adds the AndroidTest.xml flag --gtest_break_on_failure to
cause the gtest to terminate after an error has been reached. This early
termination is important in the case where an NN HAL service crashes
mid-test, and all remaining tests would otherwise continue to run.

Bug: 197035200
Test: m vts -j
Test: vts-tradefed
Change-Id: I0b9a14345475e432b93f92c23010a8b39712443a
Merged-In: I0b9a14345475e432b93f92c23010a8b39712443a
(cherry picked from commit ac45a5d77e)
2021-08-25 18:07:20 +00:00
Michael Butler
77c1b62362 Quick-fail NNAPI VTS test case if driver is dead
This CL adds a check during SetUp that an NNAPI driver service is still
alive by pinging the driver service. If it is not alive, the test will
fail during SetUp. Without this quick-fail, the test case would continue
as if the driver were still active, which would result in multiple
EXPECT_* and ASSERT_* statements failing instead of a single, clear
failure message.

Bug: 197035200
Test: mma
Test: presubmit: VtsHalNeuralnetworks*TargetTest
Change-Id: Ib1b75ed20f764055699590581d5ad4e5aff4baae
Merged-In: Ib1b75ed20f764055699590581d5ad4e5aff4baae
(cherry picked from commit 9c3c8642fb)
2021-08-24 18:53:08 +00:00
Lev Proleev
3fd4ec4706 Fix ordering of cache files requirements from device
Data and model numbers were switched in the AIDL implementation of
canonical Device.

Bug: 190757709
Test: neuralnetworks_utils_hal_aidl_test
Change-Id: I0d95b2d436994ffc877a4e02eb31f449b983e61e
2021-06-28 12:16:02 +00:00
Przemyslaw Szczepaniak
62d0446772 Merge "Modify VTS to allow testing shim caching" into sc-dev 2021-06-04 13:20:53 +00:00
Slava Shklyaev
dff39c0081 Modify VTS to allow testing shim caching
Bug: 185777967
Bug: 182877255
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ibaba149715cfd5e655ce4916b75a29473170f013
Merged-In: Ibaba149715cfd5e655ce4916b75a29473170f013
(cherry picked from commit 2980a7c9fc)
2021-06-03 16:10:35 +00:00
Jiyong Park
a26f0629d3 Merge "Freeze AIDL APIs for SC" into sc-dev 2021-05-25 22:43:57 +00:00
Jiyong Park
72b6359859 Freeze AIDL APIs for SC
Ignore-AOSP-First: part of SC finalization

Bug: 188713899
Test: m
Change-Id: Iee18cd05954dc8ea08cc4f985499a70977d1af4f
2021-05-25 10:13:26 +09:00
Xusong Wang
dfc013adaa Test readonly request input in AIDL VTS.
This CL modifies the AIDL generated tests to use readonly memory pool
for request inputs.

Bug: 188104713
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I9e62f1cdeb501bf29bcb9c56317a452c9105b272
2021-05-21 15:49:54 -07:00
Xusong Wang
2082b871ab Fix a bug in reusable burst execution.
The reusable burst execution incorrectly holds a reference to memory
identifier tokens.

Bug: 188568523
Test: NNT_static and inspect logcat
Change-Id: Ic8fb8be12bf579a316e7df8480ab3ccdc5c0e635
2021-05-18 21:05:06 +00:00
Xusong Wang
8bfa243972 Use proper alignment and padding for pointer arguments -- HAL.
This CL modifies the shared memory allocation for pointer arguments to
use proper alignment and padding. We use default alignment (64) and
min padding (1) for HIDL drivers, and default alignment (64) and default
padding (64) for sAIDL drivers.

Bug: 184164929
Test: NNT_static
Change-Id: I22591640fa047d5f75d437edac1a7645d3b05526
2021-05-07 14:13:22 -07:00
Xusong Wang
e84db6beb3 Merge changes from topics "nnapi-reusable-execution-canonical-2", "nnapi-reusable-execution-canonical-burst" into sc-dev
* changes:
  Introduce reusable burst to canonical interface -- HAL.
  Introduce reusable execution to canonical interface -- HAL.
2021-05-07 00:49:45 +00:00
Xusong Wang
ead6d37ae9 Introduce reusable burst to canonical interface -- HAL.
This CL modifies the canonical interface for reusable burst executions:
- Add new method IBurst::createExecution

The reusable burst execution will not fallback to another execution path
if sending request packet fails. The behavior of single-time burst
execution remains unchanged.

Additionally, this CL enables pointer -> shared memory conversion in
1.2/1.3 burst implementation.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Change-Id: Iaac81668d247c2cb76d70e6abbd10f00b397b19f
2021-05-06 13:56:52 -07:00
Xusong Wang
727a7b2104 Introduce reusable execution to canonical interface -- HAL.
This CL modifies the canonical interface for reusable executions:
- Add new interface: IExecution with compute and computeFenced methods
- Add new method IPreparedModel::createExecution

In NNAPI runtime, the new interface IExecution is used to
memoize request-specific execution resources (e.g. converted HAL
request). The expected usage is that, IPreparedModel::createExecution
will be invoked in the first computation of a reusable NDK ANNExecution
object, and IExecution::compute* will be invoked repeatedly.

The IPreparedModel::execute* methods are preserved to avoid redundant
object creation and memoization overhead for a single-time
(non-reusable) execution.

For a vendor implementing the canonical interfaces, only the
IPreparedModel::execute* methods will be called because there is
currently no reusable execution at HAL interface. A DefaultExecution
implementation is provided to reduce the work needed on the vendor side.

Bug: 184073769
Test: NNT_static
Test: neuralnetworks_utils_hal_1_0_test
Test: neuralnetworks_utils_hal_1_1_test
Test: neuralnetworks_utils_hal_1_2_test
Test: neuralnetworks_utils_hal_1_3_test
Test: neuralnetworks_utils_hal_common_test
Test: neuralnetworks_utils_hal_aidl_test
Change-Id: I91790bb5ccf5ae648687fe603f88ffda2c9fd2b2
2021-05-06 13:56:32 -07:00
Jooyung Han
3a966323ef aidl: Set explicit default values for enum-type fields
Fixes: 179853674
Test: mma in hardware/interfaces/neuralnetworks
Change-Id: I9fdc7089eaf1202299da098220875ef8398667fe
2021-04-27 13:58:46 +09:00
Andy Dyer-Smith
889c46c11a Fix typo in PAD_V2 comments
Bug: 158315823
Test: m

Change-Id: Ic7ba213f2e0ff523349e4b80926a302399db8d88
2021-04-23 16:25:12 +00:00
Michael Butler
3e9720b83f Remove NN canonical IDevice::isUpdatable -- hal
This CL alters the AIDL utility "getDevices" to return whether or not a
service is updatable. This CL additional removes IDevice::isUpdatable
because it is now redundant with the changes to "getDevices".

Bug: 170696350
Test: mma
Test: NeuralNetworksTest_static
Change-Id: I86228763937c0dd2ee5b1d9d547c367cd7504ed4
2021-04-21 13:27:59 -07:00
Treehugger Robot
0292dbbec8 Merge "Add units to hal times and durations names" 2021-04-21 11:35:45 +00:00
Lev Proleev
8df7d6eaf9 Add units to hal times and durations names
The change adds "Ns" suffix to timeOnDevice, timeInDriver,
loopTimeoutDuration, deadline and duration.

Fix: 183118329
Test: mm
Change-Id: I4afe34f27fc8717ac28c8fa09edda9918641c39a
Merged-In: Id1f9ee4b8e41873c97690bb19a5e84572dd9ccf1
2021-04-20 18:16:11 +00:00
Lev Proleev
300b3245ae Add units to hal times and durations names
The change adds "Ns" suffix to timeOnDevice, timeInDriver,
loopTimeoutDuration, deadline and duration.

Fix: 183118329
Test: mm
Change-Id: Id1f9ee4b8e41873c97690bb19a5e84572dd9ccf1
2021-04-19 15:43:32 +00:00
Michael Butler
a546efe5ef Merge "Enable NN VTS and utility code to use lazy services" 2021-04-14 16:22:53 +00:00
Lev Proleev
e6273df6b8 Merge "Add explanations for FusedActivationFunc values" 2021-04-14 14:38:46 +00:00
Michael Butler
d3a6efc22e Enable NN VTS and utility code to use lazy services
This CL enables VtsHalNeuralnetworksTargetTest to use lazy services by
changing from AServiceManager_getService (which will return nullptr for
the service if the service is not able to be loaded within a short
amount of time) to AServiceManager_waitForService (which will wait for a
longer time, allowing lazy services to start up).

Similarly, the utility code is changed from using
AServiceManager_getService to AServiceManager_waitForService where
possible.

This CL also introduces an "InvalidDevice" utility class to the
nnapi/hal/aidl utility code. InvalidDevices are minimal devices that
support no functionality but are still able to pass VTS tests.

Bug: 170696939
Test: mma
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I4f806b104ef6af863ec55c2c3f2a2dd1f72b9633
2021-04-13 16:14:13 -07:00
Lev Proleev
60aa6c2b03 Add explanations for FusedActivationFunc values
Fix: 183117976
Test: m
Change-Id: I55f4b7e3287e5bfdde6c2a2f94cee757c020c2d0
2021-04-12 16:00:15 +01:00
Michael Butler
f03ebd93b9 Update NN utility code and VTS tests with new Memory type
This CL fixes the compiler errors that arose of changing the Memory
representation of the NN AIDL HAL, and updates the conversion and
utility code to work with the new Memory type.

This change also makes libaidlcommonsupport available to apex modules at
min sdk level 29.

Bug: 183118727
Test: mma
Test: VtsHalNeuralnetworksTargetTest
Change-Id: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
Merged-In: Ief565473b4d82e0bb43785fc3b8275b16bd26cf6
(cherry picked from commit b0fcb3927d)
2021-04-07 12:54:45 -07:00
Michael Butler
dd53d04d8c Improve the structure of NNAPI AIDL Memory
Prior to this change, the NN AIDL HAL created a Memory struct analogous
to hidl_memory, consisting of a name, size, and native handle. However,
this Memory struct is not very structured, and requires both the client
and server to agree on how the data should be interpreted.

This CL tightens the structure of the Memory representation by
introducing Ashmem and MappableFile structs to android.hardware.common
in order to hold specific file descriptors representing memory regions.
Further, this CL redefines android.hardwre.neuralnetworks's Memory
object as a union of the Ashmem, MappableFile, and (existing)
HardwareBuffer memory types.

This change also adds "com.android.neuralnetworks" to the graphics
AIDL HAL's apex_available build rule.

Bug: 183118727
Test: mma
Change-Id: I32322df676b83597c9e95f13662c322a6a80accc
Merged-In: I32322df676b83597c9e95f13662c322a6a80accc
(cherry picked from commit 1158c80ff6)
2021-04-07 12:54:18 -07:00
Michael Butler
382d513dff Change NNAPI time from steady_clock to boot_clock -- hal
Previously, the NNAPI used std::chrono::steady_clock to represent and
measure timings. However, steady_clock does not count while the system
is suspended. Instead, boot_clock is monotonic like steady_clock but
does include the time when the system is suspended.

This change also indicates that services may convert from
std::chrono::steady_clock::time_point to
android::base::boot_clock::time_point in the HIDL 1.3 NN HAL.

Bug: 183118340
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Test: VtsHalNeuralnetworksTargetTest
Test: presubmit
Change-Id: I5a7d039a31d9ce98602a301387ec99635f279f42
Merged-In: I5a7d039a31d9ce98602a301387ec99635f279f42
(cherry picked from commit b8cf54cf5a)
2021-04-06 15:00:49 -07:00
Michael Butler
7a9d6092cd Create NN AIDL Burst adapter
Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: I2947faeb3820faa963e4df1eaf7aefec57b66c79
Merged-In: I2947faeb3820faa963e4df1eaf7aefec57b66c79
(cherry picked from commit 504f44926c)
2021-04-02 22:03:12 -07:00
Michael Butler
8414a6ebf9 Add additional parameters for NN Burst -- HAL
Adds deadline and loopTimeoutDuration to nn::IBurst::execute.

This CL additionally adds a test case for
IPreparedModel::configureExecutionBurst and adds the suffix "_H" to
the header guards that were missing "_H".

Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
Merged-In: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
(cherry picked from commit bbbdb0d5f1)
2021-04-02 22:02:38 -07:00
Michael Butler
388bcebc8f Add missing validation for NN canonical types
Bug: 177669661
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
Merged-In: Ic05c177f61a906a69bf82ff9c4d5bb8b0556d5ca
(cherry picked from commit 08ee3f9287)
2021-04-02 22:02:02 -07:00
Xusong Wang
3633d07092 Rename BufferRole.frequency -> probability -- HAL.
"Frenquency" often refers to the number of occurrences over a period of
time, while "probability" refers to the number of occurrences of one
event over the number of occurrences of all events. "Probability" is a
better name for this field.

Fixes: 183117895
Test: VtsHalNeuralnetworksTargetTest
Test: NNT_static
Change-Id: Ic86f73b8be2aed567ae4ca17bdb3a57c658fb349
Merged-In: Ic86f73b8be2aed567ae4ca17bdb3a57c658fb349
(cherry picked from commit 46bf892f46)
2021-04-02 10:26:29 -07:00
Michael Butler
7fc7e3756d Add Burst tests to NN AIDL HAL VTS
Bug: 180492058
Bug: 177267324
Test: mma
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I1744005cbf750b70b42367b81a2fa6b8f24c1904
Merged-In: I1744005cbf750b70b42367b81a2fa6b8f24c1904
(cherry picked from commit 8b7e813868)
2021-03-20 14:20:58 +00:00
Michael Butler
88e6e9e66f Add IBurst to NN AIDL HAL -- hal
Burst executions are a sequence of executions of the same prepared model
that occur in rapid succession, such as frames of a camera capture or
successive audio samples. A burst object is used to control a set of
burst executions, and to preserve resources between executions, enabling
executions to have lower overhead.

This CL has the following changes:
1) Adds an IBurst interface to the NN AIDL HAL
2) Adds IPreparedModel::configureExecutionBurst to create an IBurst
   object
3) Extends VTS's InvalidPreparedModel to implement
   configureExecutionBurst.

Bug: 180492058
Bug: 177267324
Test: mma
Test: VTS+presubmit
Change-Id: I90cb18dcc392f07f342604a7fb2edae041848251
Merged-In: I90cb18dcc392f07f342604a7fb2edae041848251
(cherry picked from commit 5dc72d5485)
2021-03-20 14:20:30 +00:00
Michael Butler
37dcda8704 Format NN AIDL HAL
There were some comment changes made to tha auto-generated AIDL files.

Bug: N/A
Test: mma
Change-Id: I1a360115b82b0c222666c5d9189a220e74390654
Merged-In: I1a360115b82b0c222666c5d9189a220e74390654
(cherry picked from commit 402497e049)
2021-03-20 14:20:07 +00:00
Xusong Wang
dfefe265de Merge "Test padded request memories in VTS generated tests." 2021-03-19 17:22:50 +00:00