Skip to content

[Compute-inline] Prefer T.where for reverse compute-inlined block with predicate#17128

Merged
Hzfengsy merged 2 commits intoapache:mainfrom
wrongtest-intellif:improve_rev_inline_predicate
Jul 5, 2024
Merged

[Compute-inline] Prefer T.where for reverse compute-inlined block with predicate#17128
Hzfengsy merged 2 commits intoapache:mainfrom
wrongtest-intellif:improve_rev_inline_predicate

Conversation

@wrongtest-intellif
Copy link
Copy Markdown
Contributor

Hi, we found a kind of corner bad cases for reverse inline primitive. Currently we encode predicate produced by inlining as block compute body, like

with T.block():
    if pred:
        body()

While other primitives (typically cache_write) currently may only respect the predicate of T.where for region estimation. The newly created blocks take the risk of region out-of-bound write accesses, lead to segfaults even in cpu target computations.

The change proposes to use equavalent T.where when possible to make it more consistent with s-tir system, like

with T.block():
    T.where(pred_on_loop_vars)
    body()

@wrongtest-intellif
Copy link
Copy Markdown
Contributor Author

@tvm-bot re-run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants