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

Hparams: Support excluding metric information in HTTP requests. #6556

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Aug 23, 2023

There are some clients of the Hparams HTTP API that do not require the metric information. This includes the metric_infos usually returned in the /experiments request and the metric_values usually returned in the /session_groups request. Since these can be expensive to calculate, we want the option to not calculate and return them in the response.

Add option include_metrics to both GetExperimentRequest and ListSessionGroupsRequest. If unspecified we treat include_metrics as True, for backward compatibility. Honor the include_metrics property in all three major cases: When experiment metadata is defined by Experiment tags, by Session tags, or by the DataProvider.

@bmd3k bmd3k requested a review from yatbear August 23, 2023 15:47
Copy link
Member

@yatbear yatbear left a comment

Choose a reason for hiding this comment

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

Nice! Thanks!

@@ -37,9 +41,15 @@ def run(self):
An Experiment object.
"""
experiment_id = self._experiment_id
include_metrics = (
not self._request.HasField("include_metrics")
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could you add a comment for L45 to mention metrics are included by default (if this option is not specified), just to minimize cognitive load.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@bmd3k bmd3k merged commit 2a91acc into tensorflow:master Aug 24, 2023
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…orflow#6556)

There are some clients of the Hparams HTTP API that do not require the
metric information. This includes the metric_infos usually returned in
the /experiments request and the metric_values usually returned in the
/session_groups request. Since these can be expensive to calculate, we
want the option to not calculate and return them in the response.

Add option `include_metrics` to both GetExperimentRequest and
ListSessionGroupsRequest. If unspecified we treat `include_metrics` as
True, for backward compatibility. Honor the `include_metrics` property
in all three major cases: When experiment metadata is defined by
Experiment tags, by Session tags, or by the DataProvider.
bmd3k added a commit that referenced this pull request Nov 7, 2023
…le with hparams. (#6678)

The runs table does not display any of the metric fields/data returned
by the hparams plugin. We want to avoid unnecessarily calculating this
data on the backend.

The hparams plugin allows requests to specify an include_metrics
parameter (added in
#6556). We set this flag
to false for all hparams-related requests coming from the
"hparams_data_source".

Testing:
* Observed in both OSS and internal TensorBoard that setting this flag
to False results in responses that do not include the metric data.
* Observed that hparams in timeseries runs table still works.
* Observed that hparams in experiment list runs table still works.
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.

2 participants