You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I am using DeepFM implementation and trying to log the batch time after each step.
I want to do something like below, and get how much time took to process each batch.
# Should log batch time here
batchtime_log_callback = LambdaCallback(
on_batch_begin=lambda batch, logs: batchtime_log.write(str(batch)),
on_batch_end=lambda batch, logs: batchtime_log.write(str(batch)))
model.fit(
train_model_input,
train[target].values,
callbacks=[batchtime_log_callback],
batch_size=batch_size,
epochs=num_epoch,
verbose=2,
validation_split=val_ratio)
The desired output print would be like below, but it is okay if other artifacts are printed together. I can post-process. Any method?
xxx ms
yyy ms
.
.
.
The text was updated successfully, but these errors were encountered:
First of all, thanks for the reply. Just to add one thing, I think we should add this line torch.cuda.synchronize() before calling time.time() when distributed training is enabled. This way we can assure that all streams in each CUDA devices has totally finished before logging the time. Thanks for the reply once again!
Hello. I am using DeepFM implementation and trying to log the batch time after each step.
I want to do something like below, and get how much time took to process each batch.
The desired output print would be like below, but it is okay if other artifacts are printed together. I can post-process. Any method?
The text was updated successfully, but these errors were encountered: