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

fix[next][dace]: Fix for GPU illegal memory access #1463

Closed
wants to merge 3 commits into from

Conversation

edopao
Copy link
Contributor

@edopao edopao commented Feb 19, 2024

Add check for all iterator indices when performing shift inside lift expression in neighbor reduction. Baseline was only checking the index in the neighbor dimension, which caused an illegal memory access in GPU execution.

For example, provided this ITIR:
neighbors(C2Eₒ, (↑(λ(__arg0) → cast_(·__arg0, float64)))(⟪Koffₒ, -1ₒ⟫(__stencil_arg2))))

we now check validity of both neighbor index (C2E) and cartesian shift (Koff). The unrolled ITIR (which was working) is actually doing the same.

@edopao
Copy link
Contributor Author

edopao commented Feb 21, 2024

This change is not required. The crash is caused by a bug in the stencil program. The bug was caused by the assumption of cyclic access for out-of-boundary array access. More specifically, a vertical offset Koff[-1] was applied without limiting the closure domain to start from index 1. Setting vertical_start=1 in the stencil program solves the problem

@edopao edopao closed this Feb 21, 2024
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.

1 participant