History log of /frameworks/ml/nn/common/Utils.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1da8fed77c5c296afa18f754ec3616e7f02a4cfd 12-Oct-2017 Jean-Luc Brouillet <jeanluc@google.com> Pass large model operand values in shared memory.

Because of a limitation in HIDL, large tensor values (e.g. weights)
need to pass in shared memory rather than as HIDL arguments. This
prevented large models from running on a driver.

Separated the handling of memory pools so that request and model
pools are not comingled.

Also improve logging so we see more details about the models when
logging.

Bug: 67603060
Test: Ran system tests and VTS tests.

Change-Id: I760e31275699f9306c4b21945935dc3a4ca68754
/frameworks/ml/nn/common/Utils.cpp
820215d28bed6c90f696cde0f282445d16da432e 05-Oct-2017 Miao Wang <miaowang@google.com> Allow fine grain verbose logging control through system property.

- Existing DEBUG and INFO change to the new mechanism, existing ERROR and
WARNING unchanged.
- By default, all verbose logging are disabled.
- setprop debug.nn.vlog 1 enables all verbose logging.
- setprop debug.nn.vlog "tag1 tag2 ..." only enable the selected tags.
- Available tags:
all: same as 1.
model: enable logging with tag MODEL.
compilation: enable logging with tag COMPILATION.
execution: enable logging with tag EXECUTION.
cpuexe: enable logging with tag CPUEXE.
manager: enable logging with tag MANAGER.
driver: enable logging with tag DRIVER.

Bug: 63905942
Test: mm
Test: NeuralNetworksTests pass
Test: manually set property to allow individual module to logging
verbosely
Test: tested with debug.nn.partition default -> 0 -> 1 to make
sure getProp still works fine

Change-Id: Iaa0ffa62176dabcdc35058748597df720fd6e47e
/frameworks/ml/nn/common/Utils.cpp
69d24339cfca4979e4f3af884c455935a9909793 04-Oct-2017 David Gross <dgross@google.com> Merge changes I04c71d70,I58b763bc into oc-mr1-dev

* changes:
Make partitioning and execution of partitioned plan the default.
Manage inter-partition temporaries.
a2a03635c8f215cb75be68ff1939bf4dec285ef8 03-Oct-2017 David Gross <dgross@google.com> Make partitioning and execution of partitioned plan the default.

Also, rename the debug.nn.partition.test property to
debug.nn.partition, and slightly change the interpretation of its
values:
2: the default: partitioned execution, with a fallback to
non-partitioned execution if there is a partitioning failure
3: a new value: partitioned execution, with NO fallback to
non-partitioned execution if there is a partitioning failure

Bug: 63905942
Test: mma (user)
ml/nn/runtime/tests (user)
(no new failures, logcat looks plausible,
debug.nn.partition 0 and 3 have no effect)
mma (userdebug)
ml/nn/runtime/tests (userdebug)
(with debug.nn.partition unspecified, 0, 1, 2, and 3;
no new failures, logcat looks plausible; also tried
manually introducing failures several places in the
partitioning process to ensure that simulation/fallback
behavior works properly for different values of
debug.nn.partition)

Change-Id: I04c71d7009aa0d1c971833a2af5816ff5830ecc9
/frameworks/ml/nn/common/Utils.cpp
96811e2b1347889a25bd9686f47ca3cbf061fb1b 02-Oct-2017 David Gross <dgross@google.com> Manage inter-partition temporaries.

This means: Allocate a Memory object for each TEMPORARY in the original
model that is live across partition boundaries; and tell each
StepExecutor about the mapping from a submodel input or output to the
appropriate Memory object.

With these changes, we can now fully execute multiple-partition plans.

Limitations:
- Still under control of debug.nn.partition.test property.
- Cannot handle operands of unknown size, except for model (not
submodel) inputs and outputs.
- Execution is synchronous.

Also: Teach sizeOfData() to work on scalars.

Bug: 63905942
Test: mma (user)
mma (userdebug)
ml/nn/runtime/tests (userdebug)
(with debug.nn.partition.test 0, 1, and 2;
no new failures, logcat looks plausible,
confirmed that GeneratedTests.mobilenet
runs on multiple partitions)

Change-Id: I58b763bc68bf8fe2e0306610c775b854e9292f76
/frameworks/ml/nn/common/Utils.cpp
62cc2758c1c2d303861e209f26bddcf4d7564b73 28-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Fix problem passing null optional operands.

