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
00872d1d
Commit
00872d1d
authored
13 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Change label syntax. Add syntax for forced iname deps.
parent
a1a552c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MEMO
+16
-8
16 additions, 8 deletions
MEMO
loopy/kernel.py
+11
-6
11 additions, 6 deletions
loopy/kernel.py
test/test_matmul.py
+1
-1
1 addition, 1 deletion
test/test_matmul.py
with
28 additions
and
15 deletions
MEMO
+
16
−
8
View file @
00872d1d
...
...
@@ -37,26 +37,30 @@ TODO: variable shuffle detection
Things to consider
^^^^^^^^^^^^^^^^^^
- implemented_domain may end up being smaller than requested in cse
evaluations--check that!
- Depedencies are pointwise for shared loop dimensions
and global over non-shared ones (between dependent and ancestor)
- multiple insns could fight over which iname gets local axis 0
-> complicated optimization problem
- Every loop in loopy is opened at most once.
Too restrictive?
- Loop bounds currently may not depend on parallel dimensions
Does it make sense to relax this?
TODO
^^^^
- implemented_domain may end up being smaller than requested in cse
evaluations--check that!
- Parallel dimension splitting/merging via tags
- FIXME: Deal with insns losing a seq iname dep in a CSE realization
a <- cse(reduce(stuff))
- Every loop in loopy is opened at most once.
- reimplement add_prefetch
- user interface for dim length prescription
...
...
@@ -71,13 +75,17 @@ TODO
- Sharing of checks across ILP instances
- Loop bounds currently may not depend on parallel dimensions
Does it make sense to relax this?
- Some things involving CSEs might be impossible to schedule
a[i,j] = cse(b[i]) * cse(c[j])
- Flag, exploit idempotence
Dealt with
^^^^^^^^^^
- make syntax for explicit loop dependencies
- Make syntax for iname dependencies
- make syntax for insn dependencies
- Implement get_problems()
...
...
This diff is collapsed.
Click to expand it.
loopy/kernel.py
+
11
−
6
View file @
00872d1d
...
...
@@ -404,15 +404,17 @@ class LoopKernel(Record):
"""
import
re
LABEL_DEP_RE
=
re
.
compile
(
r
"
^(?:\{(?P<label>\w+)\})?
"
r
"
^\s*(?:(?P<label>\w+):)?
"
"
\s*(?:\[(?P<iname_deps>[\s\w,]+)\])?
"
"
\s*(?P<lhs>.+)\s*=\s*(?P<rhs>.+?)\s*?
"
"
(?:\:\s*(?P<deps>[\s\w,]+))?$
"
"
(?:\:\s*(?P<
insn_
deps>[\s\w,]+))?$
"
)
def
parse_if_necessary
(
insn
):
from
pymbolic
import
parse
deps
=
[]
insn_deps
=
[]
forced_iname_deps
=
[]
label
=
"
insn
"
if
isinstance
(
insn
,
Instruction
):
...
...
@@ -425,8 +427,10 @@ class LoopKernel(Record):
groups
=
label_dep_match
.
groupdict
()
if
groups
[
"
label
"
]
is
not
None
:
label
=
groups
[
"
label
"
]
if
groups
[
"
deps
"
]
is
not
None
:
deps
=
[
dep
.
strip
()
for
dep
in
groups
[
"
deps
"
].
split
(
"
,
"
)]
if
groups
[
"
insn_deps
"
]
is
not
None
:
insn_deps
=
[
dep
.
strip
()
for
dep
in
groups
[
"
insn_deps
"
].
split
(
"
,
"
)]
if
groups
[
"
iname_deps
"
]
is
not
None
:
forced_iname_deps
=
[
dep
.
strip
()
for
dep
in
groups
[
"
iname_deps
"
].
split
(
"
,
"
)]
lhs
=
parse
(
groups
[
"
lhs
"
])
from
loopy.symbolic
import
FunctionToPrimitiveMapper
...
...
@@ -434,7 +438,8 @@ class LoopKernel(Record):
return
Instruction
(
id
=
self
.
make_unique_instruction_id
(
insns
,
based_on
=
label
),
insn_deps
=
deps
,
insn_deps
=
insn_deps
,
forced_iname_deps
=
forced_iname_deps
,
assignee
=
lhs
,
expression
=
rhs
)
if
isinstance
(
domain
,
str
):
...
...
This diff is collapsed.
Click to expand it.
test/test_matmul.py
+
1
−
1
View file @
00872d1d
...
...
@@ -203,7 +203,7 @@ def test_plain_matrix_mul_new_ui(ctx_factory):
knl
=
lp
.
LoopKernel
(
ctx
.
devices
[
0
],
"
[n] -> {[i,j,k]: 0<=i,j,k<n}
"
,
[
"
{
label
}
c[i, j] = sum_float32(k, cse(a[i, k], lhsmat)*cse(b[k, j], rhsmat))
"
"
label
:
c[i, j] = sum_float32(k, cse(a[i, k], lhsmat)*cse(b[k, j], rhsmat))
"
],
[
lp
.
ArrayArg
(
"
a
"
,
dtype
,
shape
=
(
n
,
n
),
order
=
order
),
...
...
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