Skip to content

[feat]: add SwanLab tracker#1461

Open
huarzone wants to merge 1 commit into
hao-ai-lab:mainfrom
huarzone:feat/swanlab-tracker
Open

[feat]: add SwanLab tracker#1461
huarzone wants to merge 1 commit into
hao-ai-lab:mainfrom
huarzone:feat/swanlab-tracker

Conversation

@huarzone

Copy link
Copy Markdown

Summary

Adds a SwanLab tracker alongside the existing Weights & Biases tracker, so training runs can log metrics to SwanLab.

Changes

  • New SwanlabTracker mirroring WandbTracker; the run config is passed through _sanitize_wandb_config so non-serializable values (torch.dtype, Path, Enum, tensors, ...) don't break swanlab.init.
  • Trackers enum gains SWANLAB = "swanlab".
  • initialize_trackers wires up the swanlab branch.

Enable with --trackers swanlab (or trackers: ["swanlab"] in YAML); requires pip install swanlab. The existing none / wandb behavior is unchanged, and trackers can still be combined via SequentialTracker.

Testing

  • python -m py_compile fastvideo/training/trackers.py passes.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to FastVideo! Thanks for your first pull request.

How our CI works:

PRs run a two-tier CI system:

  1. Pre-commit — formatting (yapf), linting (ruff), type checking (mypy). Runs immediately on every PR.
  2. Fastcheck — core GPU tests (encoders, VAEs, transformers, kernels, unit tests). Runs automatically via Buildkite on relevant file changes (~10-15 min).
  3. Full Suite — integration tests, training pipelines, SSIM regression. Runs only when a reviewer adds the ready label.

Before your PR is reviewed:

  • pre-commit run --all-files passes locally
  • You've added or updated tests for your changes
  • The PR description explains what and why

If pre-commit fails, a bot comment will explain how to fix it. Fastcheck and Full Suite results appear in the Checks section below.

Useful links:

@mergify mergify Bot added type: feat New feature or capability scope: training Training pipeline, methods, configs labels Jun 15, 2026
@mergify

mergify Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for SwanLab tracking by implementing the SwanlabTracker class and registering it in the trackers configuration. The reviewer pointed out that SwanlabTracker lacks a video method implementation, which prevents validation videos from being logged to SwanLab, and provided a code suggestion to resolve this.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +320 to +321
def finish(self) -> None:
self._swanlab.finish()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The SwanlabTracker does not implement the video method. During validation, _log_validation in training_pipeline.py calls self.tracker.video(...) to log validation videos. Since BaseTracker.video returns None, validation videos will not be logged to SwanLab. Implementing the video method using swanlab.Video will enable validation video tracking.

    def finish(self) -> None:
        self._swanlab.finish()

    def video(
        self,
        data: Any,
        *,
        caption: str | None = None,
        fps: int | None = None,
        format: str | None = None,
    ) -> Any:
        kwargs: dict[str, Any] = {}
        if caption is not None:
            kwargs["caption"] = caption
        if fps is not None:
            kwargs["fps"] = fps
        return self._swanlab.Video(data, **kwargs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: training Training pipeline, methods, configs type: feat New feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant