summaryrefslogtreecommitdiff
path: root/docs/nncc/project/development_document.md
blob: 8315dd3b69d5062b2ce8272e616f9dcf236234d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# SW Development Document

**Revision history**

| Ver. | Date       | Contents                    | Author          | Approver     |
| ---- | ---------- | --------------------------- | --------------- | ------------ |
| 0.1  | 2018.04.12 | Initial version             | Vostokov Sergey | Sung-Jae Lee |
| 0.2  | 2018.04.16 | SE member in-charge review  | Ilya Lopatin    |              |
| 1.0  | 2018.04.17 | Final Execution DR version  | Vostokov Sergey | Sung-Jae Lee |
| 1.1  | 2018.04.17 | Add SW Quality Verification | Vostokov Sergey | Sung-Jae Lee |

**Terminology and Abbreviation**

|              |                                                               |
| ------------ | ------------------------------------------------------------- |
| OS           | Operating System                                              |
| OS API       | Application interface of OS                                   |
| HW           | Hardware                                                      |
| SW           | Software                                                      |
| NN           | Neural Network                                                |
| NN model     | Neural network model (Instance of NN built with ML framework) |
| NN compiler  | The compiler for neural network                               |
| ML framework | The machine learning framework                                |
| TF/TF Lite   | Tensorflow/Tensorflow Lite ML framework                       |
| IR           | Intermediate representation                                   |
| CI/CI system | Continuous integration system                                 |
| UI           | The user interface                                            |
| GUI          | The graphical user interface                                  |
| CLI          | The command-line interface                                    |

## Project Overview

### Purpose and Scope

The main goal of the project is to develop a compiler for neural networks to produce executable artefact for specified SW and HW platform.

The development scope includes the following components:

  - Develop importer module to parse, verify and represent NN model for further optimization and compilation
  - Develop code emitters to produce executable binary for CPU and GPU

  
**2018 year goals:**

  - Support TensorFlow Lite NN model format
  - Support Caffe NN model format
  - Support Caffe2 NN model format (Optional)
  - Support compilation of MobileNet NN
  - Support compilation of Inception v3 NN
  - Support ARM CPU
  - Support ARM GPU (Mali)
  - Support Tizen OS
  - Support SmartMachine OS (Optional)

| Product             | Target Model Name              | Comment          |
| ------------------- | ------------------------------ | ---------------- |
| Tizen phone         | Tizen TM2                      | Reference device |
| Tizen device        | Odroid XU4                     | Reference board  |
| SmartMachine target | Microvision mv8890, exynos8890 | Reference device |

### Assumptions, Dependencies and Constraints

<table>
<colgroup>
<col style="width: 26%" />
<col style="width: 46%" />
<col style="width: 26%" />
</colgroup>
<thead>
<tr class="header">
<th>Item</th>
<th>Assumptions, Dependencies and the Constraints</th>
<th>Reference</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Tizen SW Platform</td>
<td><dl>
<dt>The following items should be provided:</dt>
<dd><ul>
<li>Tizen API</li>
<li>Tizen kernel</li>
<li>Tizen FW</li>
<li>Tizen SDK</li>
<li>Tizen naming convention</li>
</ul>
</dd>
</dl></td>
<td><ul>
<li><a href="www.tizen.org" class="uri">www.tizen.org</a></li>
<li><a href="wiki.tizen.org" class="uri">wiki.tizen.org</a></li>
<li><a href="developer.tizen.org" class="uri">developer.tizen.org</a></li>
</ul></td>
</tr>
<tr class="even">
<td>SmartMachine OS Platform</td>
<td><dl>
<dt>The following items should be provided:</dt>
<dd><ul>
<li>SmartMachine API</li>
<li>SmartMachine kernel</li>
<li>SmartMachine FW</li>
<li>SmartMachine SDK</li>
<li>SmartMachine naming convention</li>
</ul>
</dd>
</dl></td>
<td>- <a href="http://suprem.sec.samsung.net/confluence/pages/viewpage.action?pageId=81833987">Platform confluence</a> <br>- <a href="https://github.sec.samsung.net/RS7-SmartMachine">Github</a> <br>- <a href="http://suprem.sec.samsung.net/confluence/display/ASEC/Adaptive+AUTOSAR">Functional Safety confluence</a></td>
</tr>
<tr class="odd">
<td>Host OS</td>
<td>Linux-based OS (Ubuntu, Archlinux, etc)</td>
<td>- <a href="https://www.ubuntu.com/">Ubuntu site</a> <br>- <a href="https://www.archlinux.org/">Archlinux site</a></td>
</tr>
<tr class="even">
<td>Tizen target HW</td>
<td>The reference device should be provided: Tizen TM2</td>
<td></td>
</tr>
<tr class="odd">
<td>SmartMachine target HW</td>
<td>The reference device should be provided</td>
<td></td>
</tr>
</tbody>
</table>

## Development Plan And Result

### Development Schedule

| Task                                 | Deliverable                       | Plan start | Plan end | Result start | Result end | Responsibility |
| ------------------------------------ | --------------------------------- | ---------- | -------- | ------------ | ---------- | -------------- |
| Prepare SW requirements              | SRS                               | 04.2018    | 04.2018  |              |            | S. Vostokov    |
| Prepare initial SW Test Document     | STD                               | 04.2018    | 04.2018  |              |            | S. Vostokov    |
| Prepare Initial Project Plan         | SDD                               | 04.2018    | 04.2018  |              |            | S. Vostokov    |
| Prepare SW Test Document             | STD                               | 04.2018    | 06.2018  |              |            | S. Vostokov    |
| Prepare design document              | HLD, DLD                          | 05.2018    | 08.2018  |              |            | S. Vostokov    |
| Prepare test result                  | STD, UTR                          | 04.2018    | 10.2018  |              |            | S. Vostokov    |
| Prepare project completion documents | SDD, Project completion report    | 05.2018    | 12.2018  |              |            | S. Vostokov    |
| Implement Caffe Importer             | Caffe NN model Importer           | 05.2018    | 09.2018  |              |            | S. Vostokov    |
| Implement code emitter for CPU       | Code emitter                      | 05.2018    | 09.2018  |              |            | S. Vostokov    |
| Implement TF Lite Importer           | TensorFlow Lite NN model Importer | 05.2018    | 11.2018  |              |            | S. Vostokov    |
| Implement code emitter for GPU       | Code emitter                      | 02.2018    | 11.2018  |              |            | S. Vostokov    |

### SW Metrics

| Category | Metric                                                                 | Collection Method        | Collection Period       | Planned           | Actual | Responsibility |
| -------- | ---------------------------------------------------------------------- | ------------------------ | ----------------------- | ----------------- | ------ | -------------- |
| Quality  | Test pass rate                                                         | GTest                    | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |
| Quality  | Defects density                                                        | Defect management system | 22.02.2018 - 31.12.2018 | \<= 1 defect/KLOC |        | S. Vostokov    |
| Quality  | Defects removal rate                                                   | Defect management system | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |
| Quality  | Critical defects                                                       | Static analysis          | 22.02.2018 - 31.12.2018 | 0                 |        | S. Vostokov    |
| Quality  | Major defects                                                          | Static analysis          | 22.02.2018 - 31.12.2018 | 0                 |        | S. Vostokov    |
| Quality  | Code review issue removal                                              | Samsung Research github  | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |
| Quality  | Comments Rate                                                          | `cloc` tool              | 22.02.2018 - 31.12.2018 | Exceed 20%        |        | S. Vostokov    |
| Quality  | Cyclomatic Complexity                                                  | SVACE                    | 22.02.2018 - 31.12.2018 | \< 50             |        | S. Vostokov    |
| Quality  | Unused Items (Unused Files, Unused Functions, Unused Global Variables) | gcc/g++                  | 22.02.2018 - 31.12.2018 | 0                 |        | S. Vostokov    |
| Process  | Project On-time Completion Rate                                        | PLM                      | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |
| Process  | Milestone On-time Completion Rate                                      | PLM                      | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |
| Process  | Process compliance                                                     | Audit                    | 22.02.2018 - 31.12.2018 | 100%              |        | S. Vostokov    |

### SW Configurations Management

#### Document

| No | Configuration Item           | Location | Submitter   |
| -- | ---------------------------- | -------- | ----------- |
| 1  | SW Requirement Specification | PLM      | S. Vostokov |
| 2  | SW Development Document      | PLM      | S. Vostokov |
| 3  | SW High Level Document       | PLM      | S. Vostokov |
| 4  | SW Detailed Level Document   | PLM      | S. Vostokov |
| 5  | SW System Test Document      | PLM      | S. Vostokov |
| 6  | SW Unit Test Report          | PLM      | S. Vostokov |

