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

Dynamically disable CuArray scalar operations #276

Closed
ali-ramadhan opened this issue Jun 7, 2019 · 4 comments · Fixed by #851
Closed

Dynamically disable CuArray scalar operations #276

ali-ramadhan opened this issue Jun 7, 2019 · 4 comments · Fixed by #851
Labels
GPU 👾 Where Oceananigans gets its powers from performance 🏍️ So we can get the wrong answer even faster

Comments

@ali-ramadhan
Copy link
Member

https://github.com/climate-machine/Oceananigans.jl/blob/fc12f60371eb0df7ba3d088771ddc25c0f258de6/src/Oceananigans.jl#L154

@maleadt pointed out that this line might only execute when the package is precompiled so if we really want to enforce no scalar operations, we should do this in an init.jl file or in the Model constructor or something.

@ali-ramadhan ali-ramadhan added performance 🏍️ So we can get the wrong answer even faster GPU 👾 Where Oceananigans gets its powers from labels Jun 7, 2019
@glwagner
Copy link
Member

glwagner commented Jun 7, 2019

How about adding a line to the model constructor that executes when arch=GPU(), with a flag that allows the user to permit scalar operations (maybe useful when debugging output / diagnostics)

@ali-ramadhan
Copy link
Member Author

ali-ramadhan commented Jun 7, 2019

Ah yeah would be good to have the option. It could be a keyword argument of the Model constructor.

@glwagner
Copy link
Member

@ali-ramadhan do we still want to do this?

@ali-ramadhan
Copy link
Member Author

Yes, although I think we want to disable scalar operations initially and @vchuravy suggested using @allowscalar on lines where we need scalar operations (currently just one line in each Poisson solver).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GPU 👾 Where Oceananigans gets its powers from performance 🏍️ So we can get the wrong answer even faster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants