-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add a New Experiment Tracker: SwanLab
#1413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces SwanLab integration as a new experiment tracker option alongside WandB in the training workflow. It adds a new SwanLabLogger utility, updates configuration classes to support the new tracker, and modifies the training script to initialize and use SwanLab logging when selected.
- Added SwanLabLogger in lerobot/common/utils/swanlab_utils.py to handle logging of metrics, policies, and videos to SwanLab.
- Updated pyproject.toml with the swanlab dependency and modified configuration files to support dynamic tracker selection.
- Enhanced lerobot/scripts/train.py to initialize and utilize SwanLabLogger based on the chosen tracker.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Added swanlab dependency |
lerobot/scripts/train.py | Updated logger initialization and logging calls to include SwanLab |
lerobot/configs/train.py | Updated config with tracker field and validation logic |
lerobot/configs/default.py | Added SwanLabConfig and updated WandBConfig with deprecation notices |
lerobot/common/utils/swanlab_utils.py | Introduced SwanLabLogger and helper functions for SwanLab integrations |
match = re.search(r"run-([^\.]+).swanlab", paths[0].split("/")[-1]) | ||
if match is None: | ||
raise RuntimeError("Couldn't get the previous SwanLab run ID for run resumption.") | ||
swanlab_run_id = match.groups(0)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using match.group(1) instead of match.groups(0)[0] for clarity when extracting the run ID.
swanlab_run_id = match.groups(0)[0] | |
swanlab_run_id = match.group(1) |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Yushun Xiang <[email protected]>
for more information, see https://pre-commit.ci
* Move files * Replace imports & paths * Update relative paths * Update doc symlinks * Update instructions paths * Fix imports * Update grpc files * Update more instructions * Downgrade grpc-tools * Update manifest * Update more paths * Update config paths * Update CI paths * Update bandit exclusions * Remove walkthrough section
This pull request introduces support for SwanLab as an experiment tracker alongside WandB in the training pipeline. Key changes include the addition of a
SwanLabLogger
utility, updates to configuration classes, and modifications to the training script to integrate SwanLab logging.SwanLab Integration:
lerobot/common/utils/swanlab_utils.py
: Added a new utility module containing theSwanLabLogger
class for logging metrics, policies, and videos to SwanLab. This includes helper functions for generating group names, retrieving run IDs, and sanitizing artifact names.pyproject.toml
: Addedswanlab>=0.6.4
as a dependency to enable SwanLab integration.Configuration Updates:
lerobot/configs/default.py
: Introduced a newSwanLabConfig
class for SwanLab-specific configurations, such as enabling/disabling artifacts, specifying project details, and setting the tracking mode. UpdatedWandBConfig
with a deprecation notice forenable
and additional fields for better compatibility with the new tracking system.lerobot/configs/train.py
: UpdatedTrainPipelineConfig
to include atracker
field for selecting between "wandb," "swanlab," "both," or "none." Added validation logic to ensure valid tracker selection and enable the appropriate configuration dynamically. [1] [2]Training Script Enhancements:
lerobot/scripts/train.py
: Modified the training script to initialize and useSwanLabLogger
based on the selected tracker. Added support for logging metrics, policies, and videos to SwanLab during training and evaluation phases. [1] [2] [3] [4]Usage Example:
Set
tracker=swanlab
If you have a plan to merge this PR, I will update the document in detial. @aliberts