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
1229e2d0
Commit
1229e2d0
authored
7 years ago
by
Tianqi Chen
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PASS] More reliable error message for lower warp (#1065)
parent
18db02a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pass/lower_warp_memory.cc
+15
-8
15 additions, 8 deletions
src/pass/lower_warp_memory.cc
with
15 additions
and
8 deletions
src/pass/lower_warp_memory.cc
+
15
−
8
View file @
1229e2d0
...
...
@@ -94,9 +94,13 @@ class WarpStoreCoeffFinder : private IRVisitor {
CHECK_EQ
(
m
.
size
(),
2U
)
<<
"LowerWarpMemory failed due to store index="
<<
index
;
int
coeff
;
CHECK
(
arith
::
GetConstInt
(
ir
::
Simplify
(
m
[
0
]),
&
coeff
)
&&
coeff
>
0
)
Expr
mcoeff
=
ir
::
Simplify
(
m
[
0
]);
CHECK
(
arith
::
GetConstInt
(
mcoeff
,
&
coeff
)
&&
coeff
>
0
)
<<
"LowerWarpMemory failed due to store index="
<<
index
<<
", require positive constant coefficient on warp index"
;
<<
", require positive constant coefficient on warp index "
<<
warp_index_
<<
" but get "
<<
mcoeff
;
if
(
warp_coeff_
!=
0
)
{
CHECK_EQ
(
warp_coeff_
,
coeff
)
<<
"LowerWarpMemory failed due to two different store coefficient to warp index"
;
...
...
@@ -129,11 +133,6 @@ class WarpIndexFinder : private IRVisitor {
}
private
:
void
Visit
(
const
NodeRef
&
node
)
final
{
if
(
warp_index_
.
defined
())
return
;
IRVisitor
::
Visit
(
node
);
}
/// Visitor implementation
void
Visit_
(
const
AttrStmt
*
op
)
final
{
if
(
op
->
attr_key
==
attr
::
thread_extent
)
{
...
...
@@ -145,7 +144,15 @@ class WarpIndexFinder : private IRVisitor {
<<
"Expect threadIdx.x 's size to be equal to warp size("
<<
warp_size_
<<
")"
<<
" to enable warp memory"
<<
" but get "
<<
op
->
value
<<
" instead"
;
warp_index_
=
iv
;
if
(
warp_index_
.
defined
())
{
CHECK
(
warp_index_
.
same_as
(
iv
))
<<
"Find two instance of "
<<
warp_index_
->
thread_tag
<<
" in the same kernel. "
<<
"Please create it using thread_axis once and reuse the axis "
<<
"across multiple binds in the same kernel"
;
}
else
{
warp_index_
=
iv
;
}
}
}
IRVisitor
::
Visit_
(
op
);
...
...
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