Compare commits

...

1 Commits

Author SHA1 Message Date
caoqichun 223de81530 add version v_nnvm
6 years ago

@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

@ -0,0 +1,6 @@
Python API
==========
.. toctree::
inna

File diff suppressed because it is too large Load Diff

@ -0,0 +1,21 @@
.. inna documentation master file, created by
sphinx-quickstart on Mon Apr 8 10:09:32 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to INNA's documentation!
================================
.. toctree::
:maxdepth: 2
:caption: Contents:
install
api
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

@ -0,0 +1,9 @@
inna.compiler
==============
.. autofunction:: inna.compiler.create
.. autoclass:: inna.compiler.INNACompiler
:members:
.. automethod:: __init__

@ -0,0 +1,5 @@
inna.quantizer
===============
.. automodule:: inna.quantizer
:members:

@ -0,0 +1,8 @@
inna
=====
.. toctree::
inna.compiler
inna.quantizer
inna.runtime

@ -0,0 +1,28 @@
inna.runtime
=============
.. autofunction:: inna.runtime.create
.. autoclass:: inna.runtime.INNARuntime
.. automethod:: __init__
.. automethod:: run
.. automethod:: ReloadNNModel
.. automethod:: SetExtendHWBatch
.. automethod:: SetInputFeatures
.. automethod:: Run
.. automethod:: Wait
.. automethod:: GetOutputFeatures
.. automethod:: WriteRegister
.. automethod:: ReadRegisterU8
.. automethod:: ReadRegisterU16
.. automethod:: ReadRegisterU32
.. automethod:: ReadRegisterU64
.. automethod:: WriteDMA
.. automethod:: ReadDMA
.. automethod:: WaitPcieInterupt
.. autofunction:: inna.runtime.check_equal

@ -0,0 +1,19 @@
Installation
============
INNA use NNVM as frontend compiler. To get started, install tvm by
reference `TVM Install from
Source <https://docs.tvm.ai/install/from_source.html#install-from-source>`__.
After install tvm, clone INNA repo from git server.
.. code:: bash
git clone git@100.2.95.100:fanbaoyu/inna.git
Install INNA throw ``pip install``.
.. code:: bash
pip install ./inna

@ -0,0 +1,10 @@
Metadata-Version: 1.0
Name: inna
Version: 0.0.1
Summary: Inspur Neural Network Accelerater
Home-page: UNKNOWN
Author: Fan Baoyu
Author-email: fanbaoyu@inspur.com
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN

@ -0,0 +1,30 @@
setup.py
inna/__init__.py
inna/config.ini
inna.egg-info/PKG-INFO
inna.egg-info/SOURCES.txt
inna.egg-info/dependency_links.txt
inna.egg-info/not-zip-safe
inna.egg-info/requires.txt
inna.egg-info/top_level.txt
inna/compiler/__init__.py
inna/compiler/assembler.py
inna/compiler/compiler.py
inna/compiler/converter.py
inna/compiler/frontend.py
inna/compiler/scheduler.py
inna/compiler/test.py
inna/compiler/applications/__init__.py
inna/compiler/applications/resnet/__init__.py
inna/compiler/applications/resnet/keras.py
inna/compiler/applications/resnet/mxnet.py
inna/compiler/applications/resnet/onnx.py
inna/compiler/applications/resnet/tensorflow.py
inna/quantizer/__init__.py
inna/quantizer/quantize.py
inna/quantizer/quantize_base.py
inna/quantizer/quantize_caffe.py
inna/quantizer/quantize_tf.py
inna/runtime/__init__.py
inna/runtime/runtime.cc
inna/runtime/runtime.py

@ -0,0 +1,2 @@
pybind11>=2.2
numpy>=1.16

@ -0,0 +1,5 @@
from __future__ import absolute_import
from . import compiler
from . import quantizer
from . import runtime

@ -0,0 +1,3 @@
from __future__ import absolute_import
from .compiler import create, INNACompiler

@ -0,0 +1,3 @@
from __future__ import absolute_import
from . import resnet

@ -0,0 +1,6 @@
from __future__ import absolute_import
from . import tensorflow
from . import keras
from . import mxnet
from . import onnx

@ -0,0 +1,17 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras
def resnet_v1_50():
graph = keras.applications.resnet50.ResNet50(include_top=True, weights=None,
input_shape=(224, 224, 3), classes=1000)
graph.load_weights('../models/keras/resnet/resnet50_weights.h5')
shape_dict = {
'input_1': (1, 3, 224, 224),
}
layout = 'NCHW'
return graph, shape_dict, layout

@ -0,0 +1,14 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from mxnet.gluon.model_zoo.vision import get_model
def resnet_v1_50():
graph = get_model('resnet50_v1', pretrained=True)
shape_dict = {
'data': (1, 3, 224, 224),
}
layout = 'NCHW'
return graph, shape_dict, layout

@ -0,0 +1,15 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import onnx
def resnet_v1_50():
graph = onnx.load('../models/onnx/resnet/restnet50_v1.1.onnx')
shape_dict = {
'gpu_0/data_0': (1, 3, 224, 224),
}
layout = 'NCHW'
return graph, shape_dict, layout

@ -0,0 +1,31 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tvm.relay.testing.tf as tf_testing
import os
def resnet_v1_50():
with tf.Graph().as_default():
model = {
'pb': '../models/tensorflow/resnet/frozen_resnet_v1_50.pb',
'shape_dict': {
'input': (1, 224, 224, 3),
},
'layout': 'NHWC',
'out_node': 'resnet_v1_50/predictions/Reshape_1',
}
with tf.gfile.GFile(model['pb'], 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
graph = tf.import_graph_def(graph_def, name='')
# Call the utility to import the graph definition into default graph.
graph_def = tf_testing.ProcessGraphDefParam(graph_def)
with tf.Session() as sess:
# Add shapes to the graph.
graph_def = tf_testing.AddShapesToGraphDef(sess, model['out_node'])
return graph_def, model['shape_dict'], model['layout']

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save