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: Fix metric info generation for sessions without run names. #6541

Merged

Conversation

bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Aug 11, 2023

Fix a bug where we couldn't generate metric infos for HyperparameterSessionRun without run names. We were failing to match the sessions with the runs returned by scalars_metadata().

As an example:

When a HyperparameterSessionRun does not contain run field, we were generating session_names of the form 'exp1/', 'exp2/', etc.. with a trailing '/'. Meanwhile, runs would be just of the form 'exp1/run_name'.
The logic to match paths in _find_longest_parent_path() would first try to find 'exp1/run_name' in session_names and then 'exp1' in session_names. The second try would fail because of the trailing slashes in session_names.

So, instead, when there is no run field in a HyperparameterSessionRun, we drop the final '/' and just generate names like 'exp1', 'exp2', etc... and the algorithm in _find_longest_parent_path() succeeds.

@bmd3k bmd3k changed the title Fix scenario where session does not specify a run name. Hparams: Fix metric info generation for sessions without run names. Aug 11, 2023
@bmd3k bmd3k requested a review from yatbear August 11, 2023 15:30
session_groups=[
provider.HyperparameterSessionGroup(
root=provider.HyperparameterSessionRun(
experiment_id="exp/session_1", run=""
Copy link
Member

Choose a reason for hiding this comment

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

Should the id field just be exp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it has to be the entire path of the session. I left a comment in the test trying to explain for future readers.

@bmd3k bmd3k merged commit 4669e6d into tensorflow:master Aug 14, 2023
13 checks passed
bmd3k added a commit that referenced this pull request Aug 14, 2023
…s. (#6543)

Generate metric values for hparams plugin `/session_groups` requests
when the session groups are generated from
DataProvider.read_hyperparameters().

We need to reuse the logic introduced in
#6539 to generate
metric_infos for each session group and also query for scalar values. We
reuse the existing logic to join the two collections of data into
metric_values for the `/session_groups` request.

We also continue the work begun in
#6541 to improve how we
generate sessions - in this case also handling cases where experiment_id
is not specified for the session. This became urgently necessary to
address in order to get new tests in list_session_groups_test.py to work
with existing test data.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…ensorflow#6541)

Fix a bug where we couldn't generate metric infos for
HyperparameterSessionRun without run names. We were failing to match the
sessions with the runs returned by scalars_metadata().

As an example:

When a HyperparameterSessionRun does not contain `run` field, we were
generating session_names of the form 'exp1/', 'exp2/', etc.. with a
trailing '/'. Meanwhile, runs would be just of the form 'exp1/run_name'.
The logic to match paths in _find_longest_parent_path() would first try
to find 'exp1/run_name' in session_names and then 'exp1' in
session_names. The second try would fail because of the trailing slashes
in session_names.

So, instead, when there is no `run` field in a HyperparameterSessionRun,
we drop the final '/' and just generate names like 'exp1', 'exp2',
etc... and the algorithm in _find_longest_parent_path() succeeds.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…s. (tensorflow#6543)

Generate metric values for hparams plugin `/session_groups` requests
when the session groups are generated from
DataProvider.read_hyperparameters().

We need to reuse the logic introduced in
tensorflow#6539 to generate
metric_infos for each session group and also query for scalar values. We
reuse the existing logic to join the two collections of data into
metric_values for the `/session_groups` request.

We also continue the work begun in
tensorflow#6541 to improve how we
generate sessions - in this case also handling cases where experiment_id
is not specified for the session. This became urgently necessary to
address in order to get new tests in list_session_groups_test.py to work
with existing test data.
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