Skip to content

Commit

Permalink
fix: add global ddp to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackmin801 committed Jan 11, 2025
1 parent 6eaa09b commit 19a7c7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/zeroband/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from zeroband.checkpoint import CkptConfig
from zeroband.data import DataConfig
from zeroband.diloco import DilocoConfig
from zeroband.global_ddp import GlobalDDPConfig
from zeroband.models.llama.model import AttnFnType
from zeroband.optimizers import OptimizersConfig, AdamConfig

Expand Down Expand Up @@ -68,6 +69,7 @@ class Config(BaseConfig):

# sub config
diloco: DilocoConfig | None = None
global_ddp: GlobalDDPConfig | None = None
data: DataConfig = DataConfig()
optim: OptimConfig = OptimConfig()
train: TrainConfig
Expand All @@ -88,4 +90,3 @@ def validate_live_recovery_rank_src(self):
if self.ckpt is not None and self.ckpt.live_recovery_rank_src is not None and self.diloco is None:
raise ValueError("live_recovery_rank_src is only supported with diloco")
return self

5 changes: 3 additions & 2 deletions src/zeroband/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
from zeroband import utils
from zeroband.diloco import Diloco
from zeroband.comms import ElasticDeviceMesh
from zeroband.global_ddp import GlobalDDP, GlobalDDPConfig
from zeroband.global_ddp import GlobalDDP
from zeroband.loss import cross_entropy_max_z_loss

from zeroband.models.llama.model import create_block_mask_from_seqlens
from zeroband.config import Config #, MemoryProfilerConfig
from zeroband.config import Config # , MemoryProfilerConfig
from zeroband.optimizers import get_optimizer

from zeroband.utils import (
Expand All @@ -40,6 +40,7 @@
from zeroband.checkpoint import CkptManager, TrainingProgress
from zeroband.lr_scheduler import get_scheduler


def log_hash_training_state(
config: Config,
model: torch.nn.Module,
Expand Down

0 comments on commit 19a7c7b

Please sign in to comment.