History log of /frameworks/ml/nn/runtime/CompilationBuilder.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a144106df8f9b82251a5e584b1b083fb39d33b88 20-Apr-2018 Przemyslaw Szczepaniak <pszczepaniak@google.com> Error code fix and added new (std::nothrow) where needed.

- 'new (std::nothrow)' was added for object allocations that
may cause OUT_OF_MEMORY error code.
- Changed Memory::create error code from OP_FAILED
to OUT_OF_MEMORY.

Bug: 77732225
Test: NeuralNetworkTests
Change-Id: I063ff281cf819d546c6db67fc6da338fc87c632e
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
fc67d170972e9178f4c9bcec6c6d1b8e2c3161fa 13-Oct-2017 Jean-Luc Brouillet <jeanluc@google.com> Ensure that the selected device is better than the CPU.

Change the selection criteria to make sure we don't select
a device that's worse than the CPU.

Also added a check to make the compilation fail if there's an OEM op
in the model but no driver can do the work.

Bug: 67643728
Test: Ran system tests and VTS tests. Verified by changing sample drivers that the CPU was chosen when appropriate.

Change-Id: I31577ea72620d0179f6652b3a0496b01674a7b7c
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
c2f1c1198c84f5a75fc2305935155f33b8ff5db2 13-Nov-2017 David Gross <dgross@google.com> Add more testing interfaces to CompilationBuilder.

- Ability to override DeviceManager's partitioning setting.
- Ability to compile against a specified list of Devices.
- Ability to retrieve the ExecutionPlan.

Test: nn/runtime/test with debug.nn.partition unset and set to 0
Change-Id: Iae2ae7fdaf13335acd2856cdc93fa259bbe52bba
/frameworks/ml/nn/runtime/CompilationBuilder.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/runtime/CompilationBuilder.cpp
def0a14aa77689f12120cfb4f136eea659038cc0 05-Oct-2017 David Gross <dgross@google.com> Partitioning interface changes to enable unit testing.

Bug: 63905942
Test: mma (userdebug)
ml/nn/runtime/tests (userdebug)
(no failures, logcat looks plausible)

Change-Id: Ib9a5eb75b9e4e2c3534f392d5fb0e5ba3555197d
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
e3178825b8686f3300a895572691a2e8c1f0676b 05-Oct-2017 David Gross <dgross@google.com> Asynchronus partitioned execution, plus minor code cleanup.

Partioned execution is now asynchronous end-to-end, although
the individual execution steps are serialized with respect to
one another.

Other changes:
- Minor code cleanup per comments from previous CL
https://googleplex-android-review.git.corp.google.com/#/c/platform/frameworks/ml/+/3000624/
including comments on memory management for
inter-partition temporaries.
- Remove "simulation" form of partitioning, and renumber
values of debug.nn.partition property accordingly.
- Fix android:nn:wrapper::Event -- add missing contructor
and fix comment.

Bug: 63905942
Test: mma (user)
mma (userdebug)
ml/nn/runtime/tests (userdebug)
(and spot check that debug.nn.partition unspecified,
0, and 1 exhibits the correct control over
partitioning behavior)

Change-Id: I5767d2144c4a42258444a6445866529919d4fe8d
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
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/runtime/CompilationBuilder.cpp
b26049114bc4c64e6bea3a5d5d129fcaec8e69b6 02-Oct-2017 David Gross <dgross@google.com> Use ExecutionPlan to control (possibly multiple step) execution.

- Split StepExecutor out from ExecutionBuilder. ExecutionBuilder
represents the description of an execution passed in through the
NNAPI; StepExecutor is used to perform a single "step" of that
execution on a single device (or CPU).

- Introduce ExecutionPlan::Controller class. This is a token used
to allow ExecutionBuilder::startCompute() to iterate over a sequence
of steps provided by ExecutionPlan, obtaining a StepExecutor for each
one.

There should be no change from previous behavior; this is code
reorganization in preparation for supporting execution of partitioned
models. While ExecutionPlan is still only used when the property
debug.nn.partition.test is set to 0, and it still controls the
execution only when that property is set to 2, we do use the new
StepExecutor always.

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)

Change-Id: I17473210bcc5de40603d439ec49374030d1b8f36
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
47522fce0416bfae1cd26f676f251763cd22c172 29-Sep-2017 David Gross <dgross@google.com> Merge "Finish implementing single-partition graphs." into oc-mr1-dev
1f4381539b7e89c42336ee7cd1addb9a4c317b34 28-Sep-2017 David Gross <dgross@google.com> Finish implementing single-partition graphs.

This includes wiring up the partitioning algorithm
to the NN API compilation and execution phases under
debug.nn.partition.test=2: When we have a single-
partition graph, we rely on the device selection and
compilation performed by the partitioning algorithm,
rather than doing it at execution time as we were
before.

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,
compilation happens at the expected times)

Change-Id: I6cd8b53625588d5aca81c87cc8600735e384b8e0
/frameworks/ml/nn/runtime/CompilationBuilder.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/runtime/CompilationBuilder.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/runtime/CompilationBuilder.cpp
65aa556323f4a054f80a75b6c4c721b2a7ed3298 14-Sep-2017 David Gross <dgross@google.com> Make Compilation API synchronous.

Per advice from the API council, the Compilation API no longer exposes
asynchronous behavior to the user -- rather than start() and wait()
APIs, we now have a finish() API.

Also:
- Track whether or not Compilation::finish() has been invoked, for
the sake of API usage checking.
- Changed Model::finish() to return Result not int, for consistency.
- Made Model and Compilation documentation more similar to one another.
- Fixed typos in documentation.

NOTE: It's possible to implement compilation asynchronously behind the
synchronous API -- e.g., Compilation_finish() starts compilation
asynchronously, and we implicitly wait for it to complete at the point of
Request_startCompute(). However, this would defeat one of the purposes of
an explicit Compilation API -- giving the application control over when
to spend the time compiling, to keep it off a critical timing path, such
as repeatedly applying a model to a sequence of frames in real time.

Bug: 63905942
Test: nn/runtime/tests
Change-Id: I7194e277aa6211af66794d917dcc5254c7d81af4
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
3ced3cfd5b8f22b632c35f24e585c4847383b195 13-Sep-2017 David Gross <dgross@google.com> Rename Request to Execution at the API level.

There's a separate notion of Request at the HIDL level;
this is not renamed.

Bug: 63905942
Test: nn/runtime/tests

Change-Id: I671e3b387d735a9091dc5a2d14afbea6b45f444c
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
544739620cd7f37d40524d2407c92042e485c73f 11-Sep-2017 David Gross <dgross@google.com> More discipline for models and requests.

- Must explicitly call new finish() API on model before compiling
or freeing.

- Must not modify a request once start() has been called on it.

Bug: 63905942
Test: nn/runtime/tests, nn/common/operations tests
Change-Id: Ifc6e614bda647d729e8702023a02613e629ca6a0
/frameworks/ml/nn/runtime/CompilationBuilder.cpp
83e24dc4706a5b7089881a55daf05b3924fab3b7 10-Sep-2017 David Gross <dgross@google.com> Add compilation APIs.

For now, compilation is implemented as a synchronous no-op.

Bug: 63905942
Test: nn/runtime/tests, nn/common/operations tests

Change-Id: I1cb96a7e800671d0c70c9cc1b7eab6f8244232cb
/frameworks/ml/nn/runtime/CompilationBuilder.cpp