platform/core/ml/nntrainer.git
2 years ago[Test] Add multiout realizer test
Jihoon Lee [Mon, 22 Nov 2021 13:16:44 +0000 (22:16 +0900)]
[Test] Add multiout realizer test

This patch add multiout realizer test

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[MultiOut] Implement multiout realizer
Jihoon Lee [Thu, 18 Nov 2021 01:04:15 +0000 (10:04 +0900)]
[MultiOut] Implement multiout realizer

This patch implements multiout realizer which will gaurantee that
each input_layer only refers to a single connection (tensor)

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Remap] Introduce remapping only identifiers
Jihoon Lee [Wed, 17 Nov 2021 06:07:04 +0000 (15:07 +0900)]
[Remap] Introduce remapping only identifiers

This patch introduce way to remap only connections.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Multiout/trivial] Add scaffolding for mo realizer
Jihoon Lee [Wed, 17 Nov 2021 04:09:37 +0000 (13:09 +0900)]
[Multiout/trivial] Add scaffolding for mo realizer

This patch add multiout realizer scaffolding

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[layer] Embedding layer support ZeroMaskIdx
Parichay Kapoor [Wed, 24 Nov 2021 06:15:27 +0000 (15:15 +0900)]
[layer] Embedding layer support ZeroMaskIdx

Embedding layer support zero mask index which if set will pass zero
values for that particular index in the forward propagation and will not
be updated with gradient.

Further minor updates to tensor related to getting tensor values.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Embedding input data format
Parichay Kapoor [Wed, 24 Nov 2021 05:24:04 +0000 (14:24 +0900)]
[layer] Embedding input data format

Embedding layer should assume that the input data is written in int
format than in float data. Reading data as float can lead to wrong
values when typecasting to int if std::lround() is not properly used.
Further, as other frameworks require using integer data for embedding,
its best if follow the same input formats.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Node] Add get/set method to manipulate connection
Jihoon Lee [Mon, 22 Nov 2021 10:08:58 +0000 (19:08 +0900)]
[Node] Add get/set method to manipulate connection

This patch add get/set method to input connections for further use

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Node] replace output layer string -> connection
Jihoon Lee [Mon, 22 Nov 2021 08:47:53 +0000 (17:47 +0900)]
[Node] replace output layer string -> connection

This patch replaces output layer from string to connection

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Node] Replace input layers -> input connection
Jihoon Lee [Mon, 22 Nov 2021 08:31:53 +0000 (17:31 +0900)]
[Node] Replace input layers -> input connection

This patch replace input layers to input connection.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Connection] Add indexing to connection
Jihoon Lee [Mon, 22 Nov 2021 06:43:16 +0000 (15:43 +0900)]
[Connection] Add indexing to connection

This patch revisition connection spec to contain identifier and index to
make use of it.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[fix] Set input layer when given input layer is empty
hyeonseok lee [Mon, 29 Nov 2021 06:13:21 +0000 (15:13 +0900)]
[fix] Set input layer when given input layer is empty

 - Added input layer from the graph when given input layer is empty

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[trivial/Fix] add dependency header
Jihoon Lee [Mon, 29 Nov 2021 05:45:57 +0000 (14:45 +0900)]
[trivial/Fix] add dependency header

As fwd declaration is widely used, run context header needs to be added
where it is being used

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[QuickFix] Disable contiguous check on add_i
hyeonseok lee [Fri, 26 Nov 2021 03:44:13 +0000 (12:44 +0900)]
[QuickFix] Disable contiguous check on add_i

 - For now disable contiguous check of tensor on add_i
    since the add_strided does not support broadcast.

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[ Android ] add static option for openmp
jijoong.moon [Fri, 26 Nov 2021 01:54:16 +0000 (10:54 +0900)]
[ Android ] add static option for openmp

This is the fix for "cannot find libomp.so"

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
2 years ago[layer] missing layer constructor
Parichay Kapoor [Fri, 19 Nov 2021 10:10:55 +0000 (19:10 +0900)]
[layer] missing layer constructor

Add missing layer constructor for permute.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Bug fix for permute layer
Parichay Kapoor [Fri, 19 Nov 2021 10:07:02 +0000 (19:07 +0900)]
[layer] Bug fix for permute layer

Permute layer backward bug in the calculation of the reverse
direction of the permute is fixed.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Shape mismatch check in reshape layer
Parichay Kapoor [Fri, 19 Nov 2021 10:06:35 +0000 (19:06 +0900)]
[layer] Shape mismatch check in reshape layer

Add shape mismatch check in reshape layer.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago [layer devel] clean up header dependency
Jihoon Lee [Fri, 19 Nov 2021 04:21:59 +0000 (13:21 +0900)]
 [layer devel] clean up header dependency

This patch clean up header dependency related to layer devel which
is being included in so many places and does not need layer_context to
be included in it's translation unit

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Build] Use iosfwd instead of iostream
Jihoon Lee [Fri, 19 Nov 2021 03:33:13 +0000 (12:33 +0900)]
[Build] Use iosfwd instead of iostream

This patch changes <iostream> to iosfwd when it is not really needed

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[nn] Apply previous input realizer
Jihoon Lee [Thu, 18 Nov 2021 08:57:11 +0000 (17:57 +0900)]
[nn] Apply previous input realizer

This patch applies previous input realizer.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Fix] Flatten realizer to not rely on default Layer Addition
Jihoon Lee [Thu, 18 Nov 2021 08:38:10 +0000 (17:38 +0900)]
[Fix] Flatten realizer to not rely on default Layer Addition

As default layer add happens before realizer, flatten layer must not
depend on the layer adding behavior.

This patch fixes flatten realizer to not depend.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Realizer] Implement previous input realizer
Jihoon Lee [Thu, 18 Nov 2021 07:02:30 +0000 (16:02 +0900)]
[Realizer] Implement previous input realizer

This patch implement previous input realizer.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Realizer] Implement previous input realizer test
Jihoon Lee [Thu, 18 Nov 2021 07:00:17 +0000 (16:00 +0900)]
[Realizer] Implement previous input realizer test

This patch implement previous input realizer test to demonstrate
specification of previout input realizer

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Scaffolding] previous input realizer
Jihoon Lee [Thu, 18 Nov 2021 01:21:48 +0000 (10:21 +0900)]
[Scaffolding] previous input realizer

This patch implements previous input realizer.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[test] Enable layer node test
Parichay Kapoor [Thu, 18 Nov 2021 08:40:01 +0000 (17:40 +0900)]
[test] Enable layer node test

Enable the layer node test.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Add] add leaky relu to actifun
Jihoon Lee [Thu, 25 Nov 2021 07:13:54 +0000 (16:13 +0900)]
[Add] add leaky relu to actifun

This patch add leaky relu to actifun, for now there is no need to add
slope parameter, this is more like a quick fix

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[unittest] Implement grucell unittest
hyeonseok lee [Mon, 22 Nov 2021 06:49:36 +0000 (15:49 +0900)]
[unittest] Implement grucell unittest

 - Verify grucell with tensorflow by layer unittest
 - Added grucell model unittest to verify multi unit/timestep, stacked, unroll situation with pytorch
 - Todo: Finds other way without copying when convert gate order of pytorch grucell

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[grucell] Implement grucell
hyeonseok lee [Mon, 22 Nov 2021 06:46:17 +0000 (15:46 +0900)]
[grucell] Implement grucell

 - Support add with non-contiguous tensor
 - Implement grucell which is run only 1 timestep
 - Todo:
   1. Make it more efficient with strided tensor(Reduce copy tensor)
   2. Reduce temporary tensor or do inplace operation

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[bugfix] Bugfix on tensor sum
hyeonseok lee [Thu, 28 Oct 2021 07:35:22 +0000 (16:35 +0900)]
[bugfix] Bugfix on tensor sum

 - Check beta is null when copy the origin data on sum function and added unittest
 - Remove argument beta on outplace sum function
 - Makes bias_hh to zero instead of bias_ih in recurrent models when convert pytorch to nntrainer
 - Fix typos

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[graph] Reduce metadata overhead of slice realizer
Parichay Kapoor [Mon, 15 Nov 2021 05:16:35 +0000 (14:16 +0900)]
[graph] Reduce metadata overhead of slice realizer

