Skip to content

Commit 543543a

Browse files
[wandb] disable wandb more gracefully (#422)
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
1 parent 8e9d973 commit 543543a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎megatron/global_vars.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,13 @@ def _set_wandb_writer(args):
165165
global _GLOBAL_WANDB_WRITER
166166
_ensure_var_is_not_initialized(_GLOBAL_WANDB_WRITER,
167167
'wandb writer')
168-
getattr(args, 'wandb_project', '')
169-
getattr(args, 'wandb_exp_name', '')
170168

171169
if args.rank == (args.world_size - 1):
172-
if args.wandb_project == '' or \
173-
args.wandb_exp_name == '':
170+
if getattr(args, 'wandb_project', '') == '' and \
171+
getattr(args, 'wandb_exp_name', '') == '':
174172
print('WARNING: WANDB writing requested but no legit wandb '
175173
'project or experiment name provided, '
176-
'therefore WANDB logs will be written '
174+
'therefore no WANDB logs will be written '
177175
'according to random generated project or experiment name.', flush=True)
178176
return
179177

0 commit comments

Comments
 (0)