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

Do inlining and inbounds more carefully #917

Merged
merged 1 commit into from
Aug 27, 2022
Merged

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Aug 25, 2022

This PR is an attempt to partially revert (and extend/complete) #829, by:

  • More properly using @inline, @inbounds and Base.@propagate_inbounds
  • Removing @inline for "expensive" functions that do not have or uses indices which require boundscheck elision
  • Applying inlining and @inbounds to slab functions

The only thing that I'm not 100% sure about is the @inbounds around the threading loops, does what I've done look okay? cc @simonbyrne

Supersedes #891.

@charleskawczynski
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 25, 2022
@bors
Copy link
Contributor

bors bot commented Aug 25, 2022

try

Build failed:

@charleskawczynski charleskawczynski force-pushed the ck/careful_inline_inbounds branch 2 times, most recently from d2f3222 to fc8ea88 Compare August 26, 2022 04:32
@charleskawczynski
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 26, 2022
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

try

Build failed:

@charleskawczynski
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 26, 2022
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

try

Build failed:

@charleskawczynski
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 26, 2022
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

try

Build failed:

@charleskawczynski charleskawczynski force-pushed the ck/careful_inline_inbounds branch from 6d9a5b5 to 21d9bfc Compare August 26, 2022 19:36
@charleskawczynski
Copy link
Member Author

Alright, I think this should be fine so long we have a job that applies check-bounds=yes.

@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Aug 26, 2022
917: Do inlining and inbounds more carefully r=charleskawczynski a=charleskawczynski

This PR is an attempt to partially revert (and complete) #829, by:
 - Exchanging the use of ``@inline`` and ``@inbounds``
 - Removing ``@inline`` for "expensive" functions that do not have or uses indices which require boundscheck elision
 - Applying inlining and ``@inbounds`` to slab functions

The only thing that I'm not 100% sure about is the ``@inbounds`` around the threading loops, does what I've done look okay? cc `@simonbyrne` 

Supersedes #891.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

Build failed:

@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Aug 26, 2022
917: Do inlining and inbounds more carefully r=charleskawczynski a=charleskawczynski

This PR is an attempt to partially revert (and extend/complete) #829, by:
 - More properly using ``@inline`,` ``@inbounds`` and `Base.`@propagate_inbounds``
 - Removing ``@inline`` for "expensive" functions that do not have or uses indices which require boundscheck elision
 - Applying inlining and ``@inbounds`` to slab functions

The only thing that I'm not 100% sure about is the ``@inbounds`` around the threading loops, does what I've done look okay? cc `@simonbyrne` 

Supersedes #891.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@valeriabarra
Copy link
Member

Maybe squash first? Or we don't care?

@charleskawczynski
Copy link
Member Author

Ah, I probably should have, CI is almost finished, so I'm fine with letting it go. If the implicit stencil tests hang again then I'll make sure to squash after fixing that

@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

Build failed:

@charleskawczynski
Copy link
Member Author

charleskawczynski commented Aug 26, 2022

Ok, canceled this, I don't want to completely tank CI for the apply operators--something really bad is going on with these tests (opt was going from 6 min to more than 50 min). I'll revert the compose ops, too, and then squash. Opened #923.

@charleskawczynski charleskawczynski force-pushed the ck/careful_inline_inbounds branch from 21d9bfc to bc51fdd Compare August 26, 2022 21:09
@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Aug 26, 2022
917: Do inlining and inbounds more carefully r=charleskawczynski a=charleskawczynski

This PR is an attempt to partially revert (and extend/complete) #829, by:
 - More properly using ``@inline`,` ``@inbounds`` and `Base.`@propagate_inbounds``
 - Removing ``@inline`` for "expensive" functions that do not have or uses indices which require boundscheck elision
 - Applying inlining and ``@inbounds`` to slab functions

The only thing that I'm not 100% sure about is the ``@inbounds`` around the threading loops, does what I've done look okay? cc `@simonbyrne` 

Supersedes #891.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

Build failed:

  • lib-climacore-vtk

@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Aug 26, 2022
917: Do inlining and inbounds more carefully r=charleskawczynski a=charleskawczynski

This PR is an attempt to partially revert (and extend/complete) #829, by:
 - More properly using ``@inline`,` ``@inbounds`` and `Base.`@propagate_inbounds``
 - Removing ``@inline`` for "expensive" functions that do not have or uses indices which require boundscheck elision
 - Applying inlining and ``@inbounds`` to slab functions

The only thing that I'm not 100% sure about is the ``@inbounds`` around the threading loops, does what I've done look okay? cc `@simonbyrne` 

Supersedes #891.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 26, 2022

Build failed:

Delete unused function

More inbounds and propagate inline

More inlining adjustments

More inline and inbounds adjustments

Apply formatter

Fix merge conflicts

Add an inbounds back in

Add more inbounds

More inbounds and inlining

More inbounds

More inbounds

Increase mem for implicit stencil test

Try 30 GB mem request for implicit stencil test

Undo inlining for compose stencils

Revert alloc request and pointwise apply
@charleskawczynski charleskawczynski force-pushed the ck/careful_inline_inbounds branch from bc51fdd to c0b7991 Compare August 27, 2022 00:34
@charleskawczynski
Copy link
Member Author

bors r+

@bors bors bot merged commit 6151815 into main Aug 27, 2022
@bors bors bot deleted the ck/careful_inline_inbounds branch August 27, 2022 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants