[feat]: add SwanLab tracker#1461
Conversation
There was a problem hiding this comment.
Welcome to FastVideo! Thanks for your first pull request.
How our CI works:
PRs run a two-tier CI system:
- Pre-commit — formatting (yapf), linting (ruff), type checking (mypy). Runs immediately on every PR.
- Fastcheck — core GPU tests (encoders, VAEs, transformers, kernels, unit tests). Runs automatically via Buildkite on relevant file changes (~10-15 min).
- Full Suite — integration tests, training pipelines, SSIM regression. Runs only when a reviewer adds the
readylabel.
Before your PR is reviewed:
-
pre-commit run --all-filespasses 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:
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 PR merge requirementsWaiting for
This rule is failing.
|
There was a problem hiding this comment.
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.
| def finish(self) -> None: | ||
| self._swanlab.finish() |
There was a problem hiding this comment.
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)
Summary
Adds a SwanLab tracker alongside the existing Weights & Biases tracker, so training runs can log metrics to SwanLab.
Changes
SwanlabTrackermirroringWandbTracker; the run config is passed through_sanitize_wandb_configso non-serializable values (torch.dtype,Path,Enum, tensors, ...) don't breakswanlab.init.Trackersenum gainsSWANLAB = "swanlab".initialize_trackerswires up theswanlabbranch.Enable with
--trackers swanlab(ortrackers: ["swanlab"]in YAML); requirespip install swanlab. The existingnone/wandbbehavior is unchanged, and trackers can still be combined viaSequentialTracker.Testing
python -m py_compile fastvideo/training/trackers.pypasses.