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

The workaround for GPU inference failure allocates new fields #975

Open
Sbozzolo opened this issue Jan 7, 2025 · 2 comments · May be fixed by #982
Open

The workaround for GPU inference failure allocates new fields #975

Sbozzolo opened this issue Jan 7, 2025 · 2 comments · May be fixed by #982
Labels
bug Something isn't working

Comments

@Sbozzolo
Copy link
Member

Sbozzolo commented Jan 7, 2025

# Wrap hydrology and earth parameters in one struct to avoid type inference failure
hydrology_earth_params =
ClimaLand.Soil.HydrologyEarthParameters.(hydrology_cm, earth_param_set)

This line is allocating a new field at every step (on GPUs), which should be avoided, if possible.

@Sbozzolo Sbozzolo added the bug Something isn't working label Jan 7, 2025
@kmdeck
Copy link
Member

kmdeck commented Jan 13, 2025

@juliasloan25, since hydrology_cm and earth_param_set are both part of the model parameters, could we refactor this to pass model parameters instead and unpack them as needed? If the problem is passing two structs in broadcasted expression

@juliasloan25
Copy link
Member

@juliasloan25, since hydrology_cm and earth_param_set are both part of the model parameters, could we refactor this to pass model parameters instead and unpack them as needed? If the problem is passing two structs in broadcasted expression

I think that should work! Then we'll just modify phase_change_source to take in the model parameters as its last arg and access hydrology_cm and earth_param_set from there rather than from hydrology_earth_params as is done now. I'll open a PR drafting the changes

@juliasloan25 juliasloan25 linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants