Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
ffcb2a5e
Commit
ffcb2a5e
authored
7 years ago
by
Yida Wang
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
explain the lowering process in nnvm.compiler.build (#339)
parent
6c198621
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nnvm/python/nnvm/compiler/build_module.py
+2
-2
2 additions, 2 deletions
nnvm/python/nnvm/compiler/build_module.py
nnvm/tutorials/define_and_compile_model.py
+7
-4
7 additions, 4 deletions
nnvm/tutorials/define_and_compile_model.py
with
9 additions
and
6 deletions
nnvm/python/nnvm/compiler/build_module.py
+
2
−
2
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
"
)
...
...
This diff is collapsed.
Click to expand it.
nnvm/tutorials/define_and_compile_model.py
+
7
−
4
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment