summaryrefslogtreecommitdiff
path: root/docs/project/19_NN_Compiler_and_Runtime_SRS.rst
blob: 50c40410ea4cd0ed7ca7a34b771f990643ff1b95 (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
258
259
260
261
262
263
264
265
266
267
268
269
270
=============================
SW Requirements Specification
=============================

.. contents::

.. section-numbering::

.. raw:: pdf

   PageBreak oneColumn

**Revision history**

+-------+-------------+----------------------------+--------------------------+---------------------+
| Ver.  | Date        | Contents                   | Author                   | Approver            |
+=======+=============+============================+==========================+=====================+
| 0.1   | 2019.04.22  | Initial version            | Rusyaev Roman            |                     |
+-------+-------------+----------------------------+--------------------------+---------------------+
| 0.2   | 2019.04.23  | SE member in-charge review | Aleksei Kondrashov       |                     |
+-------+-------------+----------------------------+--------------------------+---------------------+
| 1.0   | 2019.04.24  | Final Execution DR version | Rusyaev Roman            | Sung-Jae Lee        |
+-------+-------------+----------------------------+--------------------------+---------------------+
| 1.1   | 2019.07.24  | DR1 version                | Efimov Alexander         | Sung-Jae Lee        |
+-------+-------------+----------------------------+--------------------------+---------------------+


Introduction
============

Purpose and scope
-----------------

.. include:: project_purpose_and_scope.rst
.. include:: project_terms_and_abbreviation.rst


SW System Architecture
----------------------

The main components of the compiler are the following:

- Configuration system
- TensorFlow Importer (loads model in TensorFlow format and creates internal IR semantically equal to the given model)
- ONNX Importer (loads model in ONNX format and creates internal IR semantically equal to the given model)
- NN Package emitter

|

The main components of the runtime are the following:

- Configuration system
- API interface for loading and execution of NN models
- NN Package parser
- High Level optimizations
- Model lowering pass (transforms IR created by API of imported from NN Package into low-level representation)
- Low-Level optimizations on lowered IR
- Lowered IR executor
- Fallback model interpreter


SW Functional Requirements
==========================

Frontend
--------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description

   * - RF-1
     - Frontend: Tensorflow
     - The compiler should support import of NN model in Tensorflow format (parsing & verification)

   * - RF-2
     - Frontend: ONNX
     - The compiler should support import of NN model in ONNX format (parsing & verification)

   * - RF-3
     - Frontend: lossless import
     - The front-end should use the lossless approach while it is converting any NN model to IR

   * - RF-4
     - Frontend: Inception_v3
     - The front-end should successful import the Inception V3 NN model

   * - RF-5
     - Frontend: MobileNet
     - The front-end should successful import the MobileNet NN model


High-Level optimization
-----------------------

No special requirements


Low-Level optimization
----------------------

No special requirements


Heterogeneous computing
-----------------------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description

   * - RF-6
     - HE: profiling
     - Runtime should be able to gather or import information about execution time of specific operations

   * - RF-7
     - HE: scheduling
     - Runtime should be able to use profile information to choose optimal assignment of operations to execution devices

   * - RF-8
     - HE: mixing backends
     - Runtime should be able to mix different types of execution devices in one compilation to achieve best performance


RNN
---

No special requirements

SW Non-Functional Requirements
==============================

Performance
-----------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-1
     - Performance: input
     - Inference time should be equal or less then models executed by ML frameworks of original model


Reliability
-----------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-2
     - Reliability: input
     - If the incorrect input data is provided inference should not be performed, but user should be informed about all errors which were met

Security
--------

No special requirements

Usability
---------

No special requirements

Availability
------------

No special requirements

Maintainability
---------------

No special requirements

Extensibility
-------------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-3
     - Extensibility: operators
     - Project design and implementation should provide possibility to add new built-in operators easily
   * - RNF-4
     - Extensibility: formats
     - Project design and implementation should provide possibility to support new model formats easily
   * - RNF-5
     - Extensibility: custom operators
     - Project design and implementation should provide possibility to extend set of supported operators by utilization of user-defined kernels and necessary metainformation


Testability
-----------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-5
     - Testability: environment
     - The test environment should be built in order to verify functionality, product build status, inference correctness and performance


Portability
-----------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-6
     - Portability: Linux
     - The functionality should be portable with Linux-based OS

Scalability
-----------

No special requirements


Configurability
---------------

No special requirements


The source code
---------------

.. list-table::
   :widths: 23 50 100
   :header-rows: 1

   * - ID
     - Requirement Name
     - Description
   * - RNF-7
     - Legislation
     - All source code files should follows its original license and general project license without any conflicts
   * - RNF-8
     - Legitimacy
     - The project should have its own general license
   * - RNF-9
     - Coding style
     - Each source code file should follow the one defined for the project coding style