Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runner): fixed the issue where the wandb logger was not properly … #68

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/lm_saes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,9 @@ class FeatureAnalyzerConfig(BaseConfig):


class WandbConfig(BaseConfig):
log_to_wandb: bool = True
wandb_project: str = "gpt2-sae-training"
exp_name: Optional[str] = None
wandb_entity: Optional[str] = None
log_on_every_rank: bool = False


class MongoDBConfig(BaseConfig):
Expand Down
4 changes: 2 additions & 2 deletions src/lm_saes/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class TrainSAESettings(BaseSettings):
activation_factory: ActivationFactoryConfig
"""Configuration for generating activations"""

wandb: WandbConfig
wandb: Optional[WandbConfig] = None
"""Configuration for Weights & Biases logging"""

eval: bool = False
Expand Down Expand Up @@ -288,7 +288,7 @@ def train_sae(settings: TrainSAESettings) -> None:
settings=wandb.Settings(x_disable_stats=True),
mode=os.getenv("WANDB_MODE", "online"),
)
if settings.wandb.log_to_wandb and (device_mesh is not None and device_mesh.get_rank() == 0)
if settings.wandb is not None and (device_mesh is None or device_mesh.get_rank() == 0)
else None
)
if wandb_logger is not None:
Expand Down
Loading