Add SwanLab tracking support#1898
Open
asckaya wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds SwanLab as an additional experiment tracking backend (alongside existing W&B support) and updates CLI args, logging, and CI/test utilities so runs can be configured consistently via a shared tracking-args helper.
Changes:
- Introduce
slime.utils.swanlab_utils(init/finish + optional open-metrics scraping) and wire it intologging_utils. - Add SwanLab CLI arguments and a unified
get_default_tracking_args()helper used by many test launchers. - Update examples/plugins to log via
logging_utils.log, and register SwanLab as a dependency / isort third-party package.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/test_swanlab_support.py | Adds unit tests for tracking-args helpers, dual-backend logging, and SwanLab open-metrics polling. |
| tests/test_sglang_config_mixed_offload.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_sglang_config_mixed_offload_ft.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3.6_35B_A3B_pd_mooncake.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3.5_0.8B_gsm8k_short.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3.5_0.8B_gsm8k_async_short.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_4B_ppo.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_4B_ppo_train_critic_only.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_4B_ppo_disaggregate.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_4B_ckpt.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_30B_A3B.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_30B_A3B_r3.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen3_0.6B_parallel_check.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_short.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_sglang_config.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_sglang_config_distributed.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_ppo_critic_only_short.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_opd_sglang.py | Switches teacher launcher from W&B-only helper to unified tracking helper. |
| tests/test_qwen2.5_0.5B_async_short.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_quick_start_glm4_9B.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_moonlight_16B_A3B.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_moonlight_16B_A3B_r3.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_mimo_7B_mtp_only_grad.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| tests/test_glm4.7_30B_A3B_pd_mooncake.py | Switches test launcher from W&B-only helper to unified tracking helper. |
| slime/utils/swanlab_utils.py | New SwanLab integration module: init/secondary init, finish, and open-metrics monitor. |
| slime/utils/logging_utils.py | Wires SwanLab into init/update/finish and metric logging dispatch. |
| slime/utils/external_utils/command_utils.py | Adds get_default_tracking_args() and SwanLab/W&B wrappers used by tests/scripts. |
| slime/utils/arguments.py | Adds SwanLab CLI arguments and registers them in the main arg builder. |
| slime_plugins/rollout_buffer/rollout_buffer_example.py | Routes rollout logging through logging_utils.log (now supports SwanLab). |
| requirements.txt | Adds swanlab dependency. |
| pyproject.toml | Registers swanlab as a third-party import for isort config. |
| examples/retool/generate_with_retool.py | Routes debug logging through logging_utils.log with optional backends. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+199
to
+207
| wandb_run_id = getattr(args, "swanlab_run_id", None) | ||
| if wandb_run_id is None: | ||
| return | ||
|
|
||
| _require_swanlab() | ||
| _maybe_login(args) | ||
|
|
||
| init_kwargs = _build_init_kwargs(args, primary=False) | ||
| init_kwargs["id"] = wandb_run_id |
Author
|
@copilot apply changes based on the comments in this thread |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
swanlab.init->swanlab.log->swanlab.finish