platform/core/ml/nnfw.git
5 years ago[enco] Reduce Identical Objects with free instructions (#2505)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 5 Dec 2018 23:38:32 +0000 (08:38 +0900)]
[enco] Reduce Identical Objects with free instructions (#2505)

The current implementation of Reduce Identical Objects pass does not
work correctly in the presence of free instructions.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[nnc] Fix reduceOp reduction dimensions handling (#2494)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Wed, 5 Dec 2018 19:41:36 +0000 (22:41 +0300)]
[nnc] Fix reduceOp reduction dimensions handling (#2494)

- fix shape inference
- fix interpreter index computation

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc] Support for asymmetric strides in Pool, Conv2D, DepthwiseConv2D operations...
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 5 Dec 2018 17:02:39 +0000 (20:02 +0300)]
[nnc] Support for asymmetric strides in Pool, Conv2D, DepthwiseConv2D operations (#2460)

* Add support for asymmetric strides to Pool, Conv2D, DepthwiseConv2D operations;
* Refactor convolution and pooling parameter computation in Caffe importer.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[nnc] Replace zero-dim tensors with tensor of shape {1} (#2513)
Vladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 5 Dec 2018 15:00:20 +0000 (18:00 +0300)]
[nnc] Replace zero-dim tensors with tensor of shape {1} (#2513)

Fixes multiple issues involving zero-dimension tensors. Includes Bias, Scale, Reduce and Elementwise operations

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
5 years ago[nnc] Use Transpose operation in Caffe importer (#2468)
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 5 Dec 2018 12:47:37 +0000 (15:47 +0300)]
[nnc] Use Transpose operation in Caffe importer (#2468)

Use Transpose operation in Caffe importer to switch between Caffe NCHW and ModelIR NHWC formats.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[tfldump] Prepare dump Operator options (#2503)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 5 Dec 2018 08:28:18 +0000 (17:28 +0900)]
[tfldump] Prepare dump Operator options (#2503)

This will add DumpOpRegistry and DumpOp to dump Operator options(properties)

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tfldump] fix clang warning (#2507)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 5 Dec 2018 08:28:03 +0000 (17:28 +0900)]
[tfldump] fix clang warning (#2507)

This will fix clang compile warning with '-Wlogical-op-parentheses'

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tfldump] fix int to int32_t (#2509)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 5 Dec 2018 08:27:51 +0000 (17:27 +0900)]
[tfldump] fix int to int32_t (#2509)

This will fix type int to int32_t to distinghish exact type

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco] Use "destroy_all" in coco (#2501)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 5 Dec 2018 04:50:50 +0000 (13:50 +0900)]
[enco] Use "destroy_all" in coco (#2501)

The current implementation of Free Op Elimination pass uses its own
destroy function, but OpManager now provides "destroy_all" method which
has exactly same functionality.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] Dump operators (#2497)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 5 Dec 2018 04:14:48 +0000 (13:14 +0900)]
[tfldump] Dump operators (#2497)

* [tfldump] Dump operators

This will add part to Dump Operators and related functions

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* use int32_t

5 years ago[enco] Introduce extended coco IR (#2496)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 5 Dec 2018 04:12:09 +0000 (13:12 +0900)]
[enco] Introduce extended coco IR (#2496)

This commit introduces a placeholder for extended coco IR entities. The
current implementation includes only one extended instruction (ANNDepthConcatF).

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[coco] Introduce OpManager::destroy_all (#2498)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 5 Dec 2018 03:41:26 +0000 (12:41 +0900)]
[coco] Introduce OpManager::destroy_all (#2498)

With this commit, OpManager now allows users to destroy a Op tree via
destroy_all method.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] dump operand quantization (#2495)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 5 Dec 2018 03:39:38 +0000 (12:39 +0900)]
[tfldump] dump operand quantization (#2495)

* [tfldump] dump operand quantization

This will add dump to dump operand quantization information.
For this, add dump of flatbuffers::Vector type.

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* remove unused

5 years ago[enco/tfl] Introduce Regression_0002 testcase (#2492)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 5 Dec 2018 00:51:07 +0000 (09:51 +0900)]
[enco/tfl] Introduce Regression_0002 testcase (#2492)

This commit introduces Regression_0002 case which tests the
correctness of dead code elimination optimizations.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[enco] Free Op Elimination (#2491)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 10:35:34 +0000 (19:35 +0900)]
[enco] Free Op Elimination (#2491)

* [enco] Free Op Elimination

This commit introduces Free Op Elimination pass (and a related test) to
enco pipeline.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Use consistent testcase name

5 years ago[coco] Introduce root helper (#2489)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 09:44:07 +0000 (18:44 +0900)]
[coco] Introduce root helper (#2489)

This commit introduces root helper which allows users to easily access the
root Op for a given Op.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] Dump operands(tensors) (#2486)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 4 Dec 2018 09:01:01 +0000 (18:01 +0900)]
[tfldump] Dump operands(tensors) (#2486)

This will add operands and it's properties
- tensors live in subgraph, subgraph selector is also introduced

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[coco] Generalize isa<T> and safe_cast<T> (#2490)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 08:58:46 +0000 (17:58 +0900)]
[coco] Generalize isa<T> and safe_cast<T> (#2490)

With this commit, isa<T> and safe_cast<T> correctly works even in the
presence of "unknown" derived classes.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[enco] Free Instr Elimination (#2487)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 08:17:24 +0000 (17:17 +0900)]
[enco] Free Instr Elimination (#2487)

This commit implements Free Instr Elimination pass (and a related test) in enco backend.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[coco] Remove cast<T> helper (#2482)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 07:48:15 +0000 (16:48 +0900)]
[coco] Remove cast<T> helper (#2482)

It is impossible to implement general cast<T> helper under open Instr
class hierarchy.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[stdex] Introduce Queue.h (#2484)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 07:48:06 +0000 (16:48 +0900)]
[stdex] Introduce Queue.h (#2484)

This commit introduces Queue.h which will hold various utilities for
std::queue<T>.

The current implementation includes only one helper: 'take'.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] Dump buffers (#2480)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 4 Dec 2018 07:10:43 +0000 (16:10 +0900)]
[tfldump] Dump buffers (#2480)

This will add dump buffers to Dump

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[coco] Remove Instr mutator interface (#2476)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 06:35:43 +0000 (15:35 +0900)]
[coco] Remove Instr mutator interface (#2476)

This mutator interface was introduced when Instr has closed hierarchy,
and thus it is no longer valid as Instr now support open hierarchy.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] Add Reader with OpCode reader (#2475)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 4 Dec 2018 04:42:20 +0000 (13:42 +0900)]
[tfldump] Add Reader with OpCode reader (#2475)

* [tfldump] Add Reader with OpCode reader

This will introduce Reader class that holds OpCodes
Dump will dump operator codes that are used in the Model

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* opcode_name as a function

* move TFliteSubGraphs_t inside class

* show number legend

* add some more

5 years ago[coco] Support Custom Instr Construction via InstrManager (#2474)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 4 Dec 2018 03:37:33 +0000 (12:37 +0900)]
[coco] Support Custom Instr Construction via InstrManager (#2474)

With this commit, users are able to construct a custom instr object
through InstrManager.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tfldump] Empty tflite Model dump (#2466)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 4 Dec 2018 01:36:51 +0000 (10:36 +0900)]
[tfldump] Empty tflite Model dump (#2466)

This will introduce empty tflite::Model dump as a place holder

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[nnc] MeanSoftBackend (#2367)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Mon, 3 Dec 2018 17:38:21 +0000 (20:38 +0300)]
[nnc] MeanSoftBackend (#2367)

This adds Support for reduction with Mean to C++ soft backend.
The implementation is a reference one from TFLite.

Signed-off-by: Andrei Shedko <a.shedko@partner.samsung.com>
5 years ago[nnc] Support non-unit batch in deconv (#2471)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Mon, 3 Dec 2018 17:03:56 +0000 (20:03 +0300)]
[nnc] Support non-unit batch in deconv (#2471)

Added support of Batch dimension in Deconv operation
* shape inference
* interpreter
* c++ softBackend

Signed-off-by: Andrei Shedko <a.shedko@partner.samsung.com>
5 years ago[nnc] Fix pool operation round mode (#2470)
Павел Ильютченко/AI Tools Lab /SRR/Engineer/삼성전자 [Mon, 3 Dec 2018 16:05:35 +0000 (19:05 +0300)]
[nnc] Fix pool operation round mode (#2470)

* Add round mode to Pool operations for each framework
* Fix output shape for pooling operation
* Fix strides on Pool op shape inference

Signed-off-by: Pavel Iliutchenko <p.iliutchenk@samsung.com>
5 years ago[nnc] Implementation of Transpose operation (#2464)
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Mon, 3 Dec 2018 11:05:51 +0000 (14:05 +0300)]
[nnc] Implementation of Transpose operation (#2464)

* Add `Transpose` operation to ModelIR;
* Support `Transpose` operation in interpreter and soft backend.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[tfldump] Load tflite file (#2465)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 3 Dec 2018 07:25:21 +0000 (16:25 +0900)]
[tfldump] Load tflite file (#2465)

This will add tflite loader part of tfldump

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tfldump] Add tflite schema flatbuffers (#2445)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 3 Dec 2018 02:20:42 +0000 (11:20 +0900)]
[tfldump] Add tflite schema flatbuffers (#2445)

* [tfldump] Add tflite schema flatbuffers

This will add tflite schema and flatbuffers converter to generate the header
Empty Model.h is added to check the build

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* cmake changes

* rename files

* another rename

5 years ago[nnc] Set operations names based on layer names in Caffe importer (#2463)
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Fri, 30 Nov 2018 19:37:40 +0000 (22:37 +0300)]
[nnc] Set operations names based on layer names in Caffe importer (#2463)

Refactor Caffe importer to set Operation names based on layer names (previously names were set based on output blob names).

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[nnc] Support batch axis in acl backend (#2462)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Fri, 30 Nov 2018 17:36:50 +0000 (20:36 +0300)]
[nnc] Support batch axis in acl backend (#2462)

- Support batch axis
- Add more checks on supported data formats
- Add assert in transposeShape and related fixes

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc] Utility to generate input tensors (#2143)
Тимур Отеллович Аблязимов/AI Tools Lab /SRR/Staff Engineer/삼성전자 [Fri, 30 Nov 2018 13:57:27 +0000 (16:57 +0300)]
[nnc] Utility to generate input tensors (#2143)

Implemented utility that generates input data in the hdf5 format.

Signed-off-by: Timur Ablyazimov <t.ablyazimov@samsung.com>
5 years ago[nnc][utils] TFLIte model generator. Add operations. (#2383)
Иван Иванович Кулагин/AI Tools Lab /SRR/Engineer/삼성전자 [Fri, 30 Nov 2018 13:08:26 +0000 (16:08 +0300)]
[nnc][utils] TFLIte model generator. Add operations. (#2383)

Add support of generating nodes with several random
inputs which are consistent by tensor's shape.

Add operations:
 - DepthwiseConv2D
 - MaxPool/AvgPool
 - Softmax
 - fullyConnected

Signed-off-by: i-kulagin <i.kulagin@samsung.com>
5 years ago[nnc] Remove redundant CLCopy layer from inference sequence (#2449)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Fri, 30 Nov 2018 12:42:48 +0000 (15:42 +0300)]
[nnc] Remove redundant CLCopy layer from inference sequence (#2449)

Remove buggy CLCopy layer from inference, since it is not needed, and corrupts data

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc] Support asimmetrical paddings in tflite models in ACL backend (#2447)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Fri, 30 Nov 2018 12:38:50 +0000 (15:38 +0300)]
[nnc] Support asimmetrical paddings in tflite models in ACL backend (#2447)

Inference asimmetrical paddings for "Same" padding type on acl backend

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc] Fix special case of bias layer after fc layer in ACL backend (#2448)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Fri, 30 Nov 2018 12:24:54 +0000 (15:24 +0300)]
[nnc] Fix special case of bias layer after fc layer in ACL backend (#2448)

Handle shape of bias weights with respect to previous operation.
Need to use different shape for operations after fully connected layer,
because it restores batch dimension in output tensor

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc] Fix importer test (#2457)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Fri, 30 Nov 2018 12:09:04 +0000 (15:09 +0300)]
[nnc] Fix importer test (#2457)

Fixed exit code in importer test, added a version check so that the test
is not run on older TF

Signed-off-by: Andrei Shedko <a.shedko@partner.samsung.com>
5 years ago[nnc] Support Pad operation on soft backend (#2364)
Павел Ильютченко/AI Tools Lab /SRR/Engineer/삼성전자 [Fri, 30 Nov 2018 10:25:13 +0000 (13:25 +0300)]
[nnc] Support Pad operation on soft backend (#2364)

* Add serialization on softbackend
* Add deserialization on softbackend
* Add cpp_pad snippet

Signed-off-by: Pavel Iliutchenko <p.iliutchenk@samsung.com>
5 years ago[enco/tfl] Validate stride (#2455)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Fri, 30 Nov 2018 08:19:59 +0000 (17:19 +0900)]
[enco/tfl] Validate stride (#2455)

This commit introduces basic tfl model validation infrastructure to tfl
frontend.

The current implementation supports 'stride' validation for the following
operations:
 - Conv2D
 - DepthwiseConv2D
 - MaxPool2D
 - AveragePool2D

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[encodump] Fix a bug not generating comma (#2421)
박천교/동작제어Lab(SR)/Engineer/삼성전자 [Fri, 30 Nov 2018 04:35:08 +0000 (13:35 +0900)]
[encodump] Fix a bug not generating comma (#2421)

Now generating comma separated list output for size more than 1.

Signed-off-by: Cheongyo Bahk <ch.bahk@samsung.com>
5 years ago[tflchef] Store op codes only once (#2401)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 30 Nov 2018 02:11:15 +0000 (11:11 +0900)]
[tflchef] Store op codes only once (#2401)

* [tflchef] Store op codes only once

This will change tflchef to store operator codes only once in the table

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* apply comments

5 years ago[nnc] Perform shape inference at construction time (#2399)
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Thu, 29 Nov 2018 13:42:35 +0000 (16:42 +0300)]
[nnc] Perform shape inference at construction time (#2399)

* Move shape inference functionality from separate class to constructors of individual operations;
* First dimension of input is no longer removed by the importers;
* Adjust ModelIR, soft backend and interpreter to correctly work with non-stripped first dimension;
* Minor coding style fixes and comments.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[nnc] Added reducemean to modelir (#2234)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Thu, 29 Nov 2018 11:43:29 +0000 (14:43 +0300)]
[nnc] Added reducemean to modelir (#2234)

- Added ReduceMean to ModelIR (Mean in tflite, not present in caffe)
The functionality allows one to support other reduction operations
rather effortlessly (in interpreter).

- Added tests for shape Inference.

Signed-off-by: Andrei Shedko <a.shedko@partner.samsung.com>
5 years ago[nnc] ConstantOp, shape inference, model analyze, serialize, first artifact initial...
Андрей Тищенко/AI Tools Lab /SRR/Staff Engineer/삼성전자 [Thu, 29 Nov 2018 10:49:30 +0000 (13:49 +0300)]
[nnc] ConstantOp, shape inference, model analyze, serialize, first artifact initial versions were implemented. (#2394)

New ConstantOp was added: at the moment it's used for input constant tensors like weights, etc.
Shape inference, model analyzing, etc, are working enough to be able to create the first artifact.

Signed-off-by: Andrew V. Tischenko <a.tischenko@partner.samsung.com>
5 years ago[nnc] Make Mobile and Inception-v3 working (#2416)
Тимур Отеллович Аблязимов/AI Tools Lab /SRR/Staff Engineer/삼성전자 [Thu, 29 Nov 2018 10:21:08 +0000 (13:21 +0300)]
[nnc] Make Mobile and Inception-v3 working (#2416)

These commit starts a sequence of commits introducing the debugged version of the ACL backend operations used in the Mobilenet and Inception-v3 networks.

Signed-off-by: Timur Ablyazimov <t.ablyazimov@samsung.com>
5 years ago[tfldump] Tool to dump TFlite file (#2444)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 29 Nov 2018 06:12:59 +0000 (15:12 +0900)]
[tfldump] Tool to dump TFlite file (#2444)

This will introduce empty project for tfldump tool to dump TFlite file to console in text form.

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco/tfl/frontend] Creation of context ob outside of loop (#2442)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 29 Nov 2018 05:50:41 +0000 (14:50 +0900)]
[enco/tfl/frontend] Creation of context ob outside of loop (#2442)

This commit moves creation of context ob outside of loop.
(putting creation code inside loop creates same object over and over)

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[enco] Support constant folding (#2441)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Thu, 29 Nov 2018 05:25:48 +0000 (14:25 +0900)]
[enco] Support constant folding (#2441)

This commit introduces constant folding pass into the enco compilation
pipeline.

Note that the current implementation supports folding over "copy"
instruction only.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[enco] Properly insert setOperandValue calls (#2439)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Thu, 29 Nov 2018 01:30:05 +0000 (10:30 +0900)]
[enco] Properly insert setOperandValue calls (#2439)

With the current implementation, it is possible that some setOperandValue
calls are missing during ANN IR construction.

With this commit, enco now inserts setOperandValue call for every operand
with constant weight.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[nnc] Add Resize Nearest Neighbor (#2315)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Wed, 28 Nov 2018 15:13:26 +0000 (18:13 +0300)]
[nnc] Add Resize Nearest Neighbor (#2315)

Added Resize Nearest Neighbor to tflite importer and interpreter.
Added shape inference tests some cases.

The op allows adding more resize types by just adding new values to the enum and backends.
The corresponding Op in ONNX is Upsample and it can be supported without modifications

Signed-off-by: Andrei Shedko <a.shedko@partner.samsung.com>
5 years agoAdd Test Round 2.1 in System Test Document (#2329)
Роман Михайлович Русяев/AI Tools Lab /SRR/Staff Engineer/삼성전자 [Wed, 28 Nov 2018 14:49:10 +0000 (17:49 +0300)]
Add Test Round 2.1 in System Test Document (#2329)

* added tests for Tizen and SmartMachine OS

Signed-off-by: Roman Rusyaev <r.rusyaev@samsung.com>
5 years ago[nnc] Remove redundant interpreter options (#2425)
Vladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 28 Nov 2018 14:14:24 +0000 (17:14 +0300)]
[nnc] Remove redundant interpreter options (#2425)

- Remove cli options for input/output node, which are used only in interpreter
- fix code style in interpreter_pass.cpp

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
5 years ago[enco/tfl/frontend] change names : `conv..` to `dconv...` (#2431)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 28 Nov 2018 04:48:28 +0000 (13:48 +0900)]
[enco/tfl/frontend] change names : `conv..` to `dconv...` (#2431)

By refactoring, names with `conv...` was changed to `dconv...`.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[enco/tfl/frontend] test for DepthwiseConv2D for mobilenet (#2428)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 28 Nov 2018 04:25:06 +0000 (13:25 +0900)]
[enco/tfl/frontend] test for DepthwiseConv2D for mobilenet (#2428)

Test case for IFM width = 2 * OFM width, IFM height = 2 * OFM height, SAME padding, stride 2

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[enco/tfl/frontend] DepthwiseConv2D (same padding, ifm h=ofm h, ifm w=ofm w) (#2391)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 28 Nov 2018 03:45:35 +0000 (12:45 +0900)]
[enco/tfl/frontend] DepthwiseConv2D (same padding, ifm h=ofm h, ifm w=ofm w) (#2391)

* [enco/tfl/frontend] DepthwiseConv2D

DepthwiseConv2D for enco tflite frontend. Tested with stride=[1,1]

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* pr fix: enter

* pr fix: removed swap, renaming some value, added asserts

* pr fix: Replaced "comment" with "#"

* pr fix: Fix unefficient declaration of new_shape

5 years ago[enco] Delegate Concat to NN runtime (#2426)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Wed, 28 Nov 2018 03:43:49 +0000 (12:43 +0900)]
[enco] Delegate Concat to NN runtime (#2426)

With this commit, enco backend delegates ConcatF to NN runtime
instead of lowering it as a sequence of Shuffle.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
5 years ago[tflchef] Replace test files with cmake file GLOB (#2380)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 28 Nov 2018 00:19:00 +0000 (09:19 +0900)]
[tflchef] Replace test files with cmake file GLOB (#2380)

This will replace individual test list preparation with file GLOB

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef/rev] support quantization (#2402)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 27 Nov 2018 06:00:18 +0000 (15:00 +0900)]
[tflchef/rev] support quantization (#2402)

* [tflchef/rev] support quantization

This will enable reading quantization from tflite and store to tflchef

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* remove space

* add note

* fix typo

* remove invalid '> 0'

5 years ago[tflchef] Support quantization parameters (#2379)
남궁석/동작제어Lab(SR)/Engineer/삼성전자 [Tue, 27 Nov 2018 04:07:22 +0000 (13:07 +0900)]
[tflchef] Support quantization parameters (#2379)

* [tflchef] Support quantization parameters

This commit will introduce quantization parameters and add related tests

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
* modify convention and data

5 years ago[tflchef/rev] Write reshape explicit values (#2418)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 27 Nov 2018 04:05:44 +0000 (13:05 +0900)]
[tflchef/rev] Write reshape explicit values (#2418)

This will change tflchef-reverse to provide explicit values of shape information for the operand used by reshape operator

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco/tfl/frontend] Padding when top == bottom -1 or left = right-1 (#2411)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Tue, 27 Nov 2018 02:40:08 +0000 (11:40 +0900)]
[enco/tfl/frontend] Padding when top == bottom -1 or left = right-1 (#2411)

* [enco/tfl/frontend] Padding when top == bottom -1 or left = right-1

get_padding() now calculates padding when top == bottom -1 or left = right-1

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* pr fix: calculate -> compute, ifm -> in_size

5 years ago[enco] Do NOT reduce identical objects with side effect (#2419)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Tue, 27 Nov 2018 02:35:44 +0000 (11:35 +0900)]
[enco] Do NOT reduce identical objects with side effect (#2419)

* [enco] Do NOT reduce identical objects with side effect

Update on one object may have a side effect through its backing bag. So,
reduction in identical objects with side effect results in incorrect
compilation artifact.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Update the examples in the comment

5 years ago[tflchef] Remove "comment" attribute (#2412)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 26 Nov 2018 23:51:06 +0000 (08:51 +0900)]
[tflchef] Remove "comment" attribute (#2412)

"comment" is removed since "#" is comment in protobuffer schema.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years agoDownload pytorch sources on cmake stage (#2288)
Ivan Vagin/AI Tools Lab /SRR/Engineer/삼성전자 [Mon, 26 Nov 2018 23:46:11 +0000 (02:46 +0300)]
Download pytorch sources on cmake stage (#2288)

Download pytorch sources on cmake stage

Signed-off-by: Ivan Vagin <ivan.vagin@samsung.com>
5 years ago[enco] Replaced "comment" to "#" in tfl test recipes (#2403)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 26 Nov 2018 09:53:22 +0000 (18:53 +0900)]
[enco] Replaced "comment" to "#" in tfl test recipes (#2403)

By this commit, "comment" field in tfl test recipes was replaced to "#"

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[tflchef] Support explicit initialization over INT32 tensors (#2408)
박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 [Mon, 26 Nov 2018 09:46:24 +0000 (18:46 +0900)]
[tflchef] Support explicit initialization over INT32 tensors (#2408)

* [tflchef] Support explicit initialization over INT32 tensors

This commit introduces 'explicit' filler which allows users to
explicitly specifies the values of operands.

Currently, 'explicit' filler is available for INT32 types.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Use -1 as a new_shape parameter

5 years ago[encodump] Prints address of coco::op or coco::instr (#2396)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 26 Nov 2018 02:10:32 +0000 (11:10 +0900)]
[encodump] Prints address of coco::op or coco::instr (#2396)

Previously, running encodump to print Copy prints addr of coco::Producer. Now prints coco::Instr. This applied to many ops and insts.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[encodump] Added ReLU6 (#2395)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Mon, 26 Nov 2018 01:36:15 +0000 (10:36 +0900)]
[encodump] Added ReLU6 (#2395)

Withi this commit, encodump prints information about Relu6.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[nnc] Implement elementwise div operation (#2363)
Vladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 [Fri, 23 Nov 2018 18:36:58 +0000 (21:36 +0300)]
[nnc] Implement elementwise div operation (#2363)

Added support of div elementwise:
- in tflite importer
- in interpreter
- in soft backend using Eigen

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
5 years ago[nnc] Add support for freestanding activation functions in tflite importer (#2385)
Vladimir Plazun/AI Tools Lab /SRR/Engineer/삼성전자 [Fri, 23 Nov 2018 17:53:52 +0000 (20:53 +0300)]
[nnc] Add support for freestanding activation functions in tflite importer  (#2385)

While tflite have fused activation functions, some networks use activation functions as separate operations

Signed-off-by: Vladimir Plazun <v.plazun@partner.samsung.com>
5 years ago[tflchef/reverse] Enable INT32 type (#2393)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 08:01:07 +0000 (17:01 +0900)]
[tflchef/reverse] Enable INT32 type (#2393)

This will enable tflchef-reverse to handle INT32 type
- Needed to handle Reshape operator from MobileNet

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Update depthwiseconv2d recipe (use relu6 activation) (#2322)
이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 04:07:20 +0000 (13:07 +0900)]
[tflchef] Update depthwiseconv2d recipe (use relu6 activation) (#2322)

depthwiseconv2d recipe will use relu6 activation.
- Mobilenet uses relu6 activation.
- It could be used as a test for relu6 activation.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
5 years ago[tflchef] Support int32 tensortype (#2388)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 04:06:01 +0000 (13:06 +0900)]
[tflchef] Support int32 tensortype (#2388)

This will fix to support int32 tensortype with introducing as_tflite_tensortype()

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] enable ReLU6 conversion (#2381)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 01:37:19 +0000 (10:37 +0900)]
[tflchef] enable ReLU6 conversion (#2381)

This will enable ReLU6 in as_tflchef_activation()

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco/frontend] Empty DepthwiseConv2D (#2387)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 01:36:42 +0000 (10:36 +0900)]
[enco/frontend] Empty DepthwiseConv2D (#2387)

This will add placeholder for DepthwiseConv2D in frontend
- to check loading mobilenet slim model

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco/tfl/frontend] ReLU6 Activation Layer (#2359)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Fri, 23 Nov 2018 01:04:38 +0000 (10:04 +0900)]
[enco/tfl/frontend] ReLU6 Activation Layer (#2359)

* [enco/tfl/frontend] ReLU6 Activation Layer

This commit is for ReLU6 Activation Layer.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* Pr fix: add code to op/Activation.cpp

5 years ago[nnc] Support Pad operation on TFLite Importer and Interpreter (#2330)
Павел Ильютченко/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Thu, 22 Nov 2018 11:30:58 +0000 (14:30 +0300)]
[nnc] Support Pad operation on TFLite Importer and Interpreter (#2330)

* Support Pad op in TFLite imported and interpreter

Signed-off-by: Pavel Iliutchenko <p.iliutchenk@partner.samsung.com>
5 years ago[tflchef] Add DepthwiseConv2D for reverse (#2373)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 08:20:04 +0000 (17:20 +0900)]
[tflchef] Add DepthwiseConv2D for reverse (#2373)

This will add DepthwiseConv2D Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Add Conv2D for reverse (#2375)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 07:59:01 +0000 (16:59 +0900)]
[tflchef] Add Conv2D for reverse (#2375)

* [tflchef] Add Conv2D for reverse

This will add Conv2D Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* add comment

5 years ago[tflchef] Add MaxPool2D for reverse (#2376)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 07:48:01 +0000 (16:48 +0900)]
[tflchef] Add MaxPool2D for reverse (#2376)

This will add MaxPool2D Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Add ReLU6 for reverse (#2374)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 07:46:43 +0000 (16:46 +0900)]
[tflchef] Add ReLU6 for reverse (#2374)

This will add ReLU6 Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Add ReLU for reverse (#2377)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 05:58:55 +0000 (14:58 +0900)]
[tflchef] Add ReLU for reverse (#2377)

This will add ReLU Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Add Concat for reverse (#2370)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 05:19:21 +0000 (14:19 +0900)]
[tflchef] Add Concat for reverse (#2370)

This will add Concatenation Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Add Reshape for reverse (#2371)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 05:12:23 +0000 (14:12 +0900)]
[tflchef] Add Reshape for reverse (#2371)

This will add Reshape Op for tflchef-reverse

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[enco] Splitting Frontend.cpp into Op/*.cpp and more (#2362)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 05:08:03 +0000 (14:08 +0900)]
[enco] Splitting Frontend.cpp into Op/*.cpp and more (#2362)

* [enco] Splitting Frontend.cpp into Op/*.cpp and more

Through this commit, Frontend.cpp will be refactored into several files.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* pr fix: remove useless "tflite::"

* pr fix: Split h file into h and cpp file

* pr fix: remove wrong test files

5 years ago[tflchef] Fix FlatBufferIntArrayToVector (#2369)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 01:33:51 +0000 (10:33 +0900)]
[tflchef] Fix FlatBufferIntArrayToVector (#2369)

* [tflchef] Fix FlatBufferIntArrayToVector

This will rename FlatBufferIntArrayToVector to as_index_vector like enco/frontend and correct type of caller
- incorrect type may cause a problem in reading minus values in shape info

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* fix to typename

5 years ago[tflchef] Prepare adding Ops with AveragePool2D (#2368)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Thu, 22 Nov 2018 01:33:22 +0000 (10:33 +0900)]
[tflchef] Prepare adding Ops with AveragePool2D (#2368)

This will add AveragePool2D operator handler and needed changes to test.
Also place holders for other operators to prevent merge conflict.

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] generate_recipe for each operators (#2361)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 21 Nov 2018 22:18:40 +0000 (07:18 +0900)]
[tflchef] generate_recipe for each operators (#2361)

This will fill handlers for each operators
- forward filler settings for the operator
- tflchef operator build and I/O settings for corresponding tflite operator

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[nnc] Fix deconv unittest build (#2366)
Efimov Alexander/AI Tools Lab/./Samsung Electronics [Wed, 21 Nov 2018 19:10:05 +0000 (22:10 +0300)]
[nnc] Fix deconv unittest build (#2366)

Fix deconv unit test build and adjust float epsilon

Signed-off-by: Efimov Alexander <a.efimov@samsung.com>
5 years ago[nnc][utils][model_generator] Add converter from tree to tflite. (#2230)
Иван Иванович Кулагин/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 21 Nov 2018 18:19:24 +0000 (21:19 +0300)]
[nnc][utils][model_generator] Add converter from tree to tflite. (#2230)

Implemented converter from randomly generated Tree representation to TFLite model.

Signed-off-by: i-kulagin i.kulagin@samsung.com
5 years ago[nnc] Initial support of various operations in ONNX frontend (#2286)
Андрей Тищенко/AI Tools Lab /SRR/Staff Engineer/삼성전자 [Wed, 21 Nov 2018 18:04:58 +0000 (21:04 +0300)]
[nnc] Initial support of various operations in ONNX frontend (#2286)

Operations supported in ONNX importer:
- Conv2d
- BatchNorm
- Pool
- scale
- dropout
- Elementwise operations (add, sum, mul, max)
- Gemm

Signed-off-by: Andrew V. Tischenko <a.tischenko@partner.samsung.com>
5 years ago[nnc] Conv transpose in SoftBackend (#2290)
Андрей Шедько/AI Tools Lab /SRR/Assistant Engineer/삼성전자 [Wed, 21 Nov 2018 17:42:29 +0000 (20:42 +0300)]
[nnc] Conv transpose in SoftBackend (#2290)

Implements Deconvolution in Soft Backend, caffe style transfer model is fully supported.

Signed-off-by: Andrei Shedko a.shedko@partner.samsung.com
5 years ago[nnc] Add `shape` parameter to constructors of operations that cannot infer shapes...
Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 [Wed, 21 Nov 2018 16:23:36 +0000 (19:23 +0300)]
[nnc] Add `shape` parameter to constructors of operations that cannot infer shapes of their outputs (#2338)

* Add `shape` parameter to constructor of `VariableOp`;
* Add `shape` parameter to constructor of `ReshapeOp`.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
5 years ago[tflchef] Implement generate_recipe (#2360)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 21 Nov 2018 10:31:57 +0000 (19:31 +0900)]
[tflchef] Implement generate_recipe (#2360)

* [tflchef] Implement generate_recipe

This implements partial of generate_recipe() for operators, operands and inputs,outputs.

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* remove unused

* reorder a line

* fix typo

* need check quantization

* fix typo

5 years ago[tflchef] Introduce TFliteOpChef and Registry (#2357)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 21 Nov 2018 10:25:15 +0000 (19:25 +0900)]
[tflchef] Introduce TFliteOpChef and Registry (#2357)

This will introduce TFliteOpChef base class for Operator handlers for translation and
TFliteOpRegistry for registeration of handlers.
All headers are included in RecipeChef to check compilation and as it will be used later codes.

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
5 years ago[tflchef] Adds "comment" into recipe (#2356)
윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 21 Nov 2018 09:51:18 +0000 (18:51 +0900)]
[tflchef] Adds "comment" into recipe (#2356)

Now, recipe file can have "comment" field, which is ignored by tflchef.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
5 years ago[tflchef] Introduce TFliteImport (#2355)
박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 [Wed, 21 Nov 2018 08:15:16 +0000 (17:15 +0900)]
[tflchef] Introduce TFliteImport (#2355)

* [tflchef] Introduce TFliteImport

This will introduce TFliteImport class that provides needed information from tflite::Model to build recipe

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* add brief