Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[next][dace]: Add more debug info to DaCe #1384

Merged
merged 38 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
caebdff
Add more debug info to DaCe
kotsaloscv Nov 7, 2023
f14d091
Merge branch 'main' into more_debinfo
kotsaloscv Nov 27, 2023
bebb122
Add more debug info to DaCe
kotsaloscv Nov 27, 2023
7eeaddb
Add more debug info to DaCe : WIP
kotsaloscv Nov 27, 2023
7447807
Add more debug info to DaCe : WIP
kotsaloscv Nov 29, 2023
6d89149
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Nov 29, 2023
16bc489
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Nov 30, 2023
0ed8090
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
3e38756
merge main
kotsaloscv Dec 4, 2023
0b1fe1a
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
55abb29
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
54dd79d
merge main
kotsaloscv Dec 5, 2023
774b2f5
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
1622866
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
7baedb8
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
223de4e
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
6c636ae
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
93fcb14
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
d6da4ab
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
8460c67
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
5632def
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
b59fd83
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
68dde06
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
a1a91c4
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
1ed9764
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
371dc36
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
bb880dd
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
e0a254f
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
ea2f672
merge main
kotsaloscv Jan 4, 2024
50f96a8
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 4, 2024
9c9c8ae
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
6fb28a1
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
3f4e9d1
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
b29bc5f
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
1a2e978
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
bf33827
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
616a833
merge main
kotsaloscv Jan 23, 2024
371b1da
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 23, 2024
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
Prev Previous commit
Next Next commit
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
…tir, and from itir to the SDFG): Preserve Location through Visitors [WIP]
kotsaloscv committed Dec 13, 2023
commit b59fd8366e9fdcbafa847cb639a5c794ae76d2da
12 changes: 10 additions & 2 deletions src/gt4py/next/iterator/transforms/cse.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,13 @@
import operator
import typing

from gt4py.eve import NodeTranslator, NodeVisitor, SymbolTableTrait, VisitorWithSymbolTableTrait
from gt4py.eve import (
NodeTranslator,
NodeVisitor,
SymbolTableTrait,
VisitorWithSymbolTableTrait,
traits,
)
from gt4py.eve.utils import UIDGenerator
from gt4py.eve.visitors import PreserveLocation
from gt4py.next.iterator import ir
@@ -73,7 +79,9 @@ def _is_collectable_expr(node: ir.Node) -> bool:


@dataclasses.dataclass
class CollectSubexpressions(VisitorWithSymbolTableTrait, NodeVisitor):
class CollectSubexpressions(
traits.PreserveLocationWithSymbolTableTrait, VisitorWithSymbolTableTrait, NodeVisitor
):
@dataclasses.dataclass
class SubexpressionData:
#: A list of node ids with equal hash and a set of collected child subexpression ids
1 change: 0 additions & 1 deletion src/gt4py/next/iterator/transforms/eta_reduction.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ def visit_Lambda(self, node: ir.Lambda) -> ir.Node:
for p, a in zip(node.params, node.expr.args)
)
):
node.expr.fun.location = node.location
return self.visit(node.expr.fun)

return self.generic_visit(node)
6 changes: 3 additions & 3 deletions src/gt4py/next/iterator/transforms/fuse_maps.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,9 @@ def _is_reduce(node: ir.Node) -> TypeGuard[ir.FunCall]:


@dataclasses.dataclass(frozen=True)
class FuseMaps(traits.VisitorWithSymbolTableTrait, NodeTranslator):
class FuseMaps(
traits.PreserveLocationWithSymbolTableTrait, traits.VisitorWithSymbolTableTrait, NodeTranslator
):
"""
Fuses nested `map_`s.

@@ -125,12 +127,10 @@ def visit_FunCall(self, node: ir.FunCall, **kwargs):
return ir.FunCall(
fun=ir.FunCall(fun=ir.SymRef(id="map_"), args=[new_op]),
args=new_args,
location=node.location,
)
else: # _is_reduce(node)
return ir.FunCall(
fun=ir.FunCall(fun=ir.SymRef(id="reduce"), args=[new_op, node.fun.args[1]]),
args=new_args,
location=node.location,
)
return node
6 changes: 6 additions & 0 deletions src/gt4py/next/iterator/transforms/global_tmps.py
Original file line number Diff line number Diff line change
@@ -267,6 +267,7 @@ def split_closures(node: ir.FencilDefinition, offset_provider) -> FencilWithTemp
stencil=stencil,
output=im.ref(tmp_sym.id),
inputs=[closure_param_arg_mapping[param.id] for param in lift_expr.args], # type: ignore[attr-defined]
location=current_closure.location,
)
)

@@ -294,6 +295,7 @@ def split_closures(node: ir.FencilDefinition, offset_provider) -> FencilWithTemp
output=current_closure.output,
inputs=current_closure.inputs
+ [ir.SymRef(id=sym.id) for sym in extracted_lifts.keys()],
location=current_closure.location,
)
)
else:
@@ -307,6 +309,7 @@ def split_closures(node: ir.FencilDefinition, offset_provider) -> FencilWithTemp
+ [ir.Sym(id=tmp.id) for tmp in tmps]
+ [ir.Sym(id=AUTO_DOMAIN.fun.id)], # type: ignore[attr-defined] # value is a global constant
closures=list(reversed(closures)),
location=node.location,
),
params=node.params,
tmps=[Temporary(id=tmp.id) for tmp in tmps],
@@ -333,6 +336,7 @@ def prune_unused_temporaries(node: FencilWithTemporaries) -> FencilWithTemporari
function_definitions=node.fencil.function_definitions,
params=[p for p in node.fencil.params if p.id not in unused_tmps],
closures=closures,
location=node.fencil.location,
),
params=node.params,
tmps=[tmp for tmp in node.tmps if tmp.id not in unused_tmps],
@@ -453,6 +457,7 @@ def update_domains(node: FencilWithTemporaries, offset_provider: Mapping[str, An
stencil=closure.stencil,
output=closure.output,
inputs=closure.inputs,
location=closure.location,
)
else:
domain = closure.domain
@@ -505,6 +510,7 @@ def update_domains(node: FencilWithTemporaries, offset_provider: Mapping[str, An
function_definitions=node.fencil.function_definitions,
params=node.fencil.params[:-1], # remove `_gtmp_auto_domain` param again
closures=list(reversed(closures)),
location=node.fencil.location,
),
params=node.params,
tmps=node.tmps,
1 change: 0 additions & 1 deletion src/gt4py/next/iterator/transforms/inline_lifts.py
Original file line number Diff line number Diff line change
@@ -159,7 +159,6 @@ def visit_FunCall(
ir.FunCall(
fun=self.generic_visit(node.fun, is_scan_pass_context=_is_scan(node), **kwargs),
args=self.generic_visit(node.args, **kwargs),
location=node.location,
)
if recurse
else node