• Stars
    star
    213
  • Rank 185,410 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AKG (Auto Kernel Generator) is an optimizer for operators in Deep Learning Networks, which provides the ability to automatically fuse ops with specific patterns.

ζŸ₯ηœ‹δΈ­ζ–‡

What Is AKG

AKG(Auto Kernel Generator) is an optimizer for operators in Deep Learning Networks. It provides the ability to automatically fuse ops with specific patterns. AKG works with MindSpore-GraphKernel to improve the performance of networks running on different hardware backends.

AKG composes with three basic optimization module, normalization, auto schedule and backend optimization.

  • normalization. In order to solve the limitation in expression ability of polyhedral(which can only process static linear programs), the computation IR needs to be normalized first. The mainly optimization of normalization module includes auto-inline, loop fusing, common subexpression elimination and so on.

  • auto schedule. Base on polyhedral technology, the auto schedule module mainly have auto-vectorization, auto-tiling, thread/block mapping, dependency analysis and memory promotion.

  • backend optimization. The backend optimization module mainly consists of TensorCore acceleration, double buffer optimization, storage flatten optimization and inject sync optimization.

Hardware Backends Support

At present, Ascend910, NVIDIA V100/A100 and CPU are supported. More Backends are on the list.

Build

Build With MindSpore

See MindSpore README.md for details.

Build Standalone

We suggest you build and run akg together with MindSpore. And we also provide a way to run case in standalone mode for convenience sake. Refer to MindSpore Installation for more information about compilation dependencies.

  • Build on Ascend910

    git-lfs needs to be installed before cloning the source codes.

    git clone https://gitee.com/mindspore/akg.git
    cd akg
    bash build.sh -e ascend -j8
    
  • Build on GPU

    git clone https://gitee.com/mindspore/akg.git
    cd akg
    bash build.sh -e gpu -j8
    
  • Build on CPU

    git clone https://gitee.com/mindspore/akg.git
    cd akg
    bash build.sh -e cpu -j8
    

Run Standalone

  1. Set Environment
  • Ascend910

    cd tests
    source ./test_env.sh
    
  • NVIDIA V100/A100

    cd tests
    source ./test_env.sh gpu
    
  • CPU

    cd tests
    source ./test_env.sh cpu
    
  1. Run test
  • Use script:
cd tests/st
python run.py -e gpu -o add -l level0  # run add operator on GPU

Detailed instructions see:python run.py -h

  • Use specific case:

    • Ascend910
    cd tests/st/ops/
    pytest -s test_abs.py -m "level0 and platform_x86_ascend_training" # run level0 testcases on Ascend
    
    • NVIDIA V100/A100
    cd tests/st/ops/
    pytest -s test_abs.py -m "level0 and platform_x86_gpu_training" # run level0 testcases on GPU
    
    • CPU
    cd tests/st/ops/
    pytest -s test_abs.py -m "level0 and platform_x86_cpu" # run level0 testcases on CPU
    

Using AKG to generate high performance kernels

See Wiki.

Contributing

Welcome contributions. See MindSpore Contributor Wiki for more details.

Release Notes

The release notes, see our RELEASE.

License

Apache License 2.0

More Repositories

1

mindspore

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
C++
4,266
star
2

models

Python
346
star
3

docs

MindSpore document
Jupyter Notebook
158
star
4

mindinsight

A visual dashboard for model tuning.
Python
101
star
5

mindarmour

A tool box for MindSpore users to enhance model security and trustworthiness.
Python
90
star
6

graphengine

A connecting link module between frontends and Ascend processors.
C++
85
star
7

mindspore-21-days-tutorials

MindSpore 21 days tutorials.
Python
77
star
8

community

MindSpore community
Python
69
star
9

mindquantum

MindQuantum is a quantum machine learning library that can be used to build and train different quantum neural networks.
Python
69
star
10

ms-operator

MindSpore on Kubernetes
Go
62
star
11

course

MindSpore course
Jupyter Notebook
59
star
12

infrastructure

The codes that boot up the mindspore community
Dockerfile
44
star
13

book

The code repository stores the complete practice code in 'Introduction DeepLearning with MindSpore'.
Python
43
star
14

serving

A lightweight and high-performance service module that helps MindSpore developers efficiently deploy online inference services in the production environment.
C++
39
star
15

mail_templates

The mail templates for community mail server
37
star
16

mindscience

Jupyter Notebook
36
star
17

hub

MindSpore hub
Python
29
star
18

zidongtaichu

Python
19
star
19

contrib

Jupyter Notebook
16
star
20

reinforcement

Python
12
star
21

xai

Python
8
star
22

transformer

Python
4
star
23

graphlearning

Python
3
star
24

mindpandas

Python
3
star
25

llm-serving

Python
3
star
26

recommender

Python
2
star
27

federated

C++
2
star
28

golden-stick

Python
2
star
29

omni-perception-pretrainer

Python
2
star
30

MindFormers

Python
1
star
31

Xihe-docs

Dockerfile
1
star
32

toolkits

Python
1
star