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
b3375702
Commit
b3375702
authored
Jan 07, 2019
by
Li-Wen Chang
Committed by
Tianqi Chen
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functionality to optionally disable Select rewriting (#2385)
parent
5d71e881
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
include/tvm/build_module.h
+4
-0
python/tvm/build_module.py
+4
-2
src/codegen/build_module.cc
+6
-2
No files found.
include/tvm/build_module.h
View file @
b3375702
...
...
@@ -223,6 +223,9 @@ class BuildConfigNode : public Node {
/*! \brief Whether to instrument loads and stores with check for out of the bounds. */
bool
instrument_bound_checkers
=
false
;
/*! \brief Whether to disable select rewriting. */
bool
disable_select_rewriting
=
false
;
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
v
->
Visit
(
"data_alignment"
,
&
data_alignment
);
v
->
Visit
(
"offset_factor"
,
&
offset_factor
);
...
...
@@ -236,6 +239,7 @@ class BuildConfigNode : public Node {
v
->
Visit
(
"partition_const_loop"
,
&
partition_const_loop
);
v
->
Visit
(
"dump_pass_ir"
,
&
dump_pass_ir
);
v
->
Visit
(
"instrument_bound_checkers"
,
&
instrument_bound_checkers
);
v
->
Visit
(
"disable_select_rewriting"
,
&
disable_select_rewriting
);
}
static
constexpr
const
char
*
_type_key
=
"BuildConfig"
;
...
...
python/tvm/build_module.py
View file @
b3375702
...
...
@@ -126,7 +126,8 @@ class BuildConfig(NodeBase):
"restricted_func"
:
True
,
"double_buffer_split_loop"
:
1
,
"dump_pass_ir"
:
False
,
"instrument_bound_checkers"
:
False
"instrument_bound_checkers"
:
False
,
"disable_select_rewriting"
:
False
}
_dump_ir
=
DumpIR
()
...
...
@@ -368,7 +369,8 @@ def lower(sch,
stmt
=
ir_pass
.
Simplify
(
stmt
)
stmt
=
ir_pass
.
LowerStorageAccessInfo
(
stmt
)
stmt
=
ir_pass
.
RemoveNoOp
(
stmt
)
stmt
=
ir_pass
.
RewriteUnsafeSelect
(
stmt
)
if
not
cfg
.
disable_select_rewriting
:
stmt
=
ir_pass
.
RewriteUnsafeSelect
(
stmt
)
for
f
in
lower_phase3
:
stmt
=
f
(
stmt
)
# Instrument BoundCheckers
...
...
src/codegen/build_module.cc
View file @
b3375702
...
...
@@ -381,7 +381,9 @@ Stmt BuildStmt(Schedule sch,
stmt
=
ir
::
Simplify
(
stmt
);
stmt
=
ir
::
LowerStorageAccessInfo
(
stmt
);
stmt
=
ir
::
RemoveNoOp
(
stmt
);
stmt
=
ir
::
RewriteUnsafeSelect
(
stmt
);
if
(
!
(
config
->
disable_select_rewriting
))
stmt
=
ir
::
RewriteUnsafeSelect
(
stmt
);
if
(
config
->
instrument_bound_checkers
)
stmt
=
ir
::
InstrumentBoundCheckers
(
stmt
);
...
...
@@ -534,7 +536,9 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
p
->
stream
<<
"restricted_func="
<<
op
->
restricted_func
<<
", "
;
p
->
stream
<<
"detect_global_barrier="
<<
op
->
detect_global_barrier
<<
", "
;
p
->
stream
<<
"partition_const_loop="
<<
op
->
partition_const_loop
<<
", "
;
p
->
stream
<<
"dump_pass_ir="
<<
op
->
dump_pass_ir
;
p
->
stream
<<
"dump_pass_ir="
<<
op
->
dump_pass_ir
<<
", "
;
p
->
stream
<<
"instrument_bound_checkers="
<<
op
->
instrument_bound_checkers
<<
", "
;
p
->
stream
<<
"disable_select_rewriting="
<<
op
->
disable_select_rewriting
;
p
->
stream
<<
")"
;
});
...
...
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