Skip to content

Commit 1346620

Browse files
authored
Hparams: Avoid retrieving metrics when populating timeseries runs table 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.
1 parent 71147eb commit 1346620

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

tensorboard/webapp/hparams/_redux/hparams_data_source.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
Domain,
2121
DomainType,
2222
BackendListSessionGroupRequest,
23+
BackendHparamsExperimentRequest,
2324
BackendHparamsExperimentResponse,
2425
BackendHparamSpec,
2526
DiscreteDomainHparamSpec,
@@ -90,12 +91,20 @@ export class HparamsDataSource {
9091
experimentIds: string[]
9192
): Observable<HparamAndMetricSpec> {
9293
const formattedExperimentIds = this.formatExperimentIds(experimentIds);
94+
95+
const experimentRequest: BackendHparamsExperimentRequest = {
96+
experimentName: formattedExperimentIds,
97+
// The hparams feature generates its own metric data and does not require
98+
// the backend to calculate it.
99+
includeMetrics: false,
100+
};
101+
93102
return this.http
94103
.post<BackendHparamsExperimentResponse>(
95104
`/${this.getPrefix(
96105
experimentIds
97106
)}/${formattedExperimentIds}/${HPARAMS_HTTP_PATH_PREFIX}/experiment`,
98-
{experimentName: formattedExperimentIds},
107+
experimentRequest,
99108
{},
100109
'request'
101110
)
@@ -151,6 +160,9 @@ export class HparamsDataSource {
151160
startIndex: 0,
152161
// arbitrary large number so it does not get clipped.
153162
sliceSize: 1e6,
163+
// The hparams feature generates its own metric data and does not require
164+
// the backend to calculate it.
165+
includeMetrics: false,
154166
};
155167

156168
return this.http

tensorboard/webapp/hparams/_types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export {
3636
HparamSpec as BackendHparamSpec,
3737
DiscreteDomainHparamSpec,
3838
IntervalDomainHparamSpec,
39+
BackendHparamsExperimentRequest,
3940
BackendHparamsExperimentResponse,
4041
BackendListSessionGroupResponse,
4142
BackendListSessionGroupRequest,

tensorboard/webapp/runs/data_source/runs_backend_types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ export function isDiscreteDomainHparamSpec(
8585
return spec.hasOwnProperty('domainDiscrete');
8686
}
8787

88+
export interface BackendHparamsExperimentRequest {
89+
experimentName: string;
90+
includeMetrics?: boolean;
91+
}
92+
8893
export interface BackendHparamsExperimentResponse {
8994
description: string;
9095
hparamInfos: HparamSpec[];
@@ -108,6 +113,7 @@ export interface BackendListSessionGroupRequest {
108113
colParams: Array<HparamsColFilterParams | MetricsColFilterParams>;
109114
startIndex: number;
110115
sliceSize: number;
116+
includeMetrics?: boolean;
111117
}
112118

113119
export interface Session {

0 commit comments

Comments
 (0)