Commit graph

1028 commits

Author SHA1 Message Date
Michael Butler
c782110765 Add documentation to the Neuralnetworks HIDL HAL.
Bug: 63905942
Test: not needed
Change-Id: I1582d20e66ef939581d82f21088f0db0bc0f5eb7
2017-09-13 17:56:05 -07:00
Ray Sung
4385047049 Merge "Relax tolerance for FP comparison in test harness" into oc-mr1-dev 2017-09-14 00:53:27 +00:00
I-Jui (Ray) Sung
773369a372 Relax tolerance for FP comparison in test harness
Tests like RNN needs slightly more relaxed tolerance than 4ULP.
Use 1e-5 from corresponding TFLite tests.

Bug: 63905942
Test: VtsHalNeuralnetworksV1_0TargetTest on Angler
Change-Id: I721711e13575f56e956d87e3ad537467f85e93f4
2017-09-13 17:51:45 -07:00
Miao Wang
5ea3ece7ca Make the enums signed int, remove unused info.
Bug: 63905942
Test: NeuralNetworksTest pass
Change-Id: I40ca1120d05ea8900f4f4e49409d3096f46ec0e1
2017-09-13 16:29:34 -07:00
David Gross
a7cdb30b19 Move OEM codes out of NeuralNetworks.h to new file NeuralNetworksOEM.h.
Also remove FAKE_QUANT operation.

Bug: 63905942
Test: nn/runtime/tests, vts

Change-Id: Icfb5e7dbb9c2cca6e719ec2ab6344dbe5d95c86b
2017-09-13 12:31:33 -07:00
I-Jui (Ray) Sung
2c4e1368e1 Test harness for generated tests
Created initial test harness for test models and examples from
NNAPI test generator in VtsHalNeuralnetworksV1_0TargetTest. As
an example, also added a test generated from test spec at
frameworks/ml/nn/tools/test_generator/tests/P_vts_full/.

Generated model setup code and examples are from:
frameworks/ml/nn/runtime/test/generated/examples and
frameworks/ml/nn/runtime/test/generated/vts_models respectively.

Bug: 63905942
Bug: 63525563
Test: VtsHalNeuralnetworksV1_0TargetTest with sample driver enabled
      by cherry-pick

Change-Id: Ief029eed9718c8724ef0b64fc6a7f6b9a7bc7b7b
2017-09-13 08:02:05 +00:00
Michael Butler
61ae6edbe6 Neuralnetworks HAL cleanup -- hardware/interfaces
Does three primary cleanups:
1) Removes unused OperandTypes, creates OEM types
2) Creates explicit ErrorStatus; functions return status
3) IDevice::initialize renamed to getCapabilities,
   IDevice::getSupportedSubgraph renamed to getSupportedOperations

Additionally fixes the corresponding VTS tests.

Bug: 63905942
Test: mm, vts
Change-Id: Ib4c61b9b13963ac2367f21dc3c20e5946eb955a9
2017-09-12 22:32:25 -07:00
Michael Butler
e9dc1674f0 Make prepareModel asynchronous.
Updated the corresponding VTS tests.

Bug: 63905942
Test: mm, vts
Change-Id: Ie520af845f491dbdd93ea66fd643d77cfb4703f7
2017-09-11 23:17:21 -07:00
David Gross
2b395216c3 Merge "Fix bug in the way an Event handles a bound thread." into oc-mr1-dev 2017-09-12 04:02:53 +00:00
David Gross
0380d7f60a Fix bug in the way an Event handles a bound thread.
This just keeps the (test) Event representation in sync with
the runtime Event representation, which is modified by

  https://googleplex-android-review.git.corp.google.com/#/c/platform/frameworks/ml/+/2880348/

Bug: 63905942
Test: vts
Change-Id: I2a6de4397c5e31e35cb3d02e241dd21452c21ca6
2017-09-11 16:23:17 -07:00
Jean-Luc Brouillet
62cc79bdf0 Refactor how arguments are tracked.
Use an explicit description of the lifetime of an operand
rather than relying on poolIndex to do the job.

Bug: 63905942
Test: Ran unit tests

Change-Id: I53c4c10b40fd3312232b0689b43d0f72a2818490
2017-09-10 14:39:19 -07:00
Miao Wang
199aa86411 Add FusedActivationFunc enum and renamed certain operations.
- Add "_2D" to CONV, DEPTHWISE_CONV, AVG_POOL, MAX_POOL, and L2_POOL,
    since they are only supposed to do 2D computation.
  - Remove CAST, GATHER, SPLIT.
  - Also update the tests to reflect the changes.

Bug: 63905942
Test: mm
Test: NeuralNetworksTests pass for both CPU path and sample hidl driver.
Change-Id: I5bcf219c4c6cd4f866c1023d1f35cdc83ca69a85
2017-09-08 23:00:23 -07:00
Michael Butler
0e2ac1bb88 NNAPI Concurrent Query Management -- HAL and VTS update
The NNAPI requires requests on a model to be asynchronously
processed. This CL implements a basic Event that can later
be used to block the runtime thread until the asynchronous
request has completed.

Bug: 63905942
Test: VtsHalNeuralnetworksV1_0TargetTest (32-bit, 64-bit) with sample driver enabled by cherry-pick
      frameworks/ml/nn/runtime/test with and without sample driver enabled
