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

[cartesian]: Mitigation for K offset write #1684

Open
1 task
FlorianDeconinck opened this issue Oct 9, 2024 · 2 comments
Open
1 task

[cartesian]: Mitigation for K offset write #1684

FlorianDeconinck opened this issue Oct 9, 2024 · 2 comments
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids.

Comments

@FlorianDeconinck
Copy link
Contributor

FlorianDeconinck commented Oct 9, 2024

The new write offset in K means we can go out of bounds without the system being able to warn about it since extent calculation won't be able to cover those access.

Think about the degenerate case of

index = some_bad_math_that_gives_back_2349082093840
field[0, 0, index] = value

This was an iron rule for GT4Py that we now allow to be broken so we can match patterns seen regularly in physics.

To mitigate the issue, we should introduce on DEBUG a bound check, drop before every K offset write which should error out cleanly.


  • On DEBUG generate a check for bounds before K offset write
@romanc

This comment has been minimized.

havogt pushed a commit that referenced this issue Jan 10, 2025
The `interval` analysis in the unit test
`test_K_offset_write_conditional` fails to catch a mistake in the code
that leads to a race condition.

Work:
- Fix the bad interval
- Remove not needed restriction on CUDA version

Further work to fix the underlying problem and the larger issue of bound
check on variable indexing is covered
[here](#1684) and
[there](#1754)
edopao added a commit that referenced this issue Jan 15, 2025
@romanc
Copy link
Contributor

romanc commented Jan 22, 2025

Note: this is missing the gt4py.cartesian label.

@FlorianDeconinck FlorianDeconinck added the gt4py.cartesian Issues concerning the current version with support only for cartesian grids. label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gt4py.cartesian Issues concerning the current version with support only for cartesian grids.
Projects
None yet
Development

No branches or pull requests

2 participants