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: Allow runs in the time series dashboard to be filtered by hparam #6488

Merged
merged 7 commits into from
Aug 30, 2023

Conversation

rileyajones
Copy link
Contributor

@rileyajones rileyajones commented Jul 10, 2023

Motivation for features / changes

The previous runs table allowed the rows to be filtered by hparam. We would like to maintain this behavior.

Technical description of changes

The existing runs table had an UI for adding hparam filters but the components are all contained within the runs table component. Therefore I am breaking the UI affordances out into discrete components.

Screenshots of UI changes (or N/A)

The UI (Light Mode):
image

The UI (Dark Mode):
image

Interval Filters:
image

Filtered:
image

No Matches:
image

The option does not appear for non filterable columns:
image

Using The Feature
536ff53b-ec85-4276-a1b8-5e887051faae

@@ -16,6 +16,9 @@ import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import * as backendTypes from './runs_backend_types';

import {DomainType} from '../../widgets/data_table/types';
export {DomainType} from '../../widgets/data_table/types';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't care for reexporting this way but there are a bunch of other places which import his type then reexport it so it is non trivial to fix.

@@ -24,7 +25,7 @@ tf_ts_library(
srcs = [
"runs_backend_types.ts",
],
visibility = ["//visibility:private"],
visibility = ["//tensorboard/webapp/runs/data_source:__subpackages__", "//tensorboard/webapp/widgets/data_table:__subpackages__",],
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 web of dependencies is pretty messy and I would love to clean it up, but I would rather not block the launch of this feature on this cleanup.

"//tensorboard/webapp/angular:expect_angular_material_button",
"//tensorboard/webapp/angular:expect_angular_material_checkbox",
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 will likely lead to issues when this is synced internally.

@@ -0,0 +1,35 @@
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's quite possible that this should be it's own widget rather than being part of the data table widget. This approach seemed slightly easier but I'm quite open to feedback on this.

@@ -53,6 +90,7 @@ export interface ColumnHeader {
removable?: boolean;
sortable?: boolean;
movable?: boolean;
filterable?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically we could use the existence of a value in the columnFilters map to determine this but I prefer this approach to keep things consistent.

Comment on lines 45 to 70
export enum DomainType {
DISCRETE,
INTERVAL,
}

export type DiscreteFilterValues = string[] | number[] | boolean[];

export type DiscreteFilterValue = DiscreteFilterValues[number];

export interface DiscreteFilter {
type: DomainType.DISCRETE;
includeUndefined: boolean;
possibleValues: DiscreteFilterValues;
// Subset of `possibleValues`
filterValues: DiscreteFilterValues;
}

export interface DiscreteFilterChange {
hparamName: string;
includeUndefined: boolean;
filterValues: DiscreteFilterValues;
}

export interface IntervalFilter {
type: DomainType.INTERVAL;
includeUndefined: boolean;
minValue: number;
maxValue: number;
// Filter values have to be in between min and max values (inclusive).
filterLowerValue: number;
filterUpperValue: number;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These have all been copied over from runs_data_source_types. I actually prefer moving these all to an even more independent location but would prefer to do that as a later cleanup.

Comment on lines 50 to 52
export type DiscreteFilterValues = string[] | number[] | boolean[];

export type DiscreteFilterValue = DiscreteFilterValues[number];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two have been copied and renamed rather than moved. Once the old runs table is removed the old versions can be removed.

@rileyajones rileyajones force-pushed the hparam-filters branch 2 times, most recently from 79e2d4d to 3146158 Compare July 11, 2023 21:22
Comment on lines 37 to 53
export interface DiscreteFilter {
type: DomainType.DISCRETE;
includeUndefined: boolean;
possibleValues: DiscreteHparamValues;
// Subset of `possibleValues`
filterValues: DiscreteHparamValues;
}

export interface IntervalFilter {
type: DomainType.INTERVAL;
includeUndefined: boolean;
minValue: number;
maxValue: number;
// Filter values have to be in between min and max values (inclusive).
filterLowerValue: number;
filterUpperValue: number;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These have been moved to the data table types because that is where the filtering is being done now.

@rileyajones rileyajones changed the title [WIP] HParams: Allow runs in the time series dashboard to be filtered by hparam HParams: Allow runs in the time series dashboard to be filtered by hparam Jul 11, 2023
rileyajones added a commit that referenced this pull request Aug 15, 2023
## Motivation for features / changes
We want to be able to filter the runs table by hparam. The existing
logic for this is handled by a bunch of inner components found in the
runs_table_component which makes it hard to share. In this PR I am
replicating that UI with some enhancements in a standalone component
which will later be used by the data_table_component.

See #6488 for screenshots and a more complete description of what is
being added

## Alternate designs / implementations considered (or N/A)
I'm not sure that this component should be part of the data table but
that is simplest place to put it for now.
rileyajones added a commit that referenced this pull request Aug 22, 2023
…6553)

## Motivation for features / changes
Now that the filter dialog is merged #6493 we need to add support for
filtering by hparams. However, #6544 changed the way hparam values are
read. This change adds a new property to state in which to store
dashboard related hparam and metric filters.

See #6488 for the WIP integration with the runs_table_container +
tb_data_table -> common_selectors + hparam_selectors.
@rileyajones rileyajones marked this pull request as ready for review August 25, 2023 00:32
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
## Motivation for features / changes
We want to be able to filter the runs table by hparam. The existing
logic for this is handled by a bunch of inner components found in the
runs_table_component which makes it hard to share. In this PR I am
replicating that UI with some enhancements in a standalone component
which will later be used by the data_table_component.

See tensorflow#6488 for screenshots and a more complete description of what is
being added

## Alternate designs / implementations considered (or N/A)
I'm not sure that this component should be part of the data table but
that is simplest place to put it for now.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Aug 25, 2023
…ensorflow#6553)

## Motivation for features / changes
Now that the filter dialog is merged tensorflow#6493 we need to add support for
filtering by hparams. However, tensorflow#6544 changed the way hparam values are
read. This change adds a new property to state in which to store
dashboard related hparam and metric filters.

See tensorflow#6488 for the WIP integration with the runs_table_container +
tb_data_table -> common_selectors + hparam_selectors.
getDashboardHparamsAndMetricsSpecs,
getDashboardHparamFilterMap,
getDashboardMetricsFilterMap,
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this re ordered for a reason? I would rather the only change here be the addition of getDashboardDefaultHparamFilters

tensorboard/webapp/runs/data_source/runs_data_source.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@JamesHollyer JamesHollyer left a comment

Choose a reason for hiding this comment

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

Looks good after you fix that DomainType import in the runs_data_source file.

@rileyajones rileyajones merged commit 3a70adc into tensorflow:master Aug 30, 2023
13 checks passed
rileyajones added a commit that referenced this pull request Sep 6, 2023
…6568)

## Motivation for features / changes
`zip` and `forkJoin` work somewhat differently internally so these
observables simply aren't emitting and thus break our sync.

Googlers see cl/562877415 for the breakage and cl/cl/563214152 as proof
that this works.


#6566 #6488
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