Skip to content

Commit

Permalink
remove prog fields variable
Browse files Browse the repository at this point in the history
we can save 2GB of memory at 9km by removing this variable
  • Loading branch information
cathalobrien committed Nov 21, 2024
1 parent 9c7b77c commit 2d39262
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/anemoi/inference/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,6 @@ def get_most_recent_datetime(input_fields):
)

# Next step

prognostic_fields = y_pred[..., prognostic_output_mask]

# Compute new forcing

forcing = forcing_and_constants(
Expand All @@ -508,7 +505,7 @@ def get_most_recent_datetime(input_fields):

# Update dynamic tensor for next iteration
input_tensor_torch = input_tensor_torch.roll(-1, dims=1)
input_tensor_torch[:, -1, :, prognostic_input_mask] = prognostic_fields
input_tensor_torch[:, -1, :, prognostic_input_mask] = y_pred[..., prognostic_output_mask]
if computed_forcing_mask:
input_tensor_torch[:, -1, :, computed_forcing_mask] = forcing

Expand Down

0 comments on commit 2d39262

Please sign in to comment.