I’m currently doing all my logging like this:
wandb.log(
{ "loss": loss, "step": step }, commit=should_commit())
# step increments with each batch
def should_commit():
return random.randint(0, 100) == 0
The goal is to only sync metrics to the server once every 100 or so calls to log. I’m doing this because otherwise my training speed is halved, if I just do the default.
But, I notice this isn’t working. My charts look very odd for some reason.
What is the correct way to only sync all my metrics every so often?
To be clear, I want the end result to be such that all my metrics are on the server for every time-step, however, I want to do the syncing infrequently instead of every time I call wandb.log, because that’s slow.