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

(0.90.10) on_architecture method for all Oceananigans' types #3490

Merged
merged 34 commits into from
Mar 7, 2024

Conversation

simone-silvestri
Copy link
Collaborator

We have two functions called arch_array and on_architecture that pretty much do the same thing: moving a variable between GPU and CPU. However, neither of them covers all the types in Oceananigans, like Fields or Models.

So, this PR tidies things up a bit. It removes arch_array in favor of on_architecture. In addition, it extends on_architecture to all the types with memory-allocated variables.

@navidcy navidcy added GPU 👾 Where Oceananigans gets its powers from abstractions 🎨 Whatever that means labels Mar 1, 2024
Copy link
Member

@glwagner glwagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not expect to see 88 files changed --- but it indicates the importance of this. Are we also deprecating arch_array? This would break a lot of existing code, but could be a positive change. Or we can deprecate sometime in the future (maybe we can issue a deprecation warning)

@simone-silvestri
Copy link
Collaborator Author

on_architecture for a model seems to be a little complicated because of FFTs that depend on very different plans for GPU and CPU. I am leaning towards leaving on_architecture only for some basics building blocks (fields, grids, some solvers) and not allow on_architecture for models.

@simone-silvestri
Copy link
Collaborator Author

I think we can keep arch_array for some versions but issue a deprecation warning.

src/Advection/Advection.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
src/Architectures.jl Outdated Show resolved Hide resolved
@simone-silvestri
Copy link
Collaborator Author

I liked the idea of keeping a list of deprecated functions that will be removed after a couple of releases.
At least users know what has happened and are ready for the change that will happen down the line.
I would go with the majority of the opinions on this one.

@navidcy navidcy changed the title on_architecture method for all Oceananigans' types (0.90.10) on_architecture method for all Oceananigans' types Mar 6, 2024
@navidcy
Copy link
Collaborator

navidcy commented Mar 7, 2024

@simone-silvestri when tests pass, is this ready to be merged?

@simone-silvestri
Copy link
Collaborator Author

Should be

@simone-silvestri simone-silvestri merged commit fd3b52c into main Mar 7, 2024
48 checks passed
@simone-silvestri simone-silvestri deleted the ss/on-architecture branch March 7, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abstractions 🎨 Whatever that means GPU 👾 Where Oceananigans gets its powers from
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants