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
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
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
Ben Sepanski
loopy
Commits
b47bdf9d
Commit
b47bdf9d
authored
8 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Merge branch 'remove-ambigiuous-scheduling-warning' into 'master'"
This reverts merge request
!62
parent
0107d077
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
doc/tutorial.rst
+9
-4
9 additions, 4 deletions
doc/tutorial.rst
loopy/schedule/__init__.py
+23
-3
23 additions, 3 deletions
loopy/schedule/__init__.py
with
32 additions
and
7 deletions
doc/tutorial.rst
+
9
−
4
View file @
b47bdf9d
...
...
@@ -456,8 +456,8 @@ control is the nesting of loops. For example, should the *i* loop be nested
around the *j* loop, or the other way around, in the following simple
zero-fill kernel?
It turns out that Loopy will choose a loop nesting for us, but it
might be
ambiguous. Consider
the following code
:
It turns out that Loopy will
typically
choose a loop nesting for us, but it
does not like doing so. Loo.py will react to
the following code
.. doctest::
...
...
@@ -467,8 +467,13 @@ ambiguous. Consider the following code:
... a[i,j] = 0
... """)
Both nestings of the inames `i` and `j` result in a correct kernel.
This ambiguity can be resolved:
By saying::
LoopyWarning: kernel scheduling was ambiguous--more than one schedule found, ignoring
And by picking one of the possible loop orderings at random.
The warning (and the nondeterminism it warns about) is easily resolved:
.. doctest::
...
...
This diff is collapsed.
Click to expand it.
loopy/schedule/__init__.py
+
23
−
3
View file @
b47bdf9d
...
...
@@ -1959,7 +1959,7 @@ def get_one_scheduled_kernel(kernel):
if
CACHING_ENABLED
:
try
:
result
=
schedule_cache
[
sched_cache_key
]
result
,
ambiguous
=
schedule_cache
[
sched_cache_key
]
logger
.
debug
(
"
%s: schedule cache hit
"
%
kernel
.
name
)
from_cache
=
True
...
...
@@ -1967,18 +1967,38 @@ def get_one_scheduled_kernel(kernel):
pass
if
not
from_cache
:
ambiguous
=
False
kernel_count
=
0
from
time
import
time
start_time
=
time
()
logger
.
info
(
"
%s: schedule start
"
%
kernel
.
name
)
result
=
next
(
iter
(
generate_loop_schedules
(
kernel
)))
for
scheduled_kernel
in
generate_loop_schedules
(
kernel
):
kernel_count
+=
1
if
kernel_count
==
1
:
# use the first schedule
result
=
scheduled_kernel
if
kernel_count
==
2
:
ambiguous
=
True
break
logger
.
info
(
"
%s: scheduling done after %.2f s
"
%
(
kernel
.
name
,
time
()
-
start_time
))
if
ambiguous
:
from
warnings
import
warn
from
loopy.diagnostic
import
LoopyWarning
warn
(
"
scheduling for kernel
'
%s
'
was ambiguous--more than one
"
"
schedule found, ignoring
"
%
kernel
.
name
,
LoopyWarning
,
stacklevel
=
2
)
if
CACHING_ENABLED
and
not
from_cache
:
schedule_cache
[
sched_cache_key
]
=
result
schedule_cache
[
sched_cache_key
]
=
result
,
ambiguous
return
result
...
...
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