Skip to content

Commit

Permalink
[wandb] disable wandb more gracefully (#422)
Browse files Browse the repository at this point in the history
Co-authored-by: Logan Adams <[email protected]>
  • Loading branch information
billishyahao and loadams authored Aug 27, 2024
1 parent 8e9d973 commit 543543a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions megatron/global_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,13 @@ def _set_wandb_writer(args):
global _GLOBAL_WANDB_WRITER
_ensure_var_is_not_initialized(_GLOBAL_WANDB_WRITER,
'wandb writer')
getattr(args, 'wandb_project', '')
getattr(args, 'wandb_exp_name', '')

if args.rank == (args.world_size - 1):
if args.wandb_project == '' or \
args.wandb_exp_name == '':
if getattr(args, 'wandb_project', '') == '' and \
getattr(args, 'wandb_exp_name', '') == '':
print('WARNING: WANDB writing requested but no legit wandb '
'project or experiment name provided, '
'therefore WANDB logs will be written '
'therefore no WANDB logs will be written '
'according to random generated project or experiment name.', flush=True)
return

Expand Down

0 comments on commit 543543a

Please sign in to comment.