Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
ffcb2a5e
Commit
ffcb2a5e
authored
Jan 26, 2018
by
Yida Wang
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explain the lowering process in nnvm.compiler.build (#339)
parent
6c198621
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
nnvm/python/nnvm/compiler/build_module.py
+2
-2
nnvm/tutorials/define_and_compile_model.py
+7
-4
No files found.
nnvm/python/nnvm/compiler/build_module.py
View file @
ffcb2a5e
...
...
@@ -207,7 +207,7 @@ def build(graph, target=None, shape=None, dtype="float32", params=None, target_h
The final execution graph.
libmod : tvm.Module
The modue that comes with the execution graph
The modu
l
e that comes with the execution graph
params : dict of str to NDArray
The updated parameters of graph if params is passed.
...
...
@@ -236,7 +236,7 @@ def build(graph, target=None, shape=None, dtype="float32", params=None, target_h
if
params
and
cfg
.
pass_enabled
(
"PrecomputePrune"
):
graph
,
params
=
precompute_prune
(
graph
,
params
)
shape
,
dtype
=
_update_shape_dtype
(
shape
,
dtype
,
params
)
# Operator Fusion and generatio
m
# Operator Fusion and generatio
n
graph
=
graph_attr
.
set_shape_inputs
(
graph
,
shape
)
graph
=
graph_attr
.
set_dtype_inputs
(
graph
,
dtype
)
graph
.
_set_json_attr
(
"target"
,
str
(
target
),
"str"
)
...
...
nnvm/tutorials/define_and_compile_model.py
View file @
ffcb2a5e
...
...
@@ -67,10 +67,13 @@ print(net.debug_str())
# optimization while TVM does the tensor-level optimization, resulting
# in an optimized runtime module for model serving.
#
# We'll first compile for Nvidia GPU.
# To generate the module library, TVM will first transfer graph IR into lower
# intrinsic IR for the specified target backend, which is CUDA in this example.
# Then target backend will generate module library.
# We'll first compile for Nvidia GPU. Behind the scene, `nnvm.compiler.build`
# first does a number of graph-level optimizations, e.g. pruning, fusing, etc.,
# then registers the operators (i.e. the nodes of the optmized graphs) to
# TVM implementations to generate a `tvm.module`.
# To generate the module library, TVM will first transfer the HLO IR into the lower
# intrinsic IR of the specified target backend, which is CUDA in this example.
# Then the machine code will be generated as the module library.
opt_level
=
0
target
=
tvm
.
target
.
cuda
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment