MCPcopy
hub / github.com/EleutherAI/gpt-neox / init_wandb

Function init_wandb

megatron/utils.py:151–180  ·  view source on GitHub ↗
(neox_args)

Source from the content-addressed store, hash-verified

149
150
151def init_wandb(neox_args):
152 # Wandb. (one worker per machine)
153 if neox_args.use_wandb == False:
154 return
155
156 if not neox_args.wandb_init_all_ranks:
157 use_wandb = is_local_main() and (
158 get_wandb_api_key(neox_args=neox_args) is not None
159 )
160 neox_args.update_value("use_wandb", use_wandb)
161 if neox_args.use_wandb:
162 group_name = neox_args.wandb_group
163 name = f"{socket.gethostname()}-{local_rank()}" if group_name else None
164 try:
165 wandb.init(
166 project=neox_args.wandb_project,
167 group=group_name,
168 name=name,
169 save_code=False,
170 force=False,
171 entity=neox_args.wandb_team,
172 )
173 except wandb.UsageError as e:
174 neox_args.update_value("use_wandb", False)
175 print(e)
176 print(
177 "Skipping wandb. Execute `wandb login` on local or main node machine to enable.",
178 flush=True,
179 )
180 wandb.config.update(neox_args.all_config)
181
182
183def obtain_resource_pool(

Callers 3

mainFunction · 0.90
pretrainFunction · 0.90

Calls 5

is_local_mainFunction · 0.85
get_wandb_api_keyFunction · 0.85
local_rankFunction · 0.85
update_valueMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected