-
Notifications
You must be signed in to change notification settings - Fork 195
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
Should we store architecture
in grid
?
#1825
Comments
Thanks for the nice summary @glwagner . I vote for storing |
|
Also, |
Oceananigans.jl/src/Grids/new_data.jl Line 67 in f7408dc
|
@ali-ramadhan would be good to get your thoughts before doing anything. Does this help / hurt memory distributed models? |
Out of curiosity, when we create a PR, is it possible to find out how long the tests take compared to before? It seems like it might be useful when making a change like this, as well as pretty much anything else. |
Thanks. And I guess you can go to the latest merge to find out how long it used to take? It seems like showing the difference might be helpful, in case there is a big difference but that is probably wishing for the stars. |
Right, you can reference prior PRs to compare old build times to a new build time. Custom reports might be possible, I don't know! Could be worth checking out the buildkite documentation. If you want something written into the PR I think you have to build a bot or something. Also possible, probably not "hard" once you know what to do. |
But since all tests run on a computer at MIT the time it takes also depends on how many tests are running (eg how many prs were just open) and other random factors. |
Right, there are some caveats on how you interpret those times. They aren't a benchmark. |
I guess bennchmarks are the best way to tell and we should run those often enough to see whether anything has changed singificantly. Thanks. |
Looking at the code for
suggests to me that it's important to include One complication is that, apparently, the pressure solver requires the global grid: Oceananigans.jl/src/Distributed/distributed_incompressible_model.jl Lines 40 to 41 in 6e39d3f
We'll have to look into that in more detail to understand what needs to be done for that, and for other solvers like the |
@ali-ramadhan can we "reconstruct" the full grid parameters needed to build the
I think we just need an
|
As for the API, it might simplify matters to have grid = RegularRectilinearGrid(CPU(), float_type=Float32, size=(1, 1, 1), x=(0, 1), y=(1, 2), z=(-3, 0)) We can also add an grid = RegularRectilinearGrid(architecture=CPU(), float_type=Float32, size=(1, 1, 1), x=(0, 1), y=(1, 2), z=(-3, 0)) We will have to translate the @christophernhill might have some useful comments. |
Dispatching over |
In the general case of a pre-computed grid or mesh, the
architecture
on which the grid is stored has be known. Thus in general, thearchitecture
of a grid must be provided.The few special cases to this rule are grids with metrics that are either constant or can be computed on the fly, like
RegularRectilinearGrid
. Up to recentlyRegularRectilinearGrid
was the only option, so we hadn't the motivation to ponder whetherarchitecture
belonged as a model property, field property, or grid property...Putting
architecture
ingrid
would mean that we don't have to specify it in model constructors. Sincegrid
is so central we wouldn't really needarchitecture
as a property anywhere else. For example, we wouldn't need to storearchitecture
in every.single.field object, as we do now. Alleviating this boilerplate makes the change feel especially right...The main downside is a loss of flexibility for those grids that are truly architecture-independent, like
RegularRectilinearGrid
andRegularLatitudeLongitudeGrid
. On the other hand, we have to specifyarchitecture
somewhere and rarely helpful to mixCPU
andGPU
computations using the same grid.The text was updated successfully, but these errors were encountered: