Skip to content

Commit

Permalink
[TE][CreatePrimFunc] Fix loop carried dependency case with nested blo…
Browse files Browse the repository at this point in the history
…ck levels (#17474)

Nested level primfunc block generation for axis dependencies

Co-authored-by: wrongtest <[email protected]>
  • Loading branch information
wrongtest-intellif and wrongtest authored Nov 14, 2024
1 parent 59a2256 commit 370ec6a
Show file tree
Hide file tree
Showing 3 changed files with 437 additions and 124 deletions.
5 changes: 5 additions & 0 deletions python/tvm/script/ir_builder/tir/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ def _as_range(dom: Union[ir.Range, List[PrimExpr]]) -> ir.Range:
if isinstance(dom, ir.Range):
return dom
if isinstance(dom, (list, tuple)):
from tvm.arith import Analyzer # pylint: disable=import-outside-toplevel

extent = Analyzer().simplify(dom[1] - dom[0])
if isinstance(extent, tir.IntImm):
return ir.Range.from_min_extent(dom[0], extent)
return ir.Range(dom[0], dom[1])
if hasattr(dom, "dtype"):
return ir.Range(IntImm(dom.dtype, 0), dom)
Expand Down
Loading

0 comments on commit 370ec6a

Please sign in to comment.