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

Alternative to --check-bounds=no? #2244

Closed
johnomotani opened this issue Jan 21, 2025 · 2 comments
Closed

Alternative to --check-bounds=no? #2244

johnomotani opened this issue Jan 21, 2025 · 2 comments

Comments

@johnomotani
Copy link

@sloede I've seen that you commented on a few Discourse threads and issues about the problems with --check-bounds=no (and helped me out once or twice - thanks!). I started another discussion thread recently, which got an interesting suggestion (https://discourse.julialang.org/t/removing-bounds-checking-for-hpc-check-bounds-unsafe/124897/17) to make a custom array package to disable just the bounds checks on array accesses. I started work on one, with some promising initial results for my code (https://discourse.julialang.org/t/removing-bounds-checking-for-hpc-check-bounds-unsafe/124897/20), but (unless there's a better design that I haven't thought of) it needs wrappers to access the optimised, Array-specialised implementations of various packages (LinearAlgebra, SparseArrays, etc.) so other contributors who want to support more things would be welcome! It's still experimental though, and I haven't yet decided whether to use it for my code, although I'm leaning towards making the jump. The package is InboundsArrays.jl:
https://github.com/InboundsArrays/InboundsArrays.jl

If anyone here has thoughts, they'd be very welcome!

@sloede
Copy link
Member

sloede commented Feb 12, 2025

Hi John, please excuse the late reply. Thanks a lot for being very vocal about the needs of HPC users in the respective Julia issue and on Discourse. I've been following all the discussions and I am glad that you are raising the awareness for the Julia core devs once more 💪

Since we currently use a variety of array types in Trixi.jl (some of them specialized for, e.g., LoopVectorization.jl), using a new array type like InboundArray does not seem like a solution that we can easily adopt at the moment. However, it's great that you are pushing in that direction, demonstrating that this is a real concern for the HPC crowd. Feel free to ping me on new discussions and keep up the good work! Even with the recent setbacks in terms of performance (loss of check-bounds=no, performance penalties with Julia v1.11) I still believe Julia is currently the best available HPC language 😊

@johnomotani
Copy link
Author

I ended up deciding InboundsArray was not the best solution for my code either. I found it would probably be too much maintenance overhead to really make it work well. There was a simpler workaround, because most of my loops were already defined using a custom looping macro, so by adding @inbounds into that I get most of the benefits with one or two places left in the code where I have to add @inbounds explicitly.

Still hoping the core Julia devs will eventually fix --check-bounds=no so we can at least profile and optimise efficiently.

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

No branches or pull requests

2 participants