summaryrefslogtreecommitdiff
path: root/docs/nncc/project/requirements_specification.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/nncc/project/requirements_specification.md')
-rw-r--r--docs/nncc/project/requirements_specification.md272
1 files changed, 272 insertions, 0 deletions
diff --git a/docs/nncc/project/requirements_specification.md b/docs/nncc/project/requirements_specification.md
new file mode 100644
index 000000000..7a6fce762
--- /dev/null
+++ b/docs/nncc/project/requirements_specification.md
@@ -0,0 +1,272 @@
+# SW Requirements Specification
+
+
+**Revision history**
+
+| Ver. | Date | Contents | Author | Approver |
+| ---- | ---------- | ------------------------------------------ | ------------------ | ------------ |
+| 0.1 | 2018.04.11 | Initial version | Vostokov Sergey | Sung-Jae Lee |
+| 0.2 | 2018.04.11 | SE member in-charge review | Aleksei Kondrashov | |
+| 1.0 | 2018.04.13 | Final Execution DR version | Vostokov Sergey | Sung-Jae Lee |
+| 1.1 | 2018.05.24 | Add new requirement in Source code section | Vostokov Sergey | Sung-Jae Lee |
+
+## Introduction
+
+### 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)
+
+### 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 |
+
+### SW System Architecture
+
+The main components of the compiler are the following:
+
+ - Configuration system
+ - Importer (convert supported NN model to Model IR before
+ optimization)
+ - High-Level optimization (Applies HW independent optimizations)
+ - Low-Level optimization (Applies optimizations appropriate to the
+ specified target HW)
+ - Code emitter (Produces the binary to take advantages of CPU and/or
+ GPU)
+
+![image](../images/nncc_idef0_a1.png)
+
+### Relevant Industry Standards
+
+Architecture design is described using IDEF notation. Since the nncc is a part of open source STAR Platform project
+any other industry standards not required and/or applicable.
+
+## SW Functional Requirements
+
+### Frontend
+
+| ID | Requirement Name | Description |
+| ---- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| RF-1 | Frontend: Tensorflow Lite | The compiler should support import of NN model in Tensorflow Lite format (parsing & verification of data scheme v0-v3, 50 NN ops) |
+| RF-2 | Frontend: Caffe | The compiler should support import of NN model in Caffe format (parsing & verification) |
+| RF-3 | Frontend: Caffe2 (Optional) | The compiler should support import of NN model in Caffe2 format (parsing & verification) |
+| RF-4 | Frontend: lossless import | The front-end should use the lossless approach while it is converting any NN model to IR |
+| RF-5 | Frontend: Inception\_v3 | The front-end should successful import the Inception V3 NN model |
+| RF-6 | Frontend: MobileNet | The front-end should successful import the MobileNet NN model |
+
+### High-Level optimization
+
+No special requirements
+
+### Low-Level optimization
+
+No special requirements
+
+### Backend
+
+| ID | Requirement Name | Description |
+| ----- | ---------------------- | ------------------------------------------------------------------------------------------------------------ |
+| RF-7 | Backend: ARM CPU | The compiler should produce executable for ARM CPU |
+| RF-8 | Backend: ARM GPU | The compiler should produce the binary that takes advantages of GPU when it was specified before compilation |
+| RF-9 | Backend: Artefact type | The compiler should produce executable as a shared library or as a static library |
+| RF-10 | Backend: Inception\_v3 | The compiler should produce the valid compiled artefact for Inception v3 NN model |
+| RF-11 | Backend: MobileNet | The compiler should produce the valid compiled artefact for MobileNet NN model |
+
+### Configuration
+
+| ID | Requirement Name | Description |
+| ----- | --------------------------------------- | --------------------------------------------------------------------------- |
+| RF-12 | Config: command line | The compiler should get configuration parameters from command line |
+| RF-13 | Config: config file (Optional) | The compiler should get configuration parameters from config file |
+| RF-14 | Config: environment variable (Optional) | The compiler should get configuration parameters from environment variables |
+
+### Compiled Artefact
+
+| ID | Requirement Name | Description |
+| ----- | ----------------------------- | ---------------------------------------------------------------------------------------------- |
+| RF-15 | Artefact: result | The artefact should provide comparable result to the original NN model for the same input data |
+| RF-16 | Artefact: input verifications | The artefact should verify any input data and check consistency |
+| RF-17 | Artefact: GPU | The artefact should take advantage of the GPU for GPU-enabled operations |
+| RF-18 | Artefact: CPU | The artefact should take advantage of CPU if it was specified |
+
+## SW Non-Functional Requirements
+
+### The compiler
+
+#### Performance
+
+No special requirements
+
+#### SW capacity
+
+No special requirements
+
+#### Reliability
+
+| ID | Requirement Name | Description |
+| ----- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| RNF-1 | Reliability: input | The compiler should produce correct executable in order to utilize CPU and GPU when the correct input data is provided. If the incorrect input data are provided the compiler should not produce a compiled artefact, but inform user about all errors which were met |
+
+#### Security
+
+No special requirements
+
+#### Usability
+
+No special requirements
+
+#### Availability
+
+No special requirements
+
+#### Maintainability
+
+No special
+requirements
+
+#### Extendibility
+
+| ID | Requirement Name | Description |
+| ----- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |
+| RNF-2 | Extendibility: frontend | The compiler design and implementations should provide possibility to add new features to front-end: new NN models format |
+| RNF-3 | Extendibility: backend | The compiler design and implementations should provide possibility to add new features to backend (new targets) |
+
+#### Testability
+
+| ID | Requirement Name | Description |
+| ----- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| RNF-4 | Testability: environment | The test environment should be built in order to verify compiler functionality, product build status, artefact build/execution status, artefact calculation result and calculation memory footprint and performance |
+
+#### Portability
+
+| ID | Requirement Name | Description |
+| ----- | ------------------ | --------------------------------------------------- |
+| RNF-5 | Portability: Linux | The compiler should be portable with Linux-based OS |
+
+#### Scalability
+
+No special requirements
+
+#### Expandability
+
+No special
+requirements
+
+#### Configurability
+
+| ID | Requirement Name | Description |
+| ----- | --------------------------------------- | --------------------------------------------------------------------------------- |
+| RNF-6 | Configurability: command line | The compiler should support applying configuration through command line options. |
+| RNF-7 | Configurability: file (Optional) | The compiler should support applying configuration through configuration file. |
+| RNF-8 | Configurability: environment (Optional) | The compiler should support applying configuration through environment variables. |
+
+### The compiled artefact
+
+No special
+requirements
+
+### The source code
+
+| ID | Requirement Name | Description |
+| ------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| RNF-9 | Legislation | All source code files should follows its original license and general project license without any conflicts |
+| RNF-10 | Legitimacy | The project should have its own general license |
+| RNF-11 | Coding style | Each source code file should follow the one defined for the project coding style |
+| RNF-12 | Contrib | RNF-9, RNF-10, RNF-11 are applicable only for the final release version of source code. These requirements are not applicable to the source code placed in development branch or any folder which is used as temporary storage for the source code under development. |
+
+## SW Interface Requirements
+
+### The compiler interface
+
+#### User Interface
+
+| ID | Requirement Name | Description |
+| ----- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| RIF-1 | Compiler UI: no interaction | The compiler should not require any user interation during compilation (completed compilations, fatal exit) |
+| RIF-2 | Compiler UI: CLI | The compiler is considering as a command line tool which proceed parameters from command line and/or config file, environment variables |
+| RIF-3 | Compiler UI: input | The compiler should provide the facility to specify NN model to be compiled |
+| RIF-4 | Compiler UI: target device | The compiler should provide the facility to specify result target device (CPU or GPU) |
+| RIF-5 | Compiler UI: target platform | The compiler should provide the facility to specify result target SW platform |
+| RIF-6 | Compiler UI: output | The compiler should provide the facility to specify result target name |
+| RIF-7 | Compiler UI: target type | The compiler should provide the facility to specify result target type: shared or static library |
+
+#### Hardware Interface
+
+| ID | Requirement Name | Description |
+| ----- | -------------------------------- | --------------------------------------------------------------------------- |
+| RIF-8 | Compiler HWI: x86\_64 executable | The solution should provide executables to run on x86\_64-compatible system |
+
+#### Software Interface
+
+| ID | Requirement Name | Description |
+| ------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------ |
+| RIF-9 | Compiler SWI: frontend plugin | The compiler should provide the SW interface in order to add support of the new NN model formats |
+| RIF-10 | Compiler SWI: backend plugin (HW) | The compiler should provide the SW interface in order to add support of the new HW |
+| RIF-11 | Compiler SWI: backend plugin (SW Platform) | The compiler should provide the SW interface in order to add support of the new SW Platform |
+
+#### Communication Interface
+
+No requirements for communication interface.
+
+### The compiled artefact interface
+
+#### User Interface
+
+| ID | Requirement Name | Description |
+| ------ | ------------------- | ----------------------------------- |
+| RIF-12 | Artefact UI: no GUI | Command line UI in text is suitable |
+
+#### Hardware Interface
+
+| ID | Requirement Name | Description |
+| ------ | ----------------- | ----------------------------------------------------------------------------- |
+| RIF-13 | Artefact HWI: CPU | The artefact should use ARM CPU instruction set when it was built for ARM CPU |
+| RIF-14 | Artefact HWI: GPU | The artefact should use ARM GPU instruction set when it was build for ARM GPU |
+
+#### Software Interface
+
+| ID | Requirement Name | Description |
+| ------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| RIF-15 | Artefact SWI: GPU driver | The artefact should use ARM GPU driver to invoke calculations when it was built for ARM GPU |
+| RIF-16 | Artefact SWI: C/C++ header | The artefact should provide C/C++ interface in order to use it in other applications |
+| RIF-17 | Artefact SWI: shared type | The compiled artefact should be a shared library in order to share it between several executables when it was specified before compilation |
+| RIF-18 | Artefact SWI: static type | The compiled artefact should be a static library in order to be built-in to an executable when it was specified before compilation |
+| RIF-19 | Artefact SWI: Info | The artefact should provide SW interface in order to get the actual status of calculation process (progress, errors, final result) |
+
+#### Communication Interface
+
+No requirements for communication interface.