Skip to content

Feature add whitelist parameter issue 2548#2550

Merged
vfdev-5 merged 47 commits intopytorch:masterfrom
sadra-barikbin:Feature-add-whitelist-parameter-issue-2548
May 3, 2022
Merged

Feature add whitelist parameter issue 2548#2550
vfdev-5 merged 47 commits intopytorch:masterfrom
sadra-barikbin:Feature-add-whitelist-parameter-issue-2548

Conversation

@sadra-barikbin
Copy link
Copy Markdown
Collaborator

Fixes #2548

Description:
I made some refactors first and then added whitelist parameter to specified classes in the issue.

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

sadra-barikbin and others added 30 commits January 22, 2022 23:03
@sadra-barikbin sadra-barikbin force-pushed the Feature-add-whitelist-parameter-issue-2548 branch from 74ba501 to b1fd3b0 Compare April 17, 2022 21:39
@sadra-barikbin
Copy link
Copy Markdown
Collaborator Author

image
image
image

ClearML *ScalarHandler seemingly works as expected but histogram ones not. Plots tab in project page is empty.

@sadra-barikbin
Copy link
Copy Markdown
Collaborator Author

sadra-barikbin commented Apr 17, 2022

image
image

TensorboardLogger works properly.

@sadra-barikbin sadra-barikbin force-pushed the Feature-add-whitelist-parameter-issue-2548 branch from db97792 to fef3f67 Compare April 17, 2022 22:30
@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented May 1, 2022

@sadra-barikbin can you please resolve the conflict and update this PR

Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sadra-barikbin Thanks, lgtm

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented May 2, 2022

ClearML *ScalarHandler seemingly works as expected but histogram ones not. Plots tab in project page is empty.

@sadra-barikbin you were reporting that previously. Can you check again if this is still a problem with the latest clearml and see if it is related to our code or not. cc @bmartinn

@sadra-barikbin
Copy link
Copy Markdown
Collaborator Author

ClearML histograms were still missing. There was an issue in calling WeightsGradientHistHelper on logger construction. This object is used in logging histograms. Its report_freq parameter's default value is 100 so among every 100 calls 99 of them are returned without any actual log. I changed it to 1 and histograms are now plotted correctly.

Bug place
Final result:
image

The Iteration 0 that is in plot title is due to internal stuff of WeightsGradientHistHelper. As we call add_histogram, it does some processes and finally calls clearml logger's add_surface method with our arguments title and series unchanged and also with another argument, iteration hard-coded to zero.

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented May 3, 2022

@sadra-barikbin thanks a lot for investigations ! It is very helpful !

As we call add_histogram, it does some processes and finally calls clearml logger's add_surface method with our arguments title and series unchanged and also with another argument, iteration hard-coded to zero.

So, we call add_histogram:

logger.grad_helper.add_histogram(
title=f"{tag_prefix}weights_{title_name}",
series=series_name,
step=global_step,
hist_data=p.grad.detach().cpu().numpy(),
)

and define step as global_step but step is not propagated to add_surface ? -> Apparently, it is a bit complicated code in clearml to track what happens with step. Anyway, I asked on their issue tracker and let's see.

I think we can merge in this state and improve later if needed. Thanks again @sadra-barikbin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: contrib Contrib module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add whitelist parameter to some contrib.tensorboard_logger & contrib.clearml_logger handlers

2 participants