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

Inline copyto! to fix Ref allocations #945

Merged
merged 1 commit into from
Sep 16, 2022
Merged

Inline copyto! to fix Ref allocations #945

merged 1 commit into from
Sep 16, 2022

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Sep 15, 2022

This PR applies @inline to copyto!, which was found to fix allocations with Refs inside broadcast expressions, and adds tests. I'm going to try this out with ClimaAtmos to see if one more minor change is needed, too.

This fixes our bycolumn allocations with Refs from 24576 bytes to 0.

Closes #946.

@charleskawczynski
Copy link
Member Author

Thanks for the investigatory work, @simonbyrne!

@charleskawczynski charleskawczynski changed the title Inline copyto Inline copyto to fix Ref allocations Sep 15, 2022
@charleskawczynski charleskawczynski changed the title Inline copyto to fix Ref allocations Inline copyto! to fix Ref allocations Sep 15, 2022
@charleskawczynski
Copy link
Member Author

bors r+

@charleskawczynski
Copy link
Member Author

bors r-

@bors
Copy link
Contributor

bors bot commented Sep 15, 2022

Canceled.

bors bot added a commit that referenced this pull request Sep 15, 2022
945: Inline `copyto!` to fix Ref allocations r=charleskawczynski a=charleskawczynski

This PR applies ``@inline`` to `copyto!`, which was found to fix allocations with `Ref`s inside broadcast expressions, and adds tests. I'm going to try this out with ClimaAtmos to see if one more minor change is needed, too.

This fixes our `bycolumn` allocations with `Ref`s from 24576 bytes to 0.

Closes #946.

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

bors r+

bors bot added a commit that referenced this pull request Sep 15, 2022
945: Inline `copyto!` to fix Ref allocations r=charleskawczynski a=charleskawczynski

This PR applies ``@inline`` to `copyto!`, which was found to fix allocations with `Ref`s inside broadcast expressions, and adds tests. I'm going to try this out with ClimaAtmos to see if one more minor change is needed, too.

This fixes our `bycolumn` allocations with `Ref`s from 24576 bytes to 0.

Closes #946.

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

bors bot commented Sep 15, 2022

Build failed:

@charleskawczynski
Copy link
Member Author

Oops, looks like that doesn't pass the allocation tests with --check-bounds=yes, so I'll move these tests into a separate file.

@charleskawczynski
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Sep 15, 2022
945: Inline `copyto!` to fix Ref allocations r=charleskawczynski a=charleskawczynski

This PR applies ``@inline`` to `copyto!`, which was found to fix allocations with `Ref`s inside broadcast expressions, and adds tests. I'm going to try this out with ClimaAtmos to see if one more minor change is needed, too.

This fixes our `bycolumn` allocations with `Ref`s from 24576 bytes to 0.

Closes #946.

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

bors bot commented Sep 15, 2022

Build failed:

@charleskawczynski
Copy link
Member Author

bors r+

@bors bors bot merged commit fe0870a into main Sep 16, 2022
@bors bors bot deleted the ck/allocs branch September 16, 2022 00:50
bors bot added a commit that referenced this pull request Oct 3, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 3, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 4, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 4, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 4, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 4, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
bors bot added a commit that referenced this pull request Oct 4, 2022
978: Extend and fix Ref broadcasting with StencilCoefs r=charleskawczynski a=charleskawczynski

This PR extends and fixes `Ref` broadcasting with StencilCoefs (#963), solution was basically the same as the one applied in #945. Closes #963.

I tried applying only `copyto!`, and only `apply_stencil!`, but that didn't work so I applied to all three methods (which does work).

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@dennisYatunin dennisYatunin mentioned this pull request Feb 1, 2023
4 tasks
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.

Allocations in broadcasts with Ref
1 participant