Skip to content
Open
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
4 changes: 2 additions & 2 deletions transformer_engine/pytorch/optimizers/fused_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ def _initialize_state(
"""
dtype = self.name_to_dtype_map[state_name]
if store_param_remainders:
data = torch.zeros(param.shape, dtype=torch.int16, device=param.device)
Copy link
Collaborator

@vthumbe1503 vthumbe1503 Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also change run_fsdp2_model.py to use te FusedAdam optimizer instead of torch Adam so we dont break this again in the future?

data = torch.zeros_like(param, dtype=torch.int16, device=param.device)
else:
data = torch.empty(param.shape, dtype=dtype, device=param.device)
data = torch.empty_like(param, dtype=dtype, device=param.device)
if zero_buffer:
data.zero_()

Expand Down
Loading