Allow optional operands to be specified in the model as having no value.
Modify the HAL to allow passing missing operands. Change the validation
of most operations to verify that none of their operands are missing.

Bug: 63905942
Test: Compiled and ran runtime/test.
Change-Id: I378bc51847a8fb30cb2d36c9bf707ebadc79289b
/frameworks/ml/nn/common/Utils.cpp
25f0f2dcd7049cd9f8a60133697dff114bbbf00e 28-Sep-2017 Miao Wang <miaowang@google.com> Allow ADD and MUL taking quantized input.

- Implement the quant8 path for ADD and MUL.
- Add tests for quant8 ADD and MUL, both normal and broadcast version.
- Add validation for quantization parameters, forcing scale >= 0 and
zeroPoint in range [0, 255] for QUANT8_ASYMM type operands.

Bug: 63905942
Test: mm
Test: NeuralNetworksTest pass
Change-Id: Ib643217737af9624a079369e0aea792025223fbb
/frameworks/ml/nn/common/Utils.cpp
e127e49e67b53c96eb79f6a9c58f956ad4761227 28-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Moved validation to the specific classes.

It's hard to keep track of what's validated when the validations
are found in two files (NeuralNetworks.cpp + one of the other).
Move all the validations except for the initial nullptr check
to the specific file.

Moved some code from Memory.h into the .cpp file.

Adjusted some type size for setInput/Output/*

Adding new validations will be in the future CLs to make
review easier.

Bug: 63905942
Test: Ran local and VTS tests.
Change-Id: I2c448c9b0d3f2e878278f24eafce5720590403f3
/frameworks/ml/nn/common/Utils.cpp
0b9453e41a544f9c780eaa15ad65136ad4662ccb 23-Sep-2017 David Gross <dgross@google.com> More debugging tools for graph partitioning.

1) Under property debug.nn.partition.test, run partitioning
algorithm fropm CompilationBuilder::finish(). We don't
use the results -- this is to produce log output and to
verify that we don't crash.
2) Add a little more LOG(DEBUG) output.

Bug: 63905942
Test: mm (userdebug and user)

Change-Id: I8f0f4477cb9a564dcd55536677687c7914a9b86e
/frameworks/ml/nn/common/Utils.cpp
7d6ac906f000f3afe418e92c0a4ae36b2ea1143e 23-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Remove operationTuple.

Removed operationTuple from Model in the HAL, as the data type was
redundant information.

Removed supportedOperationTuples from Capabilities, as real drivers need
more complex restrictions than this provided. For the OC-MR1, we'll just
rely on getSupportedNodes.

Also removed the unused cachesCompilation.

Bug: 63905942
Test: Compiled and ran tests, incl. vts.

Change-Id: I84433d1e0e5211ac2f77317f3752171d85a5ab04
/frameworks/ml/nn/common/Utils.cpp
91e8417c4c395e3922d12abfd956b93b71121976 14-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Partition the requests to run on multiple devices.

Partition the request so that subgraphs can run on the best device.
Also respects the capabilities of a device so that we don't try
to run a device incapable to run a graph.

Bug: 63905942
Test: Compiled and ran unit tests. We'll want more advance tests.

Change-Id: I8662fa719661e5b68c47cd75703edb5937fc8f0a
/frameworks/ml/nn/common/Utils.cpp
5e7827e7bdc7ee6b6fc9b1989070c98fa10e9797 13-Sep-2017 David Gross <dgross@google.com> 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: Ia9262ec727f93dfe1b0ccade4ed76347c55ba163
/frameworks/ml/nn/common/Utils.cpp
5f916fc9a7ae95f172492bdfe5344c37beff3a6f 12-Sep-2017 Michael Butler <butlermichael@google.com> Neuralnetworks HAL cleanup -- frameworks/ml/nn

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

It makes the corresponding changes to the runtime.

Bug: 63905942
Test: mm, frameworks/ml/nn/runtime/test
Change-Id: I1545373dfa30780aaf9b61b3938be536cf122e74
/frameworks/ml/nn/common/Utils.cpp
a4e2ee81d015b5e26897d18b18dd50044faba62f 10-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> 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 and test.py

Change-Id: I8ce007c439ccc99b1e04cce412ba6c93453c7a02
/frameworks/ml/nn/common/Utils.cpp
55cef2193279a646292fdeb355399627dd8990c8 09-Sep-2017 Miao Wang <miaowang@google.com> Explicitly add "_2D" to applicable ops, and add fused activation
function enum.

- Add the fused activation enum to explicitly set the expectation that
only the included ones are supported for fused ops.
- Add "_2D" to CONV, DEPTHWISE_CONV, AVG_POOL, MAX_POOL, and L2_POOL,
since they are only supposed to do 2D computation.
- Updated the tests and the stack to plumbing the changes through.

Bug: 63905942
Test: mm
Test: NeuralNetworksTests pass for both CPU path and sample hidl driver.
Change-Id: I60aeabab1d193d26d938c0d1d3ffdd519740d222
/frameworks/ml/nn/common/Utils.cpp
c1ab6fc5e953a61811e9f25d2afff06bfa571f0e 01-Sep-2017 Jean-Luc Brouillet <jeanluc@google.com> Cleanup the constants in NeuralNetworks.h

- Alphabetize the operations.
- Move the constants that count operation and types
out of the public header file.
- Remove N_GRAM operation.
- Add TENSOR_INT32.
- Add static assert verifications.
- Add documentation.

Test: Compiled and ran the tests.
Bug: 63905942

Change-Id: Ifafdcb3fd00efabd2b1972b035cc5d43f7dbec51
/frameworks/ml/nn/common/Utils.cpp
a67d8a0e28baef2fab57a2a3255461869abed74d 30-Aug-2017 Miao Wang <miaowang@google.com> Add OEM_OPERATION enum.

Bug: 63905942
Test: mm
Test: All unit tests passing on sailfish
Change-Id: I391ca039620be6525d95ad581acdb6e11d091af2
/frameworks/ml/nn/common/Utils.cpp
15b59e721efe1a75b0e8cde8bd44bbb532446e13 12-Aug-2017 Yang Ni <yangni@google.com> Implement EMBEDDING_LOOKUP and HASHTABLE_LOOKUP

Bug: 63905942

Adapted previous TF Lite implementation and unit tests for NN API on
CPU.

Test: adb shell /data/nativetest64/embedding_lookup_test/embedding_lookup_test
Test: adb shell /data/nativetest64/hashtable_lookup_test/hashtable_lookup_test

Change-Id: I6e4a9d8c5d0d47e66e3fa771967da3526d19ac4b
/frameworks/ml/nn/common/Utils.cpp
8b99bb1d98a42b67ba1c00e12c7abb3708cf7c05 21-Aug-2017 Jean-Luc Brouillet <jeanluc@google.com> Add full support for Memory pools.

Weights can now be passed via memory pools.

Test: Compiled and ran the unit test.
Bug: 63905942
Change-Id: I997a10f6102dcae7c6876c96a4f6f913eaf54c74
/frameworks/ml/nn/common/Utils.cpp
27e9be3904b034e422ee9b6ab70b35ea994d2b39 03-Aug-2017 Miao Wang <miaowang@google.com> Initial implementation of the following quantized ops.

- CONV_QUANT8
- DEPTHWISE_CONV_QUANT8
- AVERAGE_POOL_QUANT8
- MAX_POOL_QUANT8
- LOGISTIC_QUANT8

Additionally, added functions to plumb through quantization
parameters.

Bug: 63905942
Test: mm
Test: end-to-end MobileNet quantized test pass

Change-Id: Ib2753c68bf2c51467ae1c158b45541bcfdf10789
/frameworks/ml/nn/common/Utils.cpp
707dbd2d55f5dacf78ffb3ad7c8b3f37c2e9d758 25-Jul-2017 Jean-Luc Brouillet <jeanluc@google.com> Pass the model as an HIDL component.

Major rework where instead of serializing the model and
passing it in a shared memory, we pass it via HIDL.

The runtime/test code does two run, one goes through the
default CPU path, the other through any available driver.

Note: The code in hardware/../sample was written by Michael Buttler.

Bug: 63905942
Test: Runs both the CPU path and through the sample driver.
Change-Id: Ie3ee975d33056ba299895b13193f4698a690dd04
/frameworks/ml/nn/common/Utils.cpp
96775128e3bcfdc5be51b62edc50309c83861fe8 12-Jul-2017 Jean-Luc Brouillet <jeanluc@google.com> First implementation of the Neural Networks API.

This first version can run a simple query on the CPU either
via the fallback path or through a simulated driver.

This code has many deficiencies: single threaded, not all
validation are done, not going through HIDL, and not
enough unit tests. Expect more changes!

Test: Compiled and ran the unit tests

Change-Id: I9f6a485a2e7207aeb5f91a2904dcb4b7fd8a6f65
/frameworks/ml/nn/common/Utils.cpp