Change-Id: Ie27a574aaaac312e7cbb731750f9c06278357a1c
2017-09-01 11:07:56 -07:00
Jean-Luc Brouillet
5d143d2a0f Cleanup the constants.
- Alphabetize the operations.
- Remove N_GRAM operation.
- Add TENSOR_INT32.

Test: Compiled and ran the tests.
Bug: 63905942
Change-Id: Ie7d9dec671a409256b686ef4665171492d1ac16a
2017-08-31 23:25:57 -07:00
Miao Wang
df5dd34d65 Add OEM_OPERATION to NN HAL.
Bug: 63905942
Test: mm
Test: All unit tests pass on Sailfish
Change-Id: I8c8068b248d682fbf1db37de78666c9cbca376b4
2017-08-31 10:57:29 -07:00
Yang Ni
9e06ee8c54 Merge "Replace LOOKUP with EMBEDDING and HASHTABLE_LOOKUP" into oc-mr1-dev 2017-08-31 15:11:04 +00:00
Zhuoyao Zhang
6afb992759 Update vts test to use the updated test template.
* For registerTestService/getServiceName, no need to pass
  any hard coded string of HAL service FQName.
* Affect test: VtsHalCameraProviderV2_4TargetTest,
               VtsHalGraphicsComposerV2_1TargetTest,
               VtsHalNeuralnetworksV1_0TargetTest

Bug: 62946472
Bug: 64203181

Test: make vts
      vts-tradefed run vts -m VtsHalCameraProviderV2_4Target

Merged-In: If365ab2ed9a91eb4013d71769804b9d4bf089d66
Change-Id: Id0bddbc2949337147557f45cc60dbfaa114ce25e
(cherry picked from commit d71b654d6d)
2017-08-29 17:44:10 +00:00
David Gross
8454fcd4dc Fix test that broke when number of ADD inputs increased from 2 to 3.
Test: vts: nn32, nn64

Bug: 63905942

Change-Id: Ie4b237d0c16247d7774a13384a59453da94c5d91
2017-08-25 16:27:38 -07:00
Yang Ni
7d23580117 Replace LOOKUP with EMBEDDING and HASHTABLE_LOOKUP
Bug: 63905942

Test: adb shell /data/nativetest64/embedding_lookup_test/embedding_lookup_test
Change-Id: Ic9ac31f60ac8a6e2c59700a34909004f4b5dc9ff
2017-08-21 09:23:05 -07:00
Miao Wang
5a9c0c3186 Merge "Remove the data type from the OperationType enum." into oc-mr1-dev 2017-08-16 23:47:06 +00:00
Miao Wang
a5a663c6e5 Remove the data type from the OperationType enum.
- Now the driver needs to report a list of tuple
    {OperationType, OperandType} for capabilities.
  - Any time Operation information is passed across HIDL,
    it should be passed as the tuple {OperationType, OperandType}

Bug: 63905942
Test: mm
Change-Id: I909b5acf4936f65c242ee0925d3a1ac665f46131
2017-08-11 18:35:24 -07:00
Tri Vo
33687730ee Merge "Neural networks test static links to HAL def libs." into oc-mr1-dev 2017-08-10 20:43:07 +00:00
Tri Vo
0cd9782665 Neural networks test static links to HAL def libs.
Bug: 64040096
Test: compiles
Change-Id: I87d26a93fa28d7cd93176489a0d0556b7350f1ed
2017-08-04 10:55:31 -07:00
Justin Yun
608d773ef8 Update make file for vndk enabled.
Update the Android.bp generated with hidl-gen.

Test: build with and without BOARD_VNDK_VERSION=current
Bug: 63866913
Change-Id: I1a9db1df49e0f13c5790da2b118ae9ec63ba34a7
2017-08-04 14:12:23 +09:00
Tri Vo
f5d136c231 Update Android.bp HIDL makefiles
Allow HAL definition libs to be static.

Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Change-Id: I1483d572bea6799717d1614fb7d52fe225e31104
2017-08-03 00:30:01 +00:00
Michael Butler
dfc529dfef Add OWNERS file to Neuralnetworks VTS test directory
Added all six Neuralnetworks team members and two VTS team members

Bug: 63905942
Bug: 63525563
Test: Not needed
Change-Id: I87a2968af5ceec656e8f392cc0291689e66fef5d
2017-08-02 00:21:06 -07:00
Michael Butler
bb4ff6557f Initial VTS tests for Neural Networks HAL.
This CL has the basic framework for the NNAPI VTS tests with one
positive function test for each HAL function. This CL is being uploaded
now because the NN API HAL files are being moved to hardware/interfaces.

Bug: 63905942
Bug: 63525563
Test: mm -j40
Test: vts-tradefed runs and passes
Change-Id: I8f3d606ec50a6a6d110c89132e6fb89f53f3bf48
2017-07-31 17:49:28 -07:00
Michael Butler
376ec0c0fd Move neuralnetworks HAL to hardware/interfaces
The neuralnetworks hal was placed in
frameworks/ml/nn/hardware/interfaces while VTS tests were being
developed.

This CL moves it to hardware/interfaces and another CL removes
it from frameworks/ml/nn/hardware/interfaces.

VTS tests included in a sibling CL in this topic.

Bug: 63905942
Test: mm -j40
Change-Id: I0e6c84de72a763edbaef3e9b3063c3ecca216337
2017-07-29 00:10:35 -07:00