Skip to content

Commit

Permalink
Add support for _HYBRID_SHARD_ZERO2 for Eager/Torch.Compile
Browse files Browse the repository at this point in the history
  • Loading branch information
parthmannan committed Mar 26, 2024
1 parent 0e9949e commit f303ec8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions thunder/benchmarks/benchmark_litgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
), "Hybrid Sharding (FSDP/DP) using --sharding_size is not yet supported for Thunder. Coming soon."

assert (
self.shard_mode == "hybrid_dp"
self.shard_mode in ["hybrid_zero2", "hybrid_zero3"]
), "Sharding Size is only used with Hybrid FSDP/DP style parallelism. Please "

assert (
Expand Down Expand Up @@ -239,7 +239,8 @@ def setup_distributed(self):
sharding_strategy: ShardingStrategy = {
"zero2": ShardingStrategy.SHARD_GRAD_OP,
"zero3": ShardingStrategy.FULL_SHARD,
"hybrid_dp": ShardingStrategy.HYBRID_SHARD,
"hybrid_zero2": ShardingStrategy._HYBRID_SHARD_ZERO2,
"hybrid_zero3": ShardingStrategy.HYBRID_SHARD,
}[self.shard_mode]

# AssertionError: Dynamo only supports FSDP with use_orig_params=True
Expand Down

0 comments on commit f303ec8

Please sign in to comment.