summaryrefslogtreecommitdiff
path: root/nn
AgeCommit message (Collapse)Author
2020-05-07Fix null ptr dereference in REDUCE_* cpu implementationLev Proleev
When asked to reduce across all dimensions, reduce would produce a zero-sized tensor without dimensions and cause segmentation fault in the implementation. The change fixes the bug by making the op output a tensor of size [1] in this case. Also, updated the bug to clarify this behaviour. Bug: 155508675 Test: NNTest_static Change-Id: Ie98d8fa2e508255fd50f6bd8184dc323ba90fac8
2020-05-07Add AndroidTest.xml for NeuralNetworksTest_static and blacklist failing testsMiao Wang
Test: mm Test: atest NeuralNetworksTest_static Fixes: 155942515 Fixes: 155942747 Fixes: 155942575 Fixes: 155942378 Fixes: 155942301 Fixes: 155942510 Fixes: 155942697 Fixes: 155942566 Change-Id: I940dda440c958fcef527d532d57b01586e070fb7
2020-05-07Merge "Fix caching bug in quantization coupling test" into rvc-devLev Proleev
2020-05-07Merge "Skip FailingDriverTest when fallback is disabled" into rvc-devSlava Shklyaev
2020-05-07Merge "Improve shape validation in FULLY_CONNECTED" into rvc-devSlava Shklyaev
2020-05-07Skip FailingDriverTest when fallback is disabledSlava Shklyaev
The test does not make sense when partitioning or CPU fallback is disabled. Bug: 155849908 Test: adb shell setprop debug.nn.partition 0 && \ NNT_static --gtest_filter=FailingDriverTest.FailAfterInterpretedWhile Test: adb shell setprop debug.nn.partition 2 && \ NNT_static --gtest_filter=FailingDriverTest.FailAfterInterpretedWhile Change-Id: Ie81eef414de3f767f4dfcf282d39ba63e366057f
2020-05-06Improve shape validation in FULLY_CONNECTEDSlava Shklyaev
1. Adds bias dimension count validation. 2. Does more validation in validate(). Bug: 155575142 Bug: 155261461 Test: NNT_static --gtest_filter="*while_fib*" Test: NNT_static --gtest_filter=ValidationTestDimensionProductOverflow2.DynamicOutputShapeOverflow Change-Id: I7b70a29e76fdf99e656ee6e3867cfd97675cfeec
2020-05-05Fix caching bug in quantization coupling testLev Proleev
Execute function in our tests among other things makes sure that the models work with caching enabled. Caching token and directory are constant and therefore the same for all tests. This is usually not a problem since the tests check only one model with a set of different configs but this was not the case for QuantizationCouplingTest suite. This suite ran signed and unsigned models in one test making them share the same caching token and directory which is an incorrect use of caching API. This CL solves this problem by removing the execution of an unsigned model from the test. This is safe since the unsigned model is still verified in GeneratedTests suite. Bug: 155604227 Test: NNTest_static Change-Id: I6aa2c8cd3fa41e37a5de53259d1fcc784f327093
2020-05-01Merge "Add more NN priority validation tests" into rvc-devMichael Butler
2020-05-01Merge "Dump RGG spec under all failures." into rvc-devXusong Wang
2020-05-01Merge "Fix null ptr dereference in squeeze cpu implementation." into rvc-devPrzemyslaw Szczepaniak
2020-04-30Add more NN priority validation testsMichael Butler
Bug: 147925145 Test: mma Test: NeuralNetworksTest_static Change-Id: Ie636c7cdc84ff7a262925f8ff8ebbd4d4f45201b
2020-05-01Merge "Add internal NNT_static tests for buffer copying." into rvc-devXusong Wang
2020-05-01Merge changes I3e1eb543,I012eb4df into rvc-devMichael Butler
* changes: Create tests for VersionedInterfaces errors Simplify IDevice reboot logic
2020-04-30Add internal NNT_static tests for buffer copying.Xusong Wang
This helps cover the code path of data copying between hidl memory and IBuffer, as well as data copying between IBuffers. These code paths may not be covered by CTS because of the lack of driver support. This CL additionally extracts TestAshmem class from TestGenerated to a common TestUtils. Bug: 152209365 Test: NNT_static Change-Id: I617bfbc391c7d0ada0c32b31ee2e6e493d5dc6a2
2020-05-01Merge "libneuralnetworks_headers is marked as available to platform" into ↵Jiyong Park
rvc-dev
2020-05-01libneuralnetworks_headers is marked as available to platformJiyong Park
The header lib is depended on by libneuralnetworks_common which is available to platform. With b/153073816, we will be checking the availability to the platform as well, i.e. platform-available module depending on platform-unavailable module will cause a build error. Prepare for the change by correctly marking that the header lib is also available to the platform. Bug: 153073816 Test: m Exempt-From-Owner-Approval: cherry-pick from AOSP Merged-In: I31a198068c98e7d6b01b7e2cd6f43e54769f28b1 (cherry picked from commit ddda33ec48ac01e042854c0a017a4ce276172488) Change-Id: I31a198068c98e7d6b01b7e2cd6f43e54769f28b1
2020-04-30Dump RGG spec under all failures.Xusong Wang
Fixes: 155195637 Test: NNT_static_fuzzing and inspect the dumped spec Change-Id: I11b50433b17afeceedae954f2832c1c2193b2c7f
2020-04-30Merge "Fix NNAPI TimingTests" into rvc-devMichael Butler
2020-04-30Merge changes I3e037df0,Ifd1f45a2 into rvc-devXusong Wang
* changes: Regenerate tests. Re-enable tests that are previously disabled.
2020-04-30Fix null ptr dereference in squeeze cpu implementation.Przemysław Szczepaniak
Squeeze, when used on a single-value tensor with 1s in each dimension, will result in zero-sized tensor without dimensions. This change fixes it, by making its output a tensor of size [1]. Bug: 155238914 Test: squeeze_b155238914.mod.py run on coral. Change-Id: Ia5bf655c647084d9fa094ae8a2048917a8237b81
2020-04-29Fix NNAPI TimingTestsMichael Butler
This CL fixes the ordering of sequences in the test. Specifically: 1) Causes the spin-loop in waitForExecutionToBegin to spin while the execution has not yet started 2) Adds dummyExecution() to the driver implementations of FAIL_LAUNCH 3) Skips getDurationWhileRunning for all DriverKind::CPU test cases Further, this CL adds dummyExecution() to TestPreparedModelLatest::executeFenced to ensure the call to executeFenced will not complete until after the test has called getDuration. This brings executeFenced in line with the other execution methods which call dummyExecution(). Finally, this CL has the following two minor changes: 1) code that was previously running from a detached thread in executeFenced now instead runs synchronously 2) a for-loop that iterated by constant reference now instead iterates by constant value Fixes: 155215099 Test: mma Test: NeuralNetworksTest_static --gtest_filter=Fenced/TimingTest* Change-Id: I69a7448367ce8353791c9462d144122b6c913802
2020-04-29Merge "Fix validateRequest with unknown rank in model." into rvc-devXusong Wang
2020-04-29Regenerate tests.Xusong Wang
Bug: 140641425 Test: NNT_static Change-Id: I3e037df067125b04efbd73f6d84da228d5e24f7a
2020-04-29Re-enable tests that are previously disabled.Xusong Wang
Bug: 140641425 Bug: 151328024 Bug: 152446228 Bug: 152445711 Bug: 152446298 Fixes: 152446228 Test: NNT_static Test: NNT_static_fuzzing Change-Id: Ifd1f45a2b058fe9996dca817a067ce2ad6d47b46
2020-04-29Fix validateRequest with unknown rank in model.Xusong Wang
This CL also re-enables TestUnspecifiedDimensions, which will trigger the bug in validateRequest when sample driver is deployed. Bug: 141294076 Fixes: 155228680 Test: NNT_static with sample driver Change-Id: I268eb67bda8933be180bd58b604ee76b72577697
2020-04-29Merge "Add STRIDED_SLICE validations on neg stride with shrinkMask." into ↵Xusong Wang
rvc-dev
2020-04-28Add STRIDED_SLICE validations on neg stride with shrinkMask.Xusong Wang
Fixes: 154639297 Test: NNT_static Test: NNT_static_fuzzing Change-Id: I2b37dd7fe07f3239682b5bc7f7cef0ae76134ad0
2020-04-28Skip TestRemoveDefaultArguments tests for useCpuOnly = 1Miao Wang
- The tests require mTestDevice being valid to perform the tests, while useCpuOnly will only allow CPU fallback path. Fixes: 155229031 Test: mm Test: NeuralNetworksTest_static Change-Id: Ic866d14de39d0c8f52648ad319bac14bc8fdd666
2020-04-28Merge changes I3178c22e,I9715e0a5 into rvc-devLev Proleev
* changes: Remove unused utility functions Add tests for multiplier quantization functions
2020-04-27Create tests for VersionedInterfaces errorsMichael Butler
This CL introduces the following kinds of tests: * device creation and initialization errors * "normal" functional positive and negative tests * HIDL transport error tests * mock service crash tests Fixes: 139189546 Bug: 129572750 Test: mma Test: atest NeuralNetworksTest_static Change-Id: I3e1eb5433732695572044a74f1529ffc9c3a1982
2020-04-24Fix "#define VERBOSE" bit-rot (build failure)David Gross
Test: Build NeuralNetworksTest_static both normally and with #define VERBOSE uncommented in TestPartitioningRandom.cpp Bug: 136735929 Change-Id: I79e33239b63885b050d77b5a819b7be82a80528e
2020-04-24Simplify IDevice reboot logicMichael Butler
HIDL allows a service to be retrieved with two functions: * <Interface>::getService — blocks until service is retrieved * <Interface>::tryGetService — immediately returns service or nullptr Currently, the NN runtime retrieves the service in three different places: 1) When the runtime first starts, <Interface>::getService is used to acquire all services 2) When the object is dead, <Interface>::tryGetService is used to attempt to reacquire the service, but will quickly resume if the service is still rebooting 3) When the client calls ANNDevice_wait, <Interface>::getService is used to block until the service is active again This CL simplifies the IDevice reboot logic by changing these static class functions to dependency injection. Specifically, VersionedIDevice now retrieves a handle to the IDevice object through a DeviceFactory function that is passed in when the VersionedIDevice object is created. This function can either operate as blocking or nonblocking to support all use-cases described above, and makes it easier to test the VersionedIDevice recovery code. Bug: 139189546 Test: mma Test: NeuralNetworksTest_static Test: CtsNNAPITestCases Change-Id: I012eb4df6f09f98bdfbd0835457ba98bc22d906e
2020-04-22Merge "Add NNT_static internal tests for device memory allocation." into rvc-devXusong Wang
2020-04-22Merge changes I85577481,I43ed11e9 into rvc-devXusong Wang
* changes: Add STRIDED_SLICE with shrinkMask in RGG tests. Increase the fp precision in dumped spec.
2020-04-21Add STRIDED_SLICE with shrinkMask in RGG tests.Xusong Wang
Fixes: 132322549 Test: NNT_static_fuzzing Change-Id: I85577481125e131741992e9d896d12320af67e1a
2020-04-21Increase the fp precision in dumped spec.Xusong Wang
By default, C++ will output 6 fractional digits of floating point values. This is insufficient for some of the RGG tests that requires precision < 1e-6. This CL uses hex representation for fp values in the generated spec file, while human-readable values are also dumped as a comment. Fixes: 144788409 Test: NNT_static_fuzzing and inspected the dumped spec Change-Id: I43ed11e9f73cb387ed8894713fe79361322315ba
2020-04-21Merge "Disable a non-sensible RGG test case." into rvc-devXusong Wang
2020-04-20Disable a non-sensible RGG test case.Xusong Wang
In this test, the RGG produces a non-sensible graph with extreme large output gain and highly clamped output range. Fixes: 153690038 Test: NNT_static_fuzzing Change-Id: I7063730e04ea8a18aecd20029eb6e726ac780c2a
2020-04-20Remove unused utility functionsLev Proleev
Bug: 129569821 Test: atest NeuralNetworksTest{_static,_utils} Change-Id: I3178c22e4570a4afb927eb42d275ae00e533c397
2020-04-20Add tests for multiplier quantization functionsLev Proleev
The tests are based on TF Lite's quantization_util_test.cc. Fix: 129569821 Test: atest NeuralNetworkTest_utils Change-Id: I9715e0a5f36d431f9d0bb2fbbf34e221996b6208
2020-04-17Add NNT_static internal tests for device memory allocation.Xusong Wang
These tests use a customized IDevice to test the device memory allocation and fallback logic. This CL also allows the runtime to dispatch device memory allocation with dynamic shape to drivers. Additionally, this CL fixes a bug that a failed device memory allocation will return BAD_DATA -- it should return OP_FAILED instead. Bug: 152209365 Test: NNT_static Change-Id: I1facb2dad345958c3b9b1bab4a9564085c382c4a
2020-04-17Merge "Add a WHILE test with unused outputs" into rvc-devSlava Shklyaev
2020-04-16Merge "Fix failures in TensorRankConstraint Tests" into rvc-devTreeHugger Robot
2020-04-15Fix failures in TensorRankConstraint TestsStefano Galarraga
Fix sporadic failures in CtsNNAPITestCases.TensorRankConstraint tests. Improves description of expectation failures when comparing OperandTypeWithExtraParams instances. Test: CtsNNAPITestCases Bug: 154093710 Change-Id: Ia2b8bc914892f2ff7908d247fa26743fa242f783
2020-04-15Add a WHILE test with unused outputsSlava Shklyaev
Fix: 148208229 Test: NNT_static Change-Id: I853f1f294cedacb0cbb810042ef2a3466a072ffe
2020-04-15Add operand type variations for WHILE testsSlava Shklyaev
Bug: 149199424 Test: NNT_static Test: VTS 1.3 Change-Id: I887be1b8530aad4568db9e75d3260b6b78884d23
2020-04-14Merge "Add NeuralNetworksTest_utils to presubmit" into rvc-devTreeHugger Robot
2020-04-14Merge "Add WHILE tests with CONSTANT_REFERENCE inputs" into rvc-devTreeHugger Robot
2020-04-14Add NeuralNetworksTest_utils to presubmitLev Proleev
Bug: 153540930 Test: atest+presubmit Change-Id: I8e3de182114503fd519b42393b36308145d125b8