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
50d8773b
Commit
50d8773b
authored
7 years ago
by
Yida Wang
Committed by
Tianqi Chen
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
small fixes on docs (#769)
* small fixs on docs * add IR output after parallelization
parent
6d061556
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
docs/how_to/contribute.md
+0
-1
0 additions, 1 deletion
docs/how_to/contribute.md
tutorials/optimize/opt_gemm.py
+13
-6
13 additions, 6 deletions
tutorials/optimize/opt_gemm.py
with
13 additions
and
7 deletions
docs/how_to/contribute.md
+
0
−
1
View file @
50d8773b
...
...
@@ -14,7 +14,6 @@ Everyone is more than welcome to contribute. It is a way to make the project bet
-
[
What is the consequence of force push
](
#what-is-the-consequence-of-force-push
)
*
[
Document
](
#document
)
*
[
Testcases
](
#testcases
)
*
[
Examples
](
#examples
)
*
[
Core Library
](
#core-library
)
*
[
Python Package
](
#python-package
)
...
...
This diff is collapsed.
Click to expand it.
tutorials/optimize/opt_gemm.py
+
13
−
6
View file @
50d8773b
...
...
@@ -26,7 +26,7 @@ Actually, all the methodologies used in this tutorial is a subset of tricks ment
abstraction automatically, but some of them cannot be simply applied due to TVM constraints.
All the experiment results mentioned below, are executed on 2015
'
s 15
'
MacBook equiped with
Intel i7-4770QH CPU. The cache line size should be 64 bytes for all the x86 CPU.
Intel i7-4770QH CPU. The cache line size should be 64 bytes for all the x86 CPU
s
.
"""
###############################################################################
...
...
@@ -230,7 +230,7 @@ print(tvm.lower(s, [A, B, C], simple_mode=True))
###################################################################################################
# Parallel
# -------------
# Futhermore, we can also utilize multi-core processors to paralleliz
e comput
ation.
# Futhermore, we can also utilize multi-core processors to
do the thread-level
parallelization.
s
=
tvm
.
create_schedule
(
C
.
op
)
xo
,
yo
,
xi
,
yi
=
s
[
C
].
tile
(
C
.
op
.
axis
[
0
],
C
.
op
.
axis
[
1
],
bn
,
bn
)
...
...
@@ -251,11 +251,18 @@ evaluator = func.time_evaluator(func.entry_name, tvm.cpu(0), number=50)
opt5_time
=
evaluator
(
a
,
b
,
c
).
mean
print
(
'
Opt5: %f
'
%
opt5_time
)
################################################################################################
# Here is the generated IR after parallelization.
print
(
tvm
.
lower
(
s
,
[
A
,
B
,
C
],
simple_mode
=
True
))
###################################################################################################
##################################################################################################
# Summary
# -------
# After applying the above simple optimizations with only 6 lines of code,
# our generated code can achieve 30% of numpy performance with Apple implemented BLAS.
#
#
We can see TVM is very powerful tool to optimize low level computation.
# our generated code can achieve 30% of
the `
numpy
`
performance with Apple implemented BLAS.
#
Note that the outputs on the webpage reflect the running times on a non-exclusive
#
Docker container, thereby they are *unreliable*. It is highly encouraged to run the
# tutorial by yourself to observe the performance gain acheived by TVM.
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