Skip to content

Conversation

@rileyajones
Copy link
Contributor

Motivation for features / changes

The runs table currently contains the logic to filter runs by hparams, unfortunately, this logic is not shared with the rest of the dashboard and so filtering runs this way does not actually effect what is shown on the dashboard.

Technical description of changes

I moved out a lot of utility functions from the runs table container into common selectors. I then created three selectors

  1. getRenderableRuns
    A private selector to help with the readability of getFilteredRenderableRuns
    Gets all runs associated with the provided experiment ids
  2. getFilteredRenderableRuns
    Gets all runs associated with the provided experiment ids while accounting for filters.
  3. getFilteredRenderableRunsFromRoute
    Retrieves the experiment ids from the route then gets the filtered runs associated with them

NOTE: The utility functions are encapsulated in a utils object so that they can be spied on during testing

See the PRs leading up to this
#6340 #6360 #6361 #6323 #6324

Screenshots of UI changes (or N/A)

N/A

@rileyajones rileyajones requested a review from JamesHollyer May 3, 2023 23:04
@rileyajones rileyajones marked this pull request as ready for review May 4, 2023 01:07
return createSelector(
getRunsFromExperimentIds(experimentIds),
getExperimentNames(experimentIds),
getCurrentRouteRunSelection,
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit confused here. This selector returns null when current route is not about an experiment. So how does this work in OSS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In OSS the route is always an experiment. see getExperimentIdsFromRouteParams
in tensorboard/webapp/app_routing/internal_utils.ts. TLDR it returns DEFAULT_EXPERIMENT_ID e.g. defaultExperimentId when no experiment ids are found in the route

}
if (filter.type === DomainType.DISCRETE) {
// (upcast to work around bad TypeScript libdefs)
const values: Readonly<Array<typeof filter.filterValues[number]>> =
Copy link
Contributor

Choose a reason for hiding this comment

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

this type is confusing me. What does the "number" thing do? DiscreteHparamValues are supposed to be arrays of numbers, strings, or booleans.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is confusing to me too (I didn't write it) but it seems to work and I don't really want to change it.

expect(
selectors.TEST_ONLY.utils.filterRunItemsByRegex(
runTableItems,
'run1',
Copy link
Contributor

Choose a reason for hiding this comment

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

If you make the 3rd run run3 I think it will serve this test well to make it 'run[13]'.

).toEqual(0);
});

it('filters by hparams using interval filters', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure we need to test the different types of hparam or metric filters as that is already tested in the matchfilter test. I am ok with leaving them in though.

const spy = spyOn(
selectors.TEST_ONLY.utils,
'filterRunItemsByHparamAndMetricFilter'
).and.callThrough();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be nice to ensure it returns the result of the filtering. Maybe mock it to return one of the runs and then test that it is in the results? Also, ok with this if you feel it is not necessary.

@rileyajones rileyajones requested a review from JamesHollyer May 5, 2023 17:47
@rileyajones rileyajones merged commit 99bc3c0 into tensorflow:master May 9, 2023
rileyajones added a commit that referenced this pull request May 12, 2023
…ters (#6377)

## Motivation for features / changes
As part of the effort to bring hparams data to the time series dashboard
we are expanding the hparams filtering functionality in the runs table
to effect the runs being shown in rest of the dashboard

Now that #6366 is merged, the rest of the dashboard can now access the
list of runs with respect for any hparam filters a user has applied.

## Screenshots of UI changes (or N/A)
No Filters

![image](https://github.com/tensorflow/tensorboard/assets/78179109/b313e5d6-d440-414c-91f9-e15b04eee4ff)

Several HParam Filters Applied

![image](https://github.com/tensorflow/tensorboard/assets/78179109/d7dc4a8f-6191-4ec3-8745-9cedee41ab05)

Regex and HParam Filter Applied

![image](https://github.com/tensorflow/tensorboard/assets/78179109/60f5bdda-d0b5-47e0-be2d-52b315416940)

Only  a Regex Filter Applied

![image](https://github.com/tensorflow/tensorboard/assets/78179109/5962b80a-df8e-47de-99d1-9068158e2280)

All Runs Selected

![image](https://github.com/tensorflow/tensorboard/assets/78179109/00498d6d-7c0f-4d92-8309-84382fa304f7)

1 Run Deselected

![image](https://github.com/tensorflow/tensorboard/assets/78179109/5a51794b-1dd1-4b32-bd81-44f932265d45)


## Detailed steps to verify changes work correctly (as executed by you)
1) Start tensorboard with a logdir which contains hparam data
2) Navigate to http://localhost:6006?enableHparamsInTimeSeries
3) Filter the runs table by regex and ensure scalar cards reflect this
4) Unselect some runs and ensure scalar cards reflect this
5) Filter the runs table by an hparam and ensure scalar cards reflect
this.
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