Skip to content

[Proposal] Make wandb a lazy import to avoid unnecessary overhead #1130

@liusida

Description

@liusida

Proposal

Move import wandb from top-level in train.py (so it always executes on import) into inside the train() function (and guard with if cfg.wandb)
Reason: wandb is large and slow to import; many consumers of TransformerLens don’t train and thus don’t need wandb, so avoiding the import reduces overhead on slower machines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions