Skip to content

Commit

Permalink
Fix missing params in unconsolidated models
Browse files Browse the repository at this point in the history
  • Loading branch information
imjeremyhi committed Sep 19, 2023
1 parent 164cc0f commit b5455b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fairscale/nn/data_parallel/fully_sharded_data_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2235,9 +2235,10 @@ def consolidate_shard_weights(
# of synchronization between shards or that all shards buffers are equivalent).
if with_module_buffers:
for buffer_name in shard_metadata[0]["buffer_names"]:
if buffer_name not in shard_weights[0] and (not strict):
continue
consolidated_weights[buffer_name] = shard_weights[0][buffer_name]
if buffer_name in shard_weights[0]:
consolidated_weights[buffer_name] = shard_weights[0][buffer_name]
else:
logging.info(f"Missing buffer weights: {buffer_name}")

return consolidated_weights

Expand Down

0 comments on commit b5455b9

Please sign in to comment.