Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
7fbc7af
Add wave equation solver on the way to diamond tiling demo
inducer Nov 13, 2019
af82225
Add initial prototype of map_domain and (currently broken) test of di…
inducer Nov 13, 2019
70ee84d
Make placeholder error message Py2-compatible
inducer Nov 14, 2019
3c4c1ff
test_diamond_tiling: Remove split_iname analog
inducer Nov 14, 2019
b61dbcf
Fix diamond tile mapping
inducer Nov 14, 2019
c661031
Make test_diamond_tiling an actual test
inducer Nov 14, 2019
e1ae8cf
Fix handling of reductions in map_domain
inducer Nov 14, 2019
9e77c98
Sync branch with master
nchristensen Feb 1, 2021
da35b59
Update to use new islpy _laign_dim_type parameters
nchristensen Feb 1, 2021
4a69388
add map_stmt_inst_dependencies()
jdsteve2 Apr 9, 2021
9b71b55
(WIP) split inames in dependencies when splitting inames; also remove…
jdsteve2 Apr 9, 2021
6504ae2
don't assert that arg is list in append_mark_to_strings()
jdsteve2 Apr 10, 2021
9baf9fc
create convert_map_to_set() function; set dt=isl.dim_type to make cod…
jdsteve2 Apr 11, 2021
2c2eeb0
change remove_var_from_set() to remove_vars_from_set() and remove mul…
jdsteve2 Apr 11, 2021
53dd6d3
add test for dependency handling during split_iname
jdsteve2 Apr 11, 2021
e9e6bc5
fix flake8 issue
jdsteve2 Apr 11, 2021
e42077e
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 11, 2021
774f430
minor code/comment cleanup realted to dep handling in split_iname
jdsteve2 Apr 11, 2021
7b396b0
rename map_stmt_inst_dependencies()->map_stmt_inst_dependency_maps() …
jdsteve2 Apr 11, 2021
c414b8c
update after renaming map_stmt_inst_dependencies()->map_stmt_inst_dep…
jdsteve2 Apr 11, 2021
66a825f
when removing instructions, remove any new-world dependencies on thos…
jdsteve2 Apr 11, 2021
9aaba11
in assignment_to_subst(), copy the dependencies of the def stmt to al…
jdsteve2 Apr 11, 2021
8263edf
add preliminary test for dep handling in assignment_to_subst()
jdsteve2 Apr 11, 2021
645dae8
fix typo bug
jdsteve2 Apr 13, 2021
134b034
test dep handling during assignment_to_subst when 'within' doesn't ma…
jdsteve2 Apr 13, 2021
036a117
fix parameter in dependencies
jdsteve2 Apr 13, 2021
7824009
add test for dep handling during fix_parameters
jdsteve2 Apr 13, 2021
0816d35
in dependency mapper functions, allow for separate matching of depend…
jdsteve2 Apr 13, 2021
f73c854
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 14, 2021
7e90f39
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 14, 2021
12a9fc6
fix test_split_iname_with_dependencies() after projecting out unused …
jdsteve2 Apr 14, 2021
1907330
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 14, 2021
1217c0f
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 15, 2021
5bc8488
only parse_match if it hasn't already been called
jdsteve2 Apr 15, 2021
91378b5
update dependencies when duplicate_inames() is called
jdsteve2 Apr 15, 2021
83a05f3
test handling of deps during duplicate_inames
jdsteve2 Apr 15, 2021
f07e770
create remove_dim_by_name() func
jdsteve2 Apr 16, 2021
1578bc0
handle dependencies correctly during split_iname when 'within' is not…
jdsteve2 Apr 16, 2021
06fdc7c
test handling of dependencies during split_iname when 'within' is not…
jdsteve2 Apr 16, 2021
92ef56f
one more foldmarker
jdsteve2 Apr 16, 2021
d7b47dd
clarification comment in map_dependency_lists
jdsteve2 Apr 16, 2021
afc42b2
Merge branch 'main' into map-domain
jdsteve2 Apr 16, 2021
e181009
add TODO
jdsteve2 Apr 16, 2021
11d9084
Merge branch 'main' into map-domain
jdsteve2 Apr 17, 2021
8f2fe8d
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Apr 17, 2021
cf4d4f2
fixing merge conflicts
jdsteve2 Apr 17, 2021
714da1e
Merge branch 'map-domain' into add-map-domain-transformation
jdsteve2 Apr 17, 2021
8b0d201
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 17, 2021
47967a3
add test for dep updating during map_domain (even though map_domain d…
jdsteve2 Apr 18, 2021
aef8feb
add foldmarker
jdsteve2 Apr 18, 2021
34fab98
fix bug in map_domain (when aligning second dim type, make sure to us…
jdsteve2 Apr 18, 2021
a325d59
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 18, 2021
18b3f18
update dependencies in map_domain
jdsteve2 Apr 18, 2021
c61d59d
test dependency updating in map_domain
jdsteve2 Apr 18, 2021
34e0da5
change false match condition to 'not id:*'
jdsteve2 Apr 18, 2021
137e7c7
fix bug in map_domain to actually allow instructions with domains ind…
jdsteve2 Apr 19, 2021
399ec46
allow post-transform iname renaming in map_domain to handle case wher…
jdsteve2 Apr 19, 2021
632aafd
create test to compare map_domain result to split_iname result
jdsteve2 Apr 19, 2021
28f5598
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 19, 2021
cb8fb0b
add find_and_rename_dim() function
jdsteve2 Apr 20, 2021
81001ca
in dependency handling within map_domain, handle cases where *only* t…
jdsteve2 Apr 20, 2021
e59e277
add test_map_domain_with_only_partial_dep_pair_affected() to test dep…
jdsteve2 Apr 20, 2021
6fe250d
make helper function _compare_dependencies() to make testing dep hand…
jdsteve2 Apr 20, 2021
0166f8d
slight clarification of comment
jdsteve2 Apr 20, 2021
46ee107
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 20, 2021
9c0c2df
Add map_domain FIXME
inducer Apr 20, 2021
d4f7b9a
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Apr 23, 2021
ab98395
fix flake8 issues
jdsteve2 Apr 23, 2021
743b328
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 23, 2021
6354191
fix flake8 issues
jdsteve2 Apr 23, 2021
7f08ad5
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Apr 23, 2021
f025193
fixing merge conflicts
jdsteve2 Apr 23, 2021
fd762db
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Apr 25, 2021
e666195
fixing merge conflicts
jdsteve2 Apr 25, 2021
796f01e
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Apr 26, 2021
a631be0
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 26, 2021
b71e675
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Apr 27, 2021
f0ef771
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Apr 27, 2021
ff48253
fix bug in map_domain where we attempt to return the same kernel if n…
jdsteve2 May 6, 2021
5e16382
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 May 9, 2021
502e155
add find_and_rename_dim()
jdsteve2 May 17, 2021
003eed1
in map_domain, deal with situation where transform map doesn't includ…
jdsteve2 May 17, 2021
5138b16
test map_domain with situation where transform map doesn't include al…
jdsteve2 May 17, 2021
7c54699
Merge branch 'add-map-domain-transformation' of http://github.com/ind…
jdsteve2 May 17, 2021
5775ee5
fixing merge conflicts
jdsteve2 May 17, 2021
87ca4fd
when checking the overlap condition in map_domain, use the actual set…
jdsteve2 May 17, 2021
fc9d92f
remove duplicate function def
jdsteve2 May 17, 2021
25cea94
in map_domain, ignore statement var name in maps when performing inam…
jdsteve2 May 17, 2021
2d0d346
add move_dim_to_index()
jdsteve2 May 17, 2021
0a3e32e
in map_domain() handle dependencies correctly when the transform map …
jdsteve2 May 17, 2021
71881c8
test to make sure map_domain handles dependencies correctly when the …
jdsteve2 May 17, 2021
fbc8952
be consistent with dt vs dim_type naming: set dt = isl.dim_type, and …
jdsteve2 May 17, 2021
d83a87d
fix flake8 issue
jdsteve2 May 17, 2021
53abcd9
Merge branch 'update-dependencies-during-transformation' of github.co…
jdsteve2 May 17, 2021
572a8c6
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 May 23, 2021
a3809e1
Merge branch 'main' into update-dependencies-during-transformation
jdsteve2 May 23, 2021
92ec240
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 May 23, 2021
34d373e
Merge branch 'update-dependencies-during-transformation' of https://g…
jdsteve2 May 24, 2021
00f604d
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 May 27, 2021
4d3ead5
fix merge conflicts (remove statements calling find_unsatisfied_deps …
jdsteve2 May 27, 2021
2217335
make sure dep checking works even when find_unsatisfied_deps doesn't …
jdsteve2 May 27, 2021
1b52640
remove debugging assertion
jdsteve2 Jun 1, 2021
dbc8858
handle case where subst definition is removed, was both a depender an…
jdsteve2 Jun 2, 2021
7075f7e
test dep handling during assignment_to_subst in case where subst defi…
jdsteve2 Jun 2, 2021
1700007
remove old code
jdsteve2 Jun 2, 2021
7b58c4f
add option to find_and_rename_dim to assert that old_name exists
jdsteve2 Jun 2, 2021
0e1b09c
update dependencies in rename_iname()
jdsteve2 Jun 2, 2021
b38681c
test updating of dependencies during rename_iname()
jdsteve2 Jun 2, 2021
e59fe5f
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jun 2, 2021
89e597b
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Jun 2, 2021
482341f
deal with case where someone gives us a StackMatch when mapping depen…
jdsteve2 Jun 2, 2021
f4d5a1a
fix typo
jdsteve2 Jun 2, 2021
3e498fa
make test_rename_inames_with_dependencies() actually test the case wh…
jdsteve2 Jun 2, 2021
fc38556
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jun 6, 2021
6e37fda
fix merge conflicts
jdsteve2 Jun 6, 2021
4631f51
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jun 10, 2021
1fca3ad
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Jun 10, 2021
9854411
add v2 deps to barriers (still need to add deps on barriers)
jdsteve2 Jun 10, 2021
fc626a1
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jun 10, 2021
03623f4
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Jun 10, 2021
0f09b36
first attempt at handling dependencies during prefetch
jdsteve2 Jun 11, 2021
2f7c6bf
fix a couple bugs in precompute dep handling
jdsteve2 Jun 11, 2021
e307445
test dep handling in add_prefetch
jdsteve2 Jun 11, 2021
1ed5ee9
fix merge conflict
jdsteve2 Jul 21, 2021
7faa802
add for_each_kernel decorator to map_domain
jdsteve2 Jul 21, 2021
a5bdc98
after callables update, use knl[loopy_kernel] where needed
jdsteve2 Jul 21, 2021
dd7cbea
remove rename_after arg in map_domain, which is no longer necessary d…
jdsteve2 Jul 21, 2021
4052fb9
remove rename_after arg in map_domain, which is no longer necessary d…
jdsteve2 Jul 21, 2021
86bdb05
fix merge conflicts and issues resulting from kernel callables update
jdsteve2 Jul 21, 2021
dc634d3
disable new dep updating during precompute
jdsteve2 Jul 21, 2021
248f622
disable test for new dep updating during precompute
jdsteve2 Jul 21, 2021
3c5274a
remove unnessary kernel names
jdsteve2 Jul 21, 2021
1919499
eliminate no-longer-necessary rename_after arg in map_domain
jdsteve2 Jul 21, 2021
c5172b9
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jul 26, 2021
bd3e6aa
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Jul 26, 2021
2b78b9d
Merge branch 'add-map-domain-transformation' into update-dependencies…
jdsteve2 Jul 26, 2021
424d3fa
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Aug 2, 2021
ca05163
Merge branch 'check-new-dependencies-against-sio' into add-map-domain…
jdsteve2 Aug 2, 2021
8ea67d3
clarify comments for dependency updating functions
jdsteve2 Aug 4, 2021
2a408b7
fix merge conflicts
jdsteve2 Aug 4, 2021
8a40d4e
move find_and_rename_dim into iname.py since that's the only place it…
jdsteve2 Aug 5, 2021
a54e908
fixing merge conflicts
jdsteve2 Aug 5, 2021
2c6628c
fixing significant merge conflicts when giving update-deps-during-ran…
jdsteve2 Aug 5, 2021
3fa0a83
make var name usage consistent with dt vs dim_type
jdsteve2 Aug 10, 2021
4b2bc1d
fix merge conflicts
jdsteve2 Aug 10, 2021
4b5f09f
fixing merge conflicts
jdsteve2 Aug 10, 2021
8844f30
fix merge conflicts
jdsteve2 Aug 11, 2021
0202e78
in map_domain, eliminate _check_overlap_condition_for_domain function…
jdsteve2 Aug 12, 2021
75609a0
Merge branch 'map-domain-transformation-v2' into update-dependencies-…
jdsteve2 Aug 13, 2021
0c0ef6d
in map_domain, remove within from dependency updating
jdsteve2 Aug 13, 2021
dd7a7e2
remove fixme that has been fixed
jdsteve2 Aug 13, 2021
8dd5601
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Aug 13, 2021
08fc751
use dim_type to abbreviate isl.dim_type class and dt to refer to a pa…
jdsteve2 Aug 13, 2021
76bec8b
use dim_type to abbreviate isl.dim_type class and dt to refer to a pa…
jdsteve2 Aug 13, 2021
b2975a7
fix merge conflicts in map_domain related to renaming of isl_map->tra…
jdsteve2 Aug 14, 2021
964cc3a
in map_domain, rename isl_map_marked->transform_map_marked
jdsteve2 Aug 14, 2021
f618567
fix merge conflicts from map_domain changes
jdsteve2 Aug 28, 2021
6e0b4af
fix merge conflicts
jdsteve2 Sep 17, 2021
8632445
add TODO to figure out source of error
jdsteve2 Sep 17, 2021
046db83
fix merge conflicts related to new dependency creation/checking machi…
jdsteve2 Sep 17, 2021
bea3dd2
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Sep 17, 2021
b5a257c
Merge branch 'check-new-dependencies-against-sio' into update-depende…
jdsteve2 Sep 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion loopy/schedule/checker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,48 @@ def reorder_dims_by_name(
return new_set


def move_dim_to_index(
isl_map, dim_name, dt, destination_idx):
"""Return an isl map with the specified dimension moved to
the specified index.

:arg isl_map: A :class:`islpy.Map`.

:arg dim_name: A :class:`str` specifying the name of the dimension
to be moved.

:arg dt: A :class:`islpy.dim_type`, i.e., an :class:`int`,
specifying the type of dimension to be reordered.

:arg destination_idx: A :class:`int` specifying the desired dimension
index of the dimention to be moved.

:returns: An :class:`islpy.Map` matching `isl_map` with the
specified dimension moved to the specified index.

"""

assert dt != dim_type.param

layover_dt = dim_type.param
layover_dim_len = len(isl_map.get_var_names(layover_dt))

current_idx = isl_map.find_dim_by_name(dt, dim_name)
if current_idx == -1:
raise ValueError("Dimension name %s not found in dim type %s of %s"
% (dim_name, dt, isl_map))

if current_idx != destination_idx:
# First move to other dim because isl is stupid
new_map = isl_map.move_dims(
layover_dt, layover_dim_len, dt, current_idx, 1)
# Now move it where we actually want it
new_map = new_map.move_dims(
dt, destination_idx, layover_dt, layover_dim_len, 1)

return new_map


def move_dims_by_name(
isl_obj, dst_type, dst_pos_start, src_type, dim_names):
dst_pos = dst_pos_start
Expand Down Expand Up @@ -197,7 +239,6 @@ def append_mark_to_isl_map_var_names(old_isl_map, dt, mark):


def append_mark_to_strings(strings, mark):
assert isinstance(strings, list)
return [s+mark for s in strings]


Expand Down Expand Up @@ -340,6 +381,14 @@ def sorted_union_of_names_in_isl_sets(
return sorted(inames)


def convert_map_to_set(isl_map):
n_in_dims = len(isl_map.get_var_names(dim_type.in_))
n_out_dims = len(isl_map.get_var_names(dim_type.out))
return isl_map.move_dims(
dim_type.in_, n_in_dims, dim_type.out, 0, n_out_dims
).domain(), n_in_dims, n_out_dims


def create_symbolic_map_from_tuples(
tuple_pairs_with_domains,
space,
Expand Down
27 changes: 27 additions & 0 deletions loopy/transform/add_barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,37 @@ def add_barrier(kernel, insn_before="", insn_after="", id_based_on=None,

new_kernel = kernel.copy(instructions=kernel.instructions + [barrier_to_add])
if insn_after is not None:
# TODO this should be a new dependency
new_kernel = add_dependency(kernel=new_kernel,
insn_match=insn_after,
depends_on="id:"+id)

for insn_before_id in insns_before:
# make v2 dep:
from loopy.schedule.checker.utils import (
append_mark_to_strings,
make_dep_map,
)
from loopy.schedule.checker.schedule import BEFORE_MARK
inames_before = new_kernel.id_to_insn[insn_before_id].within_inames
inames_before_marked = append_mark_to_strings(
inames_before, BEFORE_MARK)

inames_after = set(within_inames) if within_inames else set()

shared_inames = inames_after & inames_before

in_space_str = ", ".join(inames_before_marked)
out_space_str = ", ".join(inames_after)
constraint_str = " and ".join([
"{0}{1} = {0}".format(iname, BEFORE_MARK) for iname in shared_inames])

dep_v2 = make_dep_map(
f"{{ [{in_space_str}] -> [{out_space_str}] : {constraint_str} }}",
knl_with_domains=new_kernel)
new_kernel = add_dependency(
new_kernel, "id:"+id, ("id:"+insn_before_id, dep_v2))

return new_kernel

# }}}
Expand Down
Loading