Slice realizer was storing the path for each node from the start nodes
to themselves. This can be big, and also comes with a overhead of
storing and copying these paths for each node.

This patch updates the implementation of the dfs to a recursive approach
which maintains the stack of the nodes in the memory which represents
the path till now.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[graph] Bug fix for slice realizer
Parichay Kapoor [Fri, 12 Nov 2021 05:34:30 +0000 (14:34 +0900)]
[graph] Bug fix for slice realizer

Below bugs have been fixed for the slice realizer:
- end layers were being added using children which were not set yet
- the dfs_stack never ignored nodes which had already been visited which
was leading to infinite loop
- an invalid graph given with loops would be stuck in infinite loop in
the DFS

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Add exportTo for concat layer
Parichay Kapoor [Fri, 12 Nov 2021 05:33:27 +0000 (14:33 +0900)]
[layer] Add exportTo for concat layer

Concat layer has properties which were not being saved. This patch adds
the corresponding support.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Test] Add singleshot case test
Jihoon Lee [Mon, 15 Nov 2021 08:21:06 +0000 (17:21 +0900)]
[Test] Add singleshot case test

Add singleshot test case when ml_inference get null input information

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Filter] Add dimension inference mechanism
Jihoon Lee [Mon, 15 Nov 2021 08:19:40 +0000 (17:19 +0900)]
[Filter] Add dimension inference mechanism

This patch add dimension inference mechanism as requested.
Please refer to nnstreamer/api#105 for details

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] Propose new tensor spec
Jihoon Lee [Wed, 10 Nov 2021 09:10:13 +0000 (18:10 +0900)]
[Tp] Propose new tensor spec

This patch proposes new tensor specification

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[tensor] Add checks for non-contiguous tensor before operations
Parichay Kapoor [Wed, 3 Nov 2021 06:26:19 +0000 (15:26 +0900)]
[tensor] Add checks for non-contiguous tensor before operations

This patch adds checks for contiguous tensors ensuring that operations
which dont support non-contiguous tensors throw on receiving the
non-contiguous tensors.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Trivial] Delete duplicated file
Jihoon Lee [Wed, 17 Nov 2021 03:02:35 +0000 (12:02 +0900)]
[Trivial] Delete duplicated file

This patch delete duplicated test file that is not used anywhere

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Feature check] Add tizen 6.5 compatibility
Jihoon Lee [Mon, 22 Nov 2021 04:14:21 +0000 (13:14 +0900)]
[Feature check] Add tizen 6.5 compatibility

As prefix has been added to the `ml_tizen_set_feature_state` for tizen
7.0 this patch makes backward compatible to the old tizen version

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[ README ] Add SSDC2021 presentation
jijoong.moon [Fri, 19 Nov 2021 01:00:23 +0000 (10:00 +0900)]
[ README ] Add SSDC2021 presentation

Add SSDC2021 Presentation in README

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
2 years ago[QuickFix] Check weight access for the last
Jihoon Lee [Mon, 15 Nov 2021 04:47:13 +0000 (13:47 +0900)]
[QuickFix] Check weight access for the last

This patch sets lastGradientAccess and firstGraidentAccess based on the
weight access order for non-trainable tensor.

This is a improviser and must be handled in a correct way.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Weights] Add last access concept
Jihoon Lee [Fri, 12 Nov 2021 08:44:03 +0000 (17:44 +0900)]
[Weights] Add last access concept

As all weights are shared now, we need last accesss to be deteremined
This patch implements such behavior with a test

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[QuickFix] Add not dependent weight sharing
Jihoon Lee [Fri, 12 Nov 2021 05:35:17 +0000 (14:35 +0900)]
[QuickFix] Add not dependent weight sharing

This patch allows weight sharing regardless of allocation order of
weight sharing

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Build] Fix fbs causing rebuilding
Jihoon Lee [Thu, 18 Nov 2021 05:03:27 +0000 (14:03 +0900)]
[Build] Fix fbs causing rebuilding