#### SW Source Code

SW Repository:
<https://github.sec.samsung.net/STAR/nncc>

    git clone https://github.sec.samsung.net/STAR/nncc.git

#### Baseline

| Phase              | Baseline Name      | SW Configuration Item                                                                       |
| ------------------ | ------------------ | ------------------------------------------------------------------------------------------- |
| 04.2018 Plan       | Execution DR       | SW Requirement Specification, SW Development Document, System Test Document initial version |
| 06.2018 Execution  | DR1                | System Test Document                                                                        |
| 08.2018 Execution  | Design document    | SW High Level Document, SW Detailed Design Document                                         |
| 09.2018 Execution  | DR2                |                                                                                             |
| 10.2018 Execution  | Test report        | SW System Test Document (result), SW Unit Test Report                                       |
| 12.2018 Completion | Project Completion | Project Completion Report                                                                   |

## SW Quality Verification

### SW Verification

| No | Verification Item                | Quality Goal                               | Tool     | Phase     | Development Team Member in Charge | Result | Note |
| -- | -------------------------------- | ------------------------------------------ | -------- | --------- | --------------------------------- | ------ | ---- |
| 1  | Open source License Verification | Clear violations of open source obligation | ProtexIP | Execution | Vostokov Sergey                   |        |      |
| 2  | Potential Defect                 | Fix all defects                            | Svace    | Test      | Vostokov Sergey                   |        |      |
| 3  | System Defect                    | Fix Critical/ Major defects                | Github   | Test      | Vostokov Sergey                   |        |      |

### Static Analysis

| No | Activity                    | Schedule   | Result | Comment |
| -- | --------------------------- | ---------- | ------ | ------- |
| 1  | SA Verification I (SVACE)   | 28.09.2018 |        |         |
| 2  | SA Verification II (SVACE)  | 30.11.2018 |        |         |
| 2  | SA Verification III (SVACE) | 31.12.2018 |        |         |

### Coding Standard

| No | Activity                                              | Schedule | Result | Comment |
| -- | ----------------------------------------------------- | -------- | ------ | ------- |
| 1  | Coding standard enforcement with `clang-format` tool. | Regular  |        |         |


### Convergence (integration testing)

Out of scope since the integration with other SW is not required by SW
Requirement Specification.

### Dynamic Analysis

| No | Activity            | Schedule   | Result | Comment |
| -- | ------------------- | ---------- | ------ | ------- |
| 1  | DA Verification I   | 28.09.2018 |        |         |
| 2  | DA Verification II  | 30.11.2018 |        |         |
| 2  | DA Verification III | 31.12.2018 |        |         |


### Architecture Analysis

SW architecture verification is managed by HQ.

### SW Security

Out of the project scope since the project is not related to SW security.

### Code Review

| No | Activity    | Schedule | Result | Comment                                                             |
| -- | ----------- | -------- | ------ | ------------------------------------------------------------------- |
| 1  | Code review | Regular  |        | All code is reviewed manually using `github` tool before committing |

## Risk Management

| Priority | Risk Description                                                                                        | Risk Reduction Solution                                                                                   | Schedule          | Result | Responsibility |
| -------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------- | ------ | -------------- |
| 1        | Project scope is changed due extra HQ request                                                           | Discuss the new requirements via email and messenger, update SRS                                          | 02.2018 - 12.2018 |        | S. Vostokov    |
| 2        | Unavoidable technical difficulties during requirements implementation                                   | Submit requirements changes and get confirmation from HQ                                                  | 02.2018 - 12.2018 |        | S. Vostokov    |
| 3        | Not enough HR                                                                                           | Hire team members as soon as possible, request assistance from other teams                                | 02.2018 - 12.2018 |        | S. Vostokov    |
| 4        | Use of GPL code                                                                                         | Minimize usage of GPL code, wrap GPL modules with well-defined interfaces so they can be easily replaced. | 02.2018 - 12.2018 |        | S. Vostokov    |
| 5        | Requirements would change due external or internal circumstances, e.g. new technology or product launch | Discuss project changes and make corrections                                                              | 02.2018 - 12.2018 |        | S. Vostokov    |