platform_hardware_interfaces/neuralnetworks/1.3
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
..
utils Use proper alignment and padding for pointer arguments -- HAL. 2021-05-07 14:13:22 -07:00
vts Make VtsHalNeuralnetworks* tests more binder-friendly. 2022-08-25 23:11:41 +00:00
Android.bp [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces 2021-02-21 20:36:55 -08:00
IBuffer.hal Add Quality of Service to NNAPI HAL 2020-01-27 12:51:25 -08:00
IDevice.hal Change NNAPI time from steady_clock to boot_clock -- hal 2021-04-06 15:00:49 -07:00
IExecutionCallback.hal Relax NNAPI QoS deadline parameter 2020-02-26 10:36:09 +00:00
IFencedExecutionCallback.hal Relax NNAPI QoS deadline parameter 2020-02-26 10:36:09 +00:00
IPreparedModel.hal Change NNAPI time from steady_clock to boot_clock -- hal 2021-04-06 15:00:49 -07:00
IPreparedModelCallback.hal Relax NNAPI QoS deadline parameter 2020-02-26 10:36:09 +00:00
types.hal Fix typo in PAD_V2 comments 2021-04-23 16:25:12 +00:00
types.t Move NNAPI type information to types.spec 2021-03-17 13:32:50 +00:00