This patch fixes flatbuffer cause rebuilding.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Fix] api feature check problem
Jihoon Lee [Wed, 17 Nov 2021 22:56:02 +0000 (07:56 +0900)]
[Fix] api feature check problem

This is an emergency measure for feature check is failing inside
unittest of gbs build.

Also enabled ml_inference test

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] Rename requestTensor -> request
Jihoon Lee [Tue, 9 Nov 2021 08:06:53 +0000 (17:06 +0900)]
[Tp] Rename requestTensor -> request

This patch renames requestTensor to request

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] requestPreallocated -> view
Jihoon Lee [Tue, 9 Nov 2021 06:12:41 +0000 (15:12 +0900)]
[Tp] requestPreallocated -> view

This patch rename requestPreallocated to view

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] rename externallyAllocated -> placeholder
Jihoon Lee [Tue, 9 Nov 2021 05:44:14 +0000 (14:44 +0900)]
[Tp] rename externallyAllocated -> placeholder

This patch renames externallyAllocated -> placeholder

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[KNN] Fix querying label when not training
Jihoon Lee [Fri, 12 Nov 2021 02:02:45 +0000 (11:02 +0900)]
[KNN] Fix querying label when not training

This patch fix querying label when not training, which is not feasible

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[KNN] Implement knn saving
Jihoon Lee [Thu, 11 Nov 2021 07:48:56 +0000 (16:48 +0900)]
[KNN] Implement knn saving

As knn was not saving it's props, this patch implements saving property

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Test] Add ml singleshot example
Jihoon Lee [Wed, 10 Nov 2021 12:19:19 +0000 (21:19 +0900)]
[Test] Add ml singleshot example

This patch adds integrated test to show and test ml singleshot.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[tp] Implement reidentifySource()
Jihoon Lee [Fri, 5 Nov 2021 09:42:23 +0000 (18:42 +0900)]
[tp] Implement reidentifySource()

This patch implements reidentifySource(). Test will be followed

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] Add dimension check to extend
Jihoon Lee [Tue, 9 Nov 2021 05:25:38 +0000 (14:25 +0900)]
[Tp] Add dimension check to extend

This patch add dimension check to extend

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tp] rename create -> request
Jihoon Lee [Tue, 9 Nov 2021 05:21:05 +0000 (14:21 +0900)]
[Tp] rename create -> request

As per request, create has been renamed to request

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Trivial] Use if instead of template
Jihoon Lee [Fri, 5 Nov 2021 09:03:46 +0000 (18:03 +0900)]
[Trivial] Use if instead of template

This patch changes template to if constexpr. There seems to be false
positive with cppcheck with previous implementation, but do not need to
bother by a code used only in very small places.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years agoPolicy based tensor request for tensor pool.
Jihoon Lee [Fri, 5 Nov 2021 08:38:02 +0000 (17:38 +0900)]
Policy based tensor request for tensor pool.

This commit specifically implement createOrExtend().

From this commit, basic tensor pool request will be possible except
`reidentifySource()`.
`reidentifySource()` will come as a separate PR to get better review.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[TP] Implement extend()
Jihoon Lee [Fri, 5 Nov 2021 08:08:13 +0000 (17:08 +0900)]
[TP] Implement extend()

This patch implements extend() and corresponding tests

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Tpool] Remove updateExternalTensor
Jihoon Lee [Fri, 5 Nov 2021 07:36:06 +0000 (16:36 +0900)]
[Tpool] Remove updateExternalTensor

Instead of requesting externally to update external tensor, now syncing
dependency done upon request and renamed to `fillPlaceholder` to align
with incoming changes

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Clean] Separate src spec from dep spec
Jihoon Lee [Fri, 5 Nov 2021 07:22:20 +0000 (16:22 +0900)]
[Clean] Separate src spec from dep spec

As source specification and dep specification is being deviated, this
patch prepares for the further code changes with minor clearance.

**Changes proposed in this PR:**
- RequestSpec now has tensor, details
- Detail is `std::variant<SourceDetails, DependencyDetails>`

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Trivial] ZERO_LIFESPAN -> UNMANAGED
Jihoon Lee [Fri, 5 Nov 2021 07:17:58 +0000 (16:17 +0900)]
[Trivial] ZERO_LIFESPAN -> UNMANAGED

This patch renames zero_lifespan to unmanaged.

zero_lifespan suggests it should be extendable but it's precisely not.
So changed name for clarity.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[tpool] Implement view()
Jihoon Lee [Thu, 4 Nov 2021 11:41:22 +0000 (20:41 +0900)]
[tpool] Implement view()

**Changes proposed in this PR:**
- merge updateExternalTensor()
- enable offset for view/placeholder
- corresponding tests
- s/requestSpec/RequestSpec

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[TPool] implement create/placeholder
Jihoon Lee [Thu, 4 Nov 2021 09:07:18 +0000 (18:07 +0900)]
[TPool] implement create/placeholder

This patch implements create/view and its corresponding test.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[TPool] Add interface to enable extensive sharing
Jihoon Lee [Thu, 4 Nov 2021 08:47:56 +0000 (17:47 +0900)]
[TPool] Add interface to enable extensive sharing

This patch add interface to enable extensive sharing, including
reassigning or tensor pointer sharing (previously discussed as s3
sharing)

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[layer] Add modes to inplace layer execution
Parichay Kapoor [Wed, 3 Nov 2021 05:37:08 +0000 (14:37 +0900)]
[layer] Add modes to inplace layer execution

There are now 3 modes to inplace layer execution (compared to 2
previously - yes/no):
- none: not inplace
- restricting: if the current layer is inplace, then not every layer
right next to it can be inplace. The next layer can check its
conditions.
- non-restricting: this layer does not add any restrictions, and the
nexy layer can treat this layer just as an out-of-place layer when
deciding if the next layer should work in-place.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Inplace support for multiout layer
Parichay Kapoor [Mon, 1 Nov 2021 12:20:51 +0000 (21:20 +0900)]
[layer] Inplace support for multiout layer

This patch adds support for in-place execution of the multiout layer.
Corresponding unittests are also added.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[unittest] Implement rnncell unittest
hyeonseok lee [Fri, 5 Nov 2021 07:14:32 +0000 (16:14 +0900)]
[unittest] Implement rnncell unittest

 - Generate rnn, rnncell layer unittest
 - Generate model unittest which is composed of rnncell
 - Verified with multi timestep/stacked/loop_unrolling situation

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[rnncell] Implement rnncell
hyeonseok lee [Fri, 29 Oct 2021 09:06:09 +0000 (18:06 +0900)]
[rnncell] Implement rnncell

 - Implement rnncell which is only run on 1 timestep

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[Bugfix] Regenerate lstmcell unittest
hyeonseok lee [Thu, 4 Nov 2021 10:56:44 +0000 (19:56 +0900)]
[Bugfix] Regenerate lstmcell unittest

 - Set lstm bias_ih to unused in init to fix the bug
 - Regenerate the lstmcell unittest
 - Fix typo

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[graph] Allocate memory based on which node runs
Parichay Kapoor [Tue, 2 Nov 2021 01:13:19 +0000 (10:13 +0900)]
[graph] Allocate memory based on which node runs

Currently, the memory was allocated assuming all the nodes were running
backwarding, and all the layers are trainable. But that is not true.
This patch applies the corresponding optimization and allocates memory
corresponding to the functions which will run on these nodes.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] LSTMCell bug fix
Parichay Kapoor [Mon, 1 Nov 2021 11:02:51 +0000 (20:02 +0900)]
[layer] LSTMCell bug fix

This patch applies bug fix for lstmcell.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[graph] Skip backwarding bug fix
Parichay Kapoor [Mon, 1 Nov 2021 06:51:42 +0000 (15:51 +0900)]
[graph] Skip backwarding bug fix

Current implementation assumes that the graph is always linear and skips
the backwarding for contiguous set of layers at the start of the model
which should not do the backwarding.

This patch makes a fix to this issue but allowing layers in the middle
of the sorted graph to skip backwarding.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[ README ] fix typo & add link for cc APIs
jijoong.moon [Tue, 2 Nov 2021 11:28:35 +0000 (20:28 +0900)]
[ README ] fix typo & add link for cc APIs

