Skip to content
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

feat: tracking support vemlp #339

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion verl/utils/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class Tracking(object):
supported_backend = ["wandb", "mlflow", "swanlab", "console"]
supported_backend = ["wandb", "mlflow", "swanlab", "vemlp_wandb", "console"]

def __init__(self, project_name, experiment_name, default_backend: Union[str, List[str]] = 'console', config=None):
if isinstance(default_backend, str):
Expand Down Expand Up @@ -63,6 +63,24 @@ def __init__(self, project_name, experiment_name, default_backend: Union[str, Li
mode=SWANLAB_MODE)
self.logger["swanlab"] = swanlab

if 'vemlp_wandb' in default_backend:
import os
import volcengine_ml_platform
from volcengine_ml_platform import wandb as vemlp_wandb
volcengine_ml_platform.init(
ak=os.environ["VOLC_ACCESS_KEY_ID"],
sk=os.environ["VOLC_SECRET_ACCESS_KEY"],
region=os.environ["MLP_TRACKING_REGION"],
)

vemlp_wandb.init(
project=project_name,
name=experiment_name,
config=config,
sync_tensorboard=True,
)
self.logger['vemlp_wandb'] = vemlp_wandb

if 'console' in default_backend:
from verl.utils.logger.aggregate_logger import LocalLogger
self.console_logger = LocalLogger(print_to_console=True)
Expand All @@ -78,6 +96,8 @@ def __del__(self):
self.logger['wandb'].finish(exit_code=0)
if 'swanlab' in self.logger:
self.logger['swanlab'].finish()
if 'vemlp_wandb' in self.logger:
self.logger['vemlp_wandb'].finish(exit_code=0)


class _MlflowLoggingAdapter:
Expand Down
Loading