Skip to content

Commit

Permalink
Revert "[benchmark] migrate to fsdp/ddp after jit, from fsdp/ddp befo…
Browse files Browse the repository at this point in the history
…re jit (…"

This reverts commit b6477b2.
  • Loading branch information
crcrpar authored Aug 22, 2024
1 parent c92e8a8 commit f09805b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions thunder/benchmarks/benchmark_litgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,24 +221,20 @@ def __init__(
self.model = te_precision.convert_module(self.model)

# Setup the distributed algorithm choices
if distributed_first := (self.compile in ("eager", "inductor") or "dynamo" in self.compile):
self.model = self.setup_distributed(self.model)
self.model = self.setup_distributed(self.model)

# Setup activations checkpointing
if self.checkpoint_activations:
self.setup_activation_checkpointing()

# Compile the model
self.model = self.setup_compile(self.model)

if not distributed_first:
self.model = self.setup_distributed(self.model)

# Initialize the optimizer after the model is sharded if using FSDP
self.optimizer = configure_optimizers(
self.model, weight_decay, learning_rate, (beta1, beta2), device_type="cuda"
)

# Compile the model
self.model = self.setup_compile(self.model)

# Setup the Dummy dataloader for training
self.train_dataloader = self.setup_dummy_dataloader()
self.train_data_iter = iter(self.train_dataloader)
Expand Down

0 comments on commit f09805b

Please sign in to comment.