Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ae_global_with_qk_lnorm: True
ae_global_att_dense_rate: 1.0
ae_global_block_factor: 64
ae_global_mlp_hidden_factor: 2
assimilate_global_gradient_checkpoint_mode: False

decoder_type: PerceiverIOCoordConditioning # CrossAttentionAdaNormConditioning
pred_adapter_kv: False
Expand Down
8 changes: 6 additions & 2 deletions src/weathergen/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,12 @@ def assimilate_global(self, model_params: ModelParams, tokens: torch.Tensor) ->
"""

# global assimilation engine and adapter
for block in self.ae_global_blocks:
tokens = checkpoint(block, tokens, use_reentrant=False)
if self.cf.assimilate_global_gradient_checkpoint_mode:
for block in self.ae_global_blocks:
tokens = checkpoint(block, tokens, use_reentrant=False)
else:
for block in self.ae_global_blocks:
tokens = block(tokens)

return tokens

Expand Down
Loading