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

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

Merged

Conversation

wrongtest-intellif
Copy link
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
Contributor Author

@tvm-bot re-run

@Hzfengsy Hzfengsy merged commit 0fc047c into apache:main Jul 5, 2024
19 checks passed
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