Skip to content

[Proposal] Support SwanLab as an alternative logging backend to wandb #604

@wantbook-book

Description

@wantbook-book

Proposal

Add optional SwanLab logging support to SAELens.

Motivation

Some users cannot reliably use Weights & Biases (wandb) due to network restrictions. SwanLab can serve as a drop-in alternative for experiment logging in these environments.

Pitch

  1. Add wandb_compat.py, which selects swanlab or wandb based on SAE_LENS_LOGGING_BACKEND, and provides a fallback generate_id() implementation (use UUID when wandb.util.generate_id is unavailable).
  2. Keep calling wandb.init() / wandb.finish() in llm_sae_training_runner.py, but route the actual backend module through the compatibility layer (either SwanLab or wandb).
  3. When the backend is SwanLab, skip Artifact-related log_artifact calls in config.py (to avoid unsupported features), and stop using wandb.Histogram in sae_trainer.py.

Checklist

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