提交 ec9719f7 编写于 作者: L leonwanghui

Remove some useless files

上级 b72e95bb
#
| title | authors | owning-sig | participating-sigs | status | creation-date | reviewers | approvers | stage | milestone |
| ------- | -------------------------------- | ---------- | ------------------ | ----------- | ------------- | --------- | --------- | ----- | ------------- |
| MEP-AKG | @anyrenwei  @ckey_dou @dylangeng | akg | | provisional | 2020-06-16 | | TBD | beta | beta : "v0.5" |
......@@ -17,7 +15,7 @@
- [Goals](#goals)
- [Non-Goals](#non-goals)
- [Proposal](#proposal)
- [User Stories](#user-stories-optional)
- [User Stories](#user-stories)
- [Deep Graph Optimization](#deep-graph-optimization)
- [Optimize Dynamic Neural Network](#optimize-dynamic-neural-network)
- [Design Details](#design-details)
......@@ -26,7 +24,7 @@
- [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)
- [References](#references-optional)
<!-- /toc -->
## Summary
......@@ -92,13 +90,13 @@ nitty-gritty.
AKG aims to generate high-performance target code for fusing operators with specific patterns on different hardware backends. So three basic processes should be contained in akg as follows.
- **Operator Expression.**
AKG defines several basic operators which can be used to compose a complicated fused operator. These basic operators have the same granularity with MindSpore's IR. We introduce json to expressed the relation of the basic operators in one fused operator which brings weak dependency between MindSpore and AKG.
- **Schedule initialize based on polyhedral.**
When akg obtained the dsl of operators which would be fused, it would transform the operator dsl into formularIR(now we use HalidIR as tvm) and then into isl schedule tree. Next the polyhedral schedule process begin. With the help of pluto algorithm and other optimizations the schedule tree will do some transformations including vectorization, loop tiling, mem promotion and loop distribution, which can help us to improve the parallel capability and data locality.
- **Emit instructions on different hardware from IR.**
In order to generate correctness and high-performance codes for different hardware, The IR should be optimized respectively, which consists of double buffer optimization, storage rewrite optimization and inject sync optimization.
......@@ -113,15 +111,15 @@ bogged down.
#### Deep Graph Optimization
Since the network is becoming more deeper and larger, there are more opportunity to fused different operation into one to optimiza network performance.
Since the network is becoming more deeper and larger, there are more opportunity to fused different operation into one to optimize network performance.
AKG tools has the ability to auto-generate target code based on composited dsl, without scheduling procedure.
After automatic operator fusion and operator re-composition in graph level, AKG tools can generates high-performance target code for these composited pattern.
#### Optimize Dynamic Neural Network
Networks are exhibiting more and more dynamism, especially in the fields of deep graph analysis and NLP.
Tensors in a model may have dynamic shapes such as batch size, image size, sequence length, etc.
Models are expressed with control-flow, such as recursion, conditionals and loops.
Networks are exhibiting more and more dynamism, especially in the fields of deep graph analysis and NLP.
Tensors in a model may have dynamic shapes such as batch size, image size, sequence length, etc.
Models are expressed with control-flow, such as recursion, conditionals and loops.
Within these different dynamic requirement, AKG can generate one general target code on davinci hardware(different hardware) using for different shape of one common operator.
## Design Details
......@@ -135,12 +133,12 @@ proposal will be implemented, this is the place to discuss them.
<!--![Image text](akg-design.png) {:height="75%" width="75%"} -->
AKG composes with four basic optimization module, normalization, auto schedule, instruction emit and backend optimization.
- **normalization.** The mainly optimization of normalization includes three address transform, common subexpression elimination, copy propagation and so on.
- **auto schedule.** The auto schedule module mainly have vectorization, loop tiling, mem promotion and loop distribution.
- **instruction emit.** The instruction emitting module has the optimization about loop normalization, auto pragma and emit instruction.
AKG composes with four basic optimization module, normalization, auto schedule, instruction emit and backend optimization.
- **normalization.** The mainly optimization of normalization includes three address transform, common subexpression elimination, copy propagation and so on.
- **auto schedule.** The auto schedule module mainly have vectorization, loop tiling, mem promotion and loop distribution.
- **instruction emit.** The instruction emitting module has the optimization about loop normalization, auto pragma and emit instruction.
- **backend optimization.** The backend optimization module consists of double buffer optimization, storage rewrite optimization and inject sync optimization.
<img src="akg-design.png" style="zoom:80%" div align=center/>
When GraphKernel is enabled, ops are reconstructed in the graph level. The new ops described in the format of json will be translated into DSL in AKG and then compiled to the target binary.
......@@ -173,7 +171,7 @@ when drafting this test plan.
AKG employed pytests and nosetest to launch the testing process, and there are three types of testing strategies in AKG:
- **Unit Test.** Every optimization or pass in AKG has its own unitest.
- **Unit Test.** Every optimization or pass in AKG has its own unitest.
- **System test**. The akg module has its own component testing. Basically we classify the testing into compilation verification, function verification and performance testing.
......@@ -204,7 +202,7 @@ Major milestones might include
<!--
Why should this MEP _not_ be implemented?
-->
- The schedule generated directly by pluto algorithm during the polyhedral process would exist some issues on both correctness and performance in some scenarioes. So some extra passes have to added before emitting instructions.
- The schedule generated directly by pluto algorithm during the polyhedral process would exist some issues on both correctness and performance in some scenarios. So some extra passes have to added before emitting instructions.
## Alternatives
......@@ -216,5 +214,5 @@ information to express the idea and why it was not acceptable.
- Both TVM[1] and TC[2] are outstanding tools which can automatically synthesize high-performance machine learning kernel. However, neither of them could generate codes for Davinci cores(cce codes) as davinci cores have more complicated multi-level memory design(L0-A/B/C, L1 and UB) as well as specific dataflow constraint. Besides, TVM adopted schedule space model and had to write the schedule all by ourselves while akg used polyhedral techniques to initialize the schedule automatically, which referenced from the designing of TC.
## References
- [1] https://github.com/apache/incubator-tvm
- [1] https://github.com/apache/incubator-tvm
- [2] https://github.com/facebookresearch/TensorComprehensions
......@@ -3,20 +3,20 @@
| ------- | -------------------------------- | ---------- | ------------------ | ----------- | ------------- | --------- | --------- | ----- | ------------- |
| MEP-mslite | @zhengli  @zhiqiangzhai @chaijun | mslite | | provisional | 2020-08-18 | | TBD | beta | beta : "v0.7" |
# MEP-mslite: MindSpore Lite
# MEP-MSLITE: MindSpore Lite
## Table of Contents
<!-- toc -->
- [MEP-mslite: MindSpore Lite](#mep-mindspore-lite)
- [MEP-MSLITE: MindSpore Lite](#mep-mslite-mindspore-lite)
- [Table of Contents](#table-of-contents)
- [Summary](#summary)
- [Motivation](#motivation)
- [Goals](#goals)
- [Non-Goals](#non-goals)
- [Proposal](#proposal)
- [User Stories](#user-stories-optional)
- [User Stories](#user-stories)
- [Generate a compact target model and low latency and low consumption runtime](#generate-a-compact-target-model-and-low-latency-and-low-consumption-runtime)
- [Design Details](#design-details)
- [Test Plan](#test-plan)
......@@ -24,28 +24,22 @@
- [Drawbacks](#drawbacks)
- [Alternatives](#alternatives)
- [References](#references-optional)
<!-- /toc -->
## Summary
MindSpore(MS) lite is an extremely light-weight deep learning inference framework,
and designed for smart-phones and embedded devices, such as watches, headsets, and various IoT devices.
It supports Android and iOS, as well as Harmony os, and has industry leading performance.
MindSpore(MS) lite is an extremely light-weight deep learning inference framework, and designed for smart-phones and embedded devices, such as watches, headsets, and various IoT devices.
It supports Android and iOS, as well as Harmony os, and has industry leading performance.
## Motivation
Since increased computing power and sensor data, intelligence is moving towards edge devices.
Improved AI algorithms are driving the trend towards machine learning be run on
the end device, such as smart-phones or automobiles, rather than in the cloud.
On-device AI can dramatically reduce latency, conserve bandwidth,
improve privacy and enable smarter applications.
Since increased computing power and sensor data, intelligence is moving towards edge devices. Improved AI algorithms are driving the trend towards machine learning be run on the end device, such as smart-phones or automobiles, rather than in the cloud.
On-device AI can dramatically reduce latency, conserve bandwidth, improve privacy and enable smarter applications.
### Goals
- Compatibility: supports MindSpore model, as well as mainstream third-party models, such as TensorFlow lite, Caffe 1.0 and ONNX.
- High-performance:
generates small, low power consumption and fast inference target model for various hardware backends.
- High-performance: generates small, low power consumption and fast inference target model for various hardware backends.
- Versatility: supports Harmony, Android and iOS os.
- Light-weight: small shared library size, should be less than 1 MB, and could be easily deployed on
resource limited devices.
- Light-weight: small shared library size, should be less than 1 MB, and could be easily deployed on resource limited devices.
### Non-Goals
- None
......@@ -53,93 +47,78 @@ resource limited devices.
## Proposal
MS lite consists of converter and a runtime library.
The converter is an offline tool can handle most of the model translation work.
The runtime library deploys to device and executes online,
it has Lite RT and Lite Micro two modes.
Lite RT is for slightly resource limited devices, such as smart-phones,
while Lite Micro is for extremely resource limited devices, such as watches, headsets.
The converter is an offline tool can handle most of the model translation work.
The runtime library deploys to device and executes online, it has Lite RT and Lite Micro two modes.
Lite RT is for slightly resource limited devices, such as smart-phones, while Lite Micro is for extremely resource limited devices, such as watches, headsets.
- Compatibility
provides an abundant of operator parsers for MindSpore, Tensorflow Lite, Caffe, ONNX,
provides an abundant of operator parsers for MindSpore, TensorFlow Lite, Caffe, ONNX,
and supports common neural networks in CV and NLP, 208+ CPU operators, and 60+ GPU operators.
- High performance
Many optimization methods, including graph optimizations, post training quantization,
are applied to model in offline converter, and generated target model is more compact.
Graph optimizations, such as operator fusion and constant folding, make model more compact.
Post training quantization transfers fp32 model into fix-point int8 model.
It brings nearly 4x smaller model size, low latency and low consumption for inference process.
MS lite also applies a variety of optimization schemes to NN operations, including using Winograd
algorithm in convolution and deconvolution, Strassen algorithm in matrix multiplication.
Operations support fp64, fp32, fp16 and int8, and are highly optimized with acceleration by
neon instructions, hand-written assemble, multi-thread, memory reuse, heterogeneous computing, etc.
Post training quantization transfers fp32 model into fix-point int8 model.
It brings nearly 4x smaller model size, low latency and low consumption for inference process.
MS lite also applies a variety of optimization schemes to NN operations, including using Winograd algorithm in convolution and deconvolution, Strassen algorithm in matrix multiplication.
Operations support fp64, fp32, fp16 and int8, and are highly optimized with acceleration by neon instructions, hand-written assemble, multi-thread, memory reuse, heterogeneous computing, etc.
- Versatility
- Versatility
Supports Harmony, iOS and Android os, supports smart-phones, watches, headsets, and various IoT devices.
- Light weight
MS lite is highly Optimized under GHLO and GLLO. It has small foot-print,
MS lite runtime is about 800 kB, and MS Micro is less than 200 KB.
It is flexible and can easily deploy to mobile and a variety of embedded devices.
MS lite is highly Optimized under GHLO and GLLO. It has small foot-print,
MS lite runtime is about 800 kB, and MS Micro is less than 200 KB.
It is flexible and can easily deploy to mobile and a variety of embedded devices.
### User Stories
#### Generate a compact target model and low latency and low consumption runtime
Since devices has limited resource with few ROM, RAM, and power, how to deploy AI model to
device is very challenge. MS lite aims to solve the challenge for users, and provides user-friendly,
flexible tool to help users to make their own models more slim and more efficiency.
Since devices has limited resource with few ROM, RAM, and power, how to deploy AI model to
device is very challenge. MS lite aims to solve the challenge for users, and provides user-friendly, flexible tool to help users to make their own models more slim and more efficiency.
## Design Details
MS lite consists of converter and runtime.
MS lite consists of converter and runtime.
The converter is an offline tool has three parts, frontend, IR, and backend.
Runtime deploys to device and executes online.
- **Frontend.** Frontend aims to parse model from MindSpore, Tensorflow Lite, Caffe and ONNX in protobuf.
- **Frontend.** Frontend aims to parse model from MindSpore, TensorFlow Lite, Caffe and ONNX in protobuf.
- **IR.** IR is to define ANF, including tensor, operations, and graph.
- **Backend.** Backend is an optimizer based ANF graph, including GHLO, GLLO, and quantization.
GHLO is short for "graph high level optimization", common optimization methods,
such as operators fusion, operator substitution, and constant folding, are included.
GLLO is short for "graph low level optimization", low level optimization methods
are related to hardware, such as layout adjustment, mixed-precision, etc.
- **Backend.** Backend is an optimizer based ANF graph, including GHLO, GLLO, and quantization. `GHLO` is short for "graph high level optimization", common optimization methods, such as operators fusion, operator substitution, and constant folding, are included. `GLLO` is short for "graph low level optimization", low level optimization methods are related to hardware, such as layout adjustment, mixed-precision, etc.
- **Runtime.** Runtime has Lite RT and Lite Micro two modes.
<img src="./ms-lite-arch.jpg" style="zoom:80%" div align=center/>
<img src="./ms-lite-arch.jpg" style="zoom:80%" div align=center/>
### Test Plan
MS lite employed pytests and nosetest to launch the testing process,
and there are two types of testing strategies in MS lite:
- **Unit Test.** Every operation, optimization or pass in MS has its own unitest.
MS lite employed pytests and nosetest to launch the testing process, and there are two types of testing strategies in MS lite:
- **System test**. The ms lite module has its own component testing.
Basically we classify the testing into compilation verification,
function verification and performance testing.
- **Unit Test.** Every operation, optimization or pass in MS has its own unittest.
- **System test**. The ms lite module has its own component testing. Basically we classify the testing into compilation verification, function verification and performance testing.
## Implementation History
- Support high and low level graph optimization.
- Support post training quantization.
- Support Arm CPU and Mali GPU.
- Support Arm CPU and Mali GPU.
- Support fp64, fp32, fp16, int8 operations.
## Drawbacks
- MS lite does not support on-device training yet, it is coming soon...
## Alternatives
- MNN[1], TF lite[2] and TNN[3] are outstanding on-device AI frameworks.
MS lite is for on-device AI, and MS cloud is for on-cloud AI,
both of them are in scope of Huawei's MindSpore AI framework.
They share same IR, and optimization passes. MS lite is more flexible.
- MNN[1], TF lite[2] and TNN[3] are outstanding on-device AI frameworks.
MS lite is for on-device AI, and MS cloud is for on-cloud AI, both of them are in scope of Huawei's MindSpore AI framework.
They share same IR, and optimization passes. MS lite is more flexible.
## References
- [1] https://github.com/alibaba/MNN
- [1] https://github.com/alibaba/MNN
- [2] https://www.tensorflow.org/lite
- [3] https://github.com/Tencent/TNN
- [3] https://github.com/Tencent/TNN
# MindSpore ModelZoo Special Interest Group (SIG)
This is the working repo for the ModelZoo special interest group (SIG). This repo contains all the artifacts, materials, meeting notes and proposals regarding **state-of-the-art deep learning models** and **implementations** in MindSpore. Feedbacks and contributions are welcome.
1. **State-of-the-Art Deep Learning Models**: It covers typical deep learning models in image classification, object detection and segmentation, and natural language processing. These models are intended to be well-maintained, tested and kept up to date with the latest Mindspore API.
1. **State-of-the-Art Deep Learning Models**: It covers typical deep learning models in image classification, object detection and segmentation, and natural language processing. These models are intended to be well-maintained, tested and kept up to date with the latest Mindspore API.
2. **Implementations**: It provides a collection of example implementations for the models powered by Mindspore high-level APIs. Before implementing the model, make sure that the operations used in the model architecture and data processing pipeline are supported in Mindspore. Users can choose the related model to perform end-to-end training and do evaluation on new dataset.
# SIG Leads
......@@ -22,4 +22,3 @@ This is the working repo for the ModelZoo special interest group (SIG). This rep
# Meeting notes
* [Saturday May 16, 2020](./meetings/001-20200516.md)
# MindSpore Lite Special Interest Group (SIG)
This is the working repo for the mslite Special Interest Group (SIG). This repo contains all the artifacts, materials, meeting notes and proposals regarding **MS Lite Converter** , **MS Lite Runtime**. Feedbacks and contributions are welcomed.
1. **Converter**: converter is an offline tool has three parts, frontend, IR, and backend, aims to generate a compact model with applying graph optimizations and post training quantization.
2. **Runtime**: runtime deploys to device and executes online, has Lite RT and Lite Micro two modes.
1. **Converter**: converter is an offline tool has three parts, frontend, IR, and backend, aims to generate a compact model with applying graph optimizations and post training quantization.
2. **Runtime**: runtime deploys to device and executes online, has Lite RT and Lite Micro two modes.
# SIG Leads
......@@ -20,5 +20,3 @@ This is the working repo for the mslite Special Interest Group (SIG). This repo
* Documents and artifacts: https://gitee.com/mindspore/community/tree/master/sigs/mslite
# Meeting notes
......@@ -4,7 +4,7 @@
## Conference links
## Attendees
## Attendees
* Tom (Huawei)
## Notes
......
# MindSpore Security Special Interest Group (SIG)
This is the working repo for the MindArmour special interest group (SIG). This repo contains all the artifacts, materials, meeting notes and proposals regarding **model security** and **Data privacy protection** in MindSpore. Feedbacks and contributions are welcome.
1. **model security**: The model security contains four features: attack, detect, defense and evaluate.
1. **model security**: The model security contains four features: attack, detect, defense and evaluate.
2. **Data privacy protection**: We will implemented this feature very soon.
# SIG Leads
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册