Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: update hparams plugin to generate domains for boolean hparams #6393

Merged
merged 2 commits into from
May 19, 2023

Conversation

rileyajones
Copy link
Contributor

Motivation for features / changes

This has been a bug for a while that we only noticed now that hparams are being used to filter runs in the time series dashboard.

Googlers see https://chat.google.com/room/AAAA03izhrk/VyyPgojcNvY for context on how this was discovered

Technical description of changes

Boolean HParams were not having a domain set. This lead to the ui treating them as intervals, however, this lead to incorrect filter conditions. We currently treat all non number values being filtered this way as not matching (the alternative would be to treat them all as being true which also seems wrong). This leads to all runs with a value for a boolean hparam being filtered out.

Screenshots of UI changes (or N/A)

Googlers see cl/532932348

Alternate designs / implementations considered (or N/A)

This could have been done on the client but ideally the bug would be fixed in other places where the api is being used.

@rileyajones rileyajones force-pushed the boolean-domains branch 3 times, most recently from e862eb2 to 0c4c8c9 Compare May 17, 2023 23:07
@rileyajones rileyajones marked this pull request as ready for review May 18, 2023 16:18
@rileyajones rileyajones requested a review from bmd3k May 18, 2023 16:18
Copy link
Contributor

@bmd3k bmd3k left a comment

Choose a reason for hiding this comment

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

The change makes sense to me. However, it is worth noting that the hparams dashboard code already works around this backend limitation:

Can/did you:

  1. Check to see how this change impacts the existing hparams dashboard?
  2. Consider changing the hparams dashboard code to read the domain from the backend result rather than generating the domain itself?

tensorboard/plugins/hparams/backend_context_test.py Outdated Show resolved Hide resolved
}
"""
ctxt = backend_context.Context(
self._mock_tb_context, max_domain_discrete_len=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably clearer not to specify max_domain_discrete_len since it has no impact on the result.

"""
self.session_2_start_info_ = """
hparams:[
{key: 'batch_size' value: {bool_value: false}}
Copy link
Contributor

Choose a reason for hiding this comment

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

What's interesting about the logic you've added is that the domain is [True, False] no matter what the values are in *start_info_. I think it would be worth acknowledging that by changing this test case (or adding new ones) so that only a single value (one of True or one of False) is specied in *start_info_.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, I'll make them both True here so that it is more self evident

tensorboard/plugins/hparams/backend_context.py Outdated Show resolved Hide resolved
@rileyajones
Copy link
Contributor Author

The change makes sense to me. However, it is worth noting that the hparams dashboard code already works around this backend limitation:

Can/did you:

  1. Check to see how this change impacts the existing hparams dashboard?
  2. Consider changing the hparams dashboard code to read the domain from the backend result rather than generating the domain itself?

I check the hparams dashboard and added more screenshots to the cl I linked in the description. TLDR it does effect it but not in a meaningful way (the filter is just moved)

I will try to remember to update the hparams dashboard the next time that I am on call.

@rileyajones rileyajones requested a review from bmd3k May 18, 2023 21:41
@bmd3k
Copy link
Contributor

bmd3k commented May 19, 2023

I will try to remember to update the hparams dashboard the next time that I am on call.

Perhaps the best way to remember is to create a bug and assign it to yourself. Or add it to your hparams-in-timeseries task list and assign it to yourself.

@rileyajones
Copy link
Contributor Author

I will try to remember to update the hparams dashboard the next time that I am on call.

Perhaps the best way to remember is to create a bug and assign it to yourself. Or add it to your hparams-in-timeseries task list and assign it to yourself.

b/283462407

@rileyajones rileyajones merged commit a0865d9 into tensorflow:master May 19, 2023
14 checks passed
rileyajones added a commit that referenced this pull request May 22, 2023
…nTimeSeries` is `true` (#6399)

## Motivation for features / changes
We have been discovering issues with the way the hparam domains are
defined. This has lead to issues due to #6377 causing scalar cards to
appear empty when one of these issues occurs. I attempted to fix this in
#6393 but missed the situation where a string type hparam with more than
10 values returns an empty domain (Googlers see tb/3183400180427144287
for an example).

I am moving the new filtering logic added in by #6377 behind a flag
while we fix this issue on the backend.

## Screenshots of UI changes (or N/A)
Screenshots for Googlers only

Before: https://screenshot.googleplex.com/AELb2oHqhxa8UNF

After:
Feature Flag Enabled: https://screenshot.googleplex.com/AcPxsbNNXSSFGx9
Feature Flag Disabled: https://screenshot.googleplex.com/3aEXpfHrGZdzYgZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants