Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
loopy
Commits
e2e44a1d
Commit
e2e44a1d
authored
13 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Check for non-use of hardware axes.
parent
e606dd46
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
MEMO
+2
-3
2 additions, 3 deletions
MEMO
loopy/schedule.py
+35
-7
35 additions, 7 deletions
loopy/schedule.py
with
37 additions
and
10 deletions
MEMO
+
2
−
3
View file @
e2e44a1d
...
...
@@ -6,10 +6,7 @@ For writeup:
TODO: Reimplement forced lengths
TODO: Try, fix reg. prefetch (DG example) / CSEs
ILP and reg. prefetch interact!
TODO: Custom reductions per red. axis
TODO: Functions
TODO: Common subexpressions
TODO: Array common subexpressions (shared and private!)
TODO: ILP arrays
FIXME: support non-reductive dimensions (what did I mean here?)
FIXME: write names should be assigned during scheduling
...
...
@@ -96,6 +93,8 @@ TODO
Dealt with
^^^^^^^^^^
- Check for non-use of hardware axes
- Slab decomposition for parallel dimensions
- implement at the outermost nesting level regardless
- bound *all* tagged inames
...
...
This diff is collapsed.
Click to expand it.
loopy/schedule.py
+
35
−
7
View file @
e2e44a1d
...
...
@@ -100,14 +100,44 @@ def realize_reduction(kernel, inames=None, reduction_tag=None):
def
check_double_use_of_hw_dimensions
(
kernel
):
from
loopy.kernel
import
UniqueTag
def
check_non_use_of_hw_axes
(
kernel
):
group_size
,
local_size
=
kernel
.
get_grid_sizes_as_exprs
()
group_axes
=
set
(
range
(
len
(
group_size
)))
local_axes
=
set
(
range
(
len
(
local_size
)))
from
loopy.kernel
import
TAG_LOCAL_IDX
,
TAG_AUTO_LOCAL_IDX
,
TAG_GROUP_IDX
for
insn
in
kernel
.
instructions
:
group_axes_used
=
set
()
local_axes_used
=
set
()
for
iname
in
insn
.
all_inames
():
tag
=
kernel
.
iname_to_tag
.
get
(
iname
)
if
isinstance
(
tag
,
TAG_LOCAL_IDX
):
local_axes_used
.
add
(
tag
.
axis
)
elif
isinstance
(
tag
,
TAG_GROUP_IDX
):
group_axes_used
.
add
(
tag
.
axis
)
elif
isinstance
(
tag
,
TAG_AUTO_LOCAL_IDX
):
raise
RuntimeError
(
"
auto local tag encountered
"
)
if
group_axes
!=
group_axes_used
:
raise
RuntimeError
(
"
instruction
'
%s
'
does not use all hw group axes
"
)
if
local_axes
!=
local_axes_used
:
raise
RuntimeError
(
"
instruction
'
%s
'
does not use all hw local axes
"
)
def
check_double_use_of_hw_axes
(
kernel
):
from
loopy.kernel
import
HardwareParallelTag
for
insn
in
kernel
.
instructions
:
insn_tag_keys
=
set
()
for
iname
in
insn
.
all_inames
():
tag
=
kernel
.
iname_to_tag
.
get
(
iname
)
if
isinstance
(
tag
,
Unique
Tag
):
if
isinstance
(
tag
,
HardwareParallel
Tag
):
key
=
tag
.
key
if
key
in
insn_tag_keys
:
raise
RuntimeError
(
"
instruction
'
%s
'
has two
"
...
...
@@ -669,9 +699,7 @@ def insert_barriers(kernel, schedule, level=0):
def
generate_loop_schedules
(
kernel
):
kernel
=
realize_reduction
(
kernel
)
check_double_use_of_hw_dimensions
(
kernel
)
check_double_use_of_hw_axes
(
kernel
)
kernel
=
adjust_local_temp_var_storage
(
kernel
)
# {{{ check that all CSEs have been realized
...
...
@@ -687,8 +715,8 @@ def generate_loop_schedules(kernel):
# }}}
kernel
=
add_automatic_dependencies
(
kernel
)
kernel
=
assign_automatic_axes
(
kernel
)
check_non_use_of_hw_axes
(
kernel
)
for
gen_sched
in
generate_loop_schedules_internal
(
kernel
):
gen_sched
,
owed_barriers
=
insert_barriers
(
kernel
,
gen_sched
)
...
...
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