fix typo & add link for cc APIs

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
2 years ago[meson] Add android tflite disable option
Jihoon Lee [Thu, 28 Oct 2021 06:32:38 +0000 (15:32 +0900)]
[meson] Add android tflite disable option

This patch add android tflite disable option

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[ README ] update readme
jijoong.moon [Tue, 2 Nov 2021 02:59:18 +0000 (11:59 +0900)]
[ README ] update readme

This patch includes readme update.

**Self evaluation:**
1. Build test:  [X]Passed [ ]Failed [ ]Skipped
2. Run test:  [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
2 years ago[layer] Support prefix for sharing weight names
Parichay Kapoor [Mon, 1 Nov 2021 01:13:16 +0000 (10:13 +0900)]
[layer] Support prefix for sharing weight names

This patch allows support for prefix for sharing weight names across
layers, so that layers which should share their weights can do so by
using the same prefix.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Simplify naming scheme for requested tensors
Parichay Kapoor [Mon, 1 Nov 2021 01:08:48 +0000 (10:08 +0900)]
[layer] Simplify naming scheme for requested tensors

All layers were required to make unique name for their requests.
This is now rather done by layer context by appending layer name as a
prefix to the requested name.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Trivial/CAPI] Tizen typo fix
Jihoon Lee [Fri, 29 Oct 2021 03:21:05 +0000 (12:21 +0900)]
[Trivial/CAPI] Tizen typo fix

This patch fixes tizen typo

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[layer] lstmcell minor optimize
Parichay Kapoor [Fri, 29 Oct 2021 03:48:22 +0000 (12:48 +0900)]
[layer] lstmcell minor optimize

Minor optimization for lstmcell to skip a redundant multiply.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[tensor] Optimize element wise operator functions
Parichay Kapoor [Thu, 28 Oct 2021 08:03:02 +0000 (17:03 +0900)]
[tensor] Optimize element wise operator functions

This patch optimizes element-wise operator functions for multiply,
divide, add and subtract by using std::transform than regular loop when
the stride along the last dimension is 1.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[tensor] Support adding result to output with multiply
Parichay Kapoor [Thu, 28 Oct 2021 06:14:31 +0000 (15:14 +0900)]
[tensor] Support adding result to output with multiply

Support adding result to output with multiply to fuse multiply and add
operations for LSTMcell.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Profiler] Add listener total time and percent
Jihoon Lee [Thu, 28 Oct 2021 04:42:30 +0000 (13:42 +0900)]
[Profiler] Add listener total time and percent

This patch add listener total time and percent mechanism

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[tensor] Optimize tensor apply and multiply_strided
Parichay Kapoor [Thu, 28 Oct 2021 05:15:40 +0000 (14:15 +0900)]
[tensor] Optimize tensor apply and multiply_strided

Optimize multiply_strided and apply to use std::transform to get the best
performance, and possibility to use par_unseq for later parallelization.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Performance optimizations to LSTMCell
Parichay Kapoor [Wed, 27 Oct 2021 11:54:45 +0000 (20:54 +0900)]
[layer] Performance optimizations to LSTMCell

Add minor performance optimizations to LSTMCell.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[tensor] Add beta for tensor sum
Parichay Kapoor [Wed, 27 Oct 2021 11:36:01 +0000 (20:36 +0900)]
[tensor] Add beta for tensor sum

Add beta for tensor to enable addition to existing tensor while summing.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[API/trivial] Add LSTMCell creator
Jihoon Lee [Wed, 27 Oct 2021 02:59:03 +0000 (11:59 +0900)]
[API/trivial] Add LSTMCell creator

This patch add lstm cell creator

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[layer] override setBatch in bn layer
hyeonseok lee [Tue, 26 Oct 2021 08:44:17 +0000 (17:44 +0900)]
[layer] override setBatch in bn layer

 - Override setBatch function

Self evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
2 years ago[layer] LSTM cell batchresize bug fix
Parichay Kapoor [Tue, 26 Oct 2021 07:06:11 +0000 (16:06 +0900)]
[layer] LSTM cell batchresize bug fix

As LSTM cell uses the batch values not in the batch dimension but in the
inner dimension, it creates bug with the existing layer context interface
as it only allows updating the batch along the batch dimension.
This patch provides a quick fix to combine the time and batch values in
the batch dimension.

Once recurrent realizer allows multiple inputs, the time factor will be
removed and the reshapes can be removed.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Optimization for LSTM cell
Parichay Kapoor [Tue, 26 Oct 2021 06:31:20 +0000 (15:31 +0900)]
[layer] Optimization for LSTM cell

Optimization for LSTM cell to combine the activation function running on
the values.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Android] Add missing fopenmp
Jihoon Lee [Tue, 26 Oct 2021 01:18:29 +0000 (10:18 +0900)]
[Android] Add missing fopenmp

This patch add missing fopenmp.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Android] Enable test for the android build
Jihoon Lee [Fri, 22 Oct 2021 14:41:02 +0000 (23:41 +0900)]
[Android] Enable test for the android build

This patch enable android build, this abling this option has an issue

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Android] Unlink ml-api-inference module
Jihoon Lee [Fri, 22 Oct 2021 13:17:25 +0000 (22:17 +0900)]
[Android] Unlink ml-api-inference module

This patch unlink ml-api-inference module as it requires gstreamer

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Fix/pkgconfig] Fix nntrainer include dir
Jihoon Lee [Tue, 26 Oct 2021 05:19:15 +0000 (14:19 +0900)]
[Fix/pkgconfig] Fix nntrainer include dir

This patch fixes pkg config nntrainer include directory for the pkg.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[LSTMCELL] Fix compile error
Jihoon Lee [Tue, 26 Oct 2021 01:22:03 +0000 (10:22 +0900)]
[LSTMCELL] Fix compile error

This patch fix compile error in the main branch

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[layer] Bug fix for LSTMCell
Parichay Kapoor [Mon, 25 Oct 2021 01:29:50 +0000 (10:29 +0900)]
[layer] Bug fix for LSTMCell

Enable recurrent unrolling tests for LSTMCell with a single and stacked
LSTM cell. Add corresponding bug fixes.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[layer] Add first draft of lstm cell
Parichay Kapoor [Sat, 23 Oct 2021 13:18:51 +0000 (22:18 +0900)]
[layer] Add first draft of lstm cell

This patch adds the first draft of lstm cell. This has certain
advantages over the existing LSTM when executing for single timestep:
- does not need to divide the data over smaller chunks for computation.
This saves the overhead of creating tensors, an extra loop and combines
computation to a single call for efficiency.
- some of the operations have been avoided based on the current timestep
(which were zeros).
More optimizatios will be coming soon for LSTM cell.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[tensor] Add support for strided operators
Parichay Kapoor [Sat, 23 Oct 2021 13:16:21 +0000 (22:16 +0900)]
[tensor] Add support for strided operators

This patch adds support for strided multiply, apply and getSharedDataTensor
operations for tesnor.
Later these will be optimized direct data access with an iterator.

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
2 years ago[Android] disable nnstreamer layer
Jihoon Lee [Fri, 22 Oct 2021 12:22:53 +0000 (21:22 +0900)]
[Android] disable nnstreamer layer

This patch disables nnstreamer backbone because of the package issue for
android build

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Clean] remove enable-android option
Jihoon Lee [Fri, 22 Oct 2021 10:24:15 +0000 (19:24 +0900)]
[Clean] remove enable-android option

This patch remove enable-android for brevity

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Android] Add prebuilt android for the built library
Jihoon Lee [Fri, 22 Oct 2021 10:22:51 +0000 (19:22 +0900)]
[Android] Add prebuilt android for the built library

This patch provides prebuilt android when making android zip file

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Android] Add simple package script
Jihoon Lee [Fri, 22 Oct 2021 10:11:07 +0000 (19:11 +0900)]
[Android] Add simple package script

This patch adds android simple package script to make tar.gz

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
2 years ago[Fix] fix bug for install_headers
Jihoon Lee [Fri, 22 Oct 2021 10:10:17 +0000 (19:10 +0900)]
[Fix] fix bug for install_headers

Fix bug that install_headers install_dir overrides subdir props.
This is undocumented behavior so changed to make it to be deterministic

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>