profile
viewpoint
Shanqing Cai caisq Google Laniakea Supercluster https://caisq.github.io/ {TensorFlow, TensorFlow.js} @ Google

tensorflow/benchmarks 762

A benchmark framework for Tensorflow

caisq/tensorflow 2

Computation using data flow graphs for scalable machine learning

caisq/NeuroEvolution-Vehicles 1

Raw code from Live Stream May 13 2019

caisq/tensorboard 1

TensorFlow's Visualization Toolkit

caisq/tfjs-layers-1 1

TensorFlow.js high-level layers API

caisq/tfjs-models 1

Pretrained models for TensorFlow.js

caisq/audapter_matlab 0

MATLAB code for Audapter

caisq/caisq.github.io 0

Shanqing Cai's Homepage (GitHub-hosted)

push eventcaisq/tensorboard

Shanqing Cai

commit sha 088ffce0ef74ad1ab0a28c4d1fbce1900f017a7e

Add TODO item

view details

push time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 limitations under the License.  .alerts-breakdown-container {   font-size: 13px;-  padding: 10px 10px 10px 50px;+  padding: 10px 10px 10px;   position: relative; } +.alerts-breakdown-type {+  border-radius: 0px 10px 10px 0px;+  cursor: pointer;+  line-height: 30px;

line-height is needed here to make sure that the children of this element are placed vertically in the middle.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

       >         <div           class="execution-digest"-          [ngClass]="[displayDigest.is_graph ? 'func-graph-execution' : '', i === focusedExecutionDisplayIndex ? 'focused' : '']"+          [ngClass]="[+            displayDigest.is_graph ? 'func-graph-execution' : '',

This doesn't quite work for me. It would be slightly cleaner if it worked, but what I have right now isn't too bad either.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 limitations under the License. import {ChangeDetectionStrategy, Component} from '@angular/core'; import {createSelector, select, Store} from '@ngrx/store'; -import {getAlertsBreakdown, getNumAlerts, State} from '../../store';+import {+  getAlertsBreakdown,+  getAlertsFocusType,+  getNumAlerts,+  State,+} from '../../store'; import {AlertType} from '../../store/debugger_types';+import {AlertTypeDisplay} from './alerts_component';  /** @typehack */ import * as _typeHackRxjs from 'rxjs';+import {alertTypeFocusToggled} from '../../actions';

Done.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 describe('debugger selectors', () => {     });   }); +  describe('getAlertTypesOfVisibleExecutionDigests', () => {+    it('returns all-null array when there is no focused alert type', () => {+      const state = createState(+        createDebuggerState({+          activeRunId: '__default_debugger_run__',+          executions: {+            numExecutionsLoaded: {+              state: DataLoadState.LOADING,+              lastLoadedTimeInMs: null,+            },+            executionDigestsLoaded: {+              state: DataLoadState.NOT_LOADED,+              lastLoadedTimeInMs: null,+              pageLoadedSizes: {},+              numExecutions: 0,+            },+            pageSize: 1000,+            displayCount: 3,+            focusIndex: null,+            scrollBeginIndex: 0,+            executionDigests: {+              0: createTestExecutionDigest(),+              1: createTestExecutionDigest(),+              2: createTestExecutionDigest(),+            },+            executionData: {},+          },+        })+      );++      const alertTypes = getFocusAlertTypesOfVisibleExecutionDigests(state);+      expect(alertTypes).toEqual([null, null, null]);+    });++    it('returns correct non-null array when there is focused alert type', () => {+      const state = createState(+        createDebuggerState({+          activeRunId: '__default_debugger_run__',+          alerts: createAlertsState({+            focusType: AlertType.INF_NAN_ALERT,+            executionIndices: {+              [AlertType.INF_NAN_ALERT]: [0, 2, 3],+            },+          }),+          executions: {+            numExecutionsLoaded: {+              state: DataLoadState.LOADING,+              lastLoadedTimeInMs: null,+            },+            executionDigestsLoaded: {+              state: DataLoadState.NOT_LOADED,+              lastLoadedTimeInMs: null,+              pageLoadedSizes: {},+              numExecutions: 0,+            },+            pageSize: 1000,+            displayCount: 3,+            focusIndex: null,+            scrollBeginIndex: 0,+            executionDigests: {+              0: createTestExecutionDigest(),+              1: createTestExecutionDigest(),+              2: createTestExecutionDigest(),

Even if we add an entry for 3, it'll be outside the scrolling window and hence invisible, due to displayCount: 3. But to humor that case, I added 3 here anyway. It doesn't change the assertions.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/-import {Component, Input} from '@angular/core';+import {Component, EventEmitter, Input, Output} from '@angular/core';++import {AlertType} from '../../store/debugger_types';  export interface AlertTypeDisplay {   displayName: string;   displaySymbol: string;   count: number;+

Done.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 const reducer = createReducer(       };     }   ),+  on(+    actions.alertsOfTypeLoaded,+    (+      state: DebuggerState,+      {numAlerts, alertsBreakdown, alertType, begin, alerts}+    ): DebuggerState => {+      const runId = state.activeRunId;+      if (runId === null) {+        return state;+      }++      const newState = {+        ...state,+        alerts: {+          ...state.alerts,+          alertsLoaded: {+            ...state.alerts.alertsLoaded,+            state: DataLoadState.LOADED,+            lastLoadedTimeInMs: Date.now(),+          },+          numAlerts,+          alertsBreakdown,+          alerts: {+            ...state.alerts.alerts,+          },+        },+      };+      if (alerts.length === 0) {+        return newState;+      }+      if (newState.alerts.alerts[alertType] === undefined) {+        newState.alerts.alerts[alertType] = {};+      }+      if (newState.alerts.executionIndices[alertType] === undefined) {+        newState.alerts.executionIndices[alertType] = [];+      }+      for (let i = 0; i < alerts.length; ++i) {+        const alertIndex = begin + i;+        const alert = alerts[i];+        newState.alerts.alerts[alertType][alertIndex] = alert;

Done with the refactoring along the line you suggested. Thanks.

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 import {   createDebuggerState,   createState,   createTestExecutionData,+  createTestExecutionDigest,+  createTestInfNanAlert, } from '../testing';  describe('debugger selectors', () => {   describe('getAlertsLoaded', () => {-    it('Returns correct NOT_LOADED state', () => {+    it('returns correct NOT_LOADED state', () => {       const state = createState(createDebuggerState());       const alertsLoaded = getAlertsLoaded(state);       expect(alertsLoaded.state).toBe(DataLoadState.NOT_LOADED);       expect(alertsLoaded.lastLoadedTimeInMs).toBe(null);     }); -    it('Returns correct LOADING state', () => {+    it('returns correct LOADING state', () => {

Ack. Going forward I'll be consistent with the lower case.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export class AlertsContainer {         (alertsBreakdown) => {           const alertTypes = Object.keys(alertsBreakdown);           alertTypes.sort();-          return alertTypes.map((alertType) => {-            return {-              ...ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL[alertType],-              count: alertsBreakdown[alertType],-            };-          });+          return alertTypes.map(+            (alertType): AlertTypeDisplay => {+              return {+                ...ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL[alertType],

I like what you suggested: slightly less code.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export const getVisibleExecutionDigests = createSelector(   } ); +/**+ * Get the focused alert types (if any) of the execution digests current being+ * displayed. For each displayed execution digest, there are two possibilities:+ * - `null` represents no alert.+ * - An instance of the `AlertType`+ */+export const getFocusAlertTypesOfVisibleExecutionDigests = createSelector(+  selectDebuggerState,+  (state: DebuggerState): Array<AlertType | null> => {+    const beginExecutionIndex = state.executions.scrollBeginIndex;+    const endExecutionIndex =+      state.executions.scrollBeginIndex + state.executions.displayCount;+    const alertTypes: Array<AlertType | null> = [];+    for (let i = beginExecutionIndex; i < endExecutionIndex; ++i) {+      alertTypes.push(null);+    }+    const focusType = state.alerts.focusType;+    if (focusType === null) {+      return alertTypes;+    }+    const executionIndices = state.alerts.executionIndices[focusType];+    if (executionIndices === undefined) {+      return alertTypes;+    }+    for (let i = beginExecutionIndex; i < endExecutionIndex; ++i) {+      if (executionIndices.includes(i)) {

I feel this may be premature optimization, because creating a Set itself has overhead. But I added a TODO item here to explore this option if this becomes a performance bottleneck.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

     </div>   </div>   <div class="alerts-breakdown-container">-    <div *ngFor="let breakdown of alertsBreakdown;">+    <div+      *ngFor="let breakdown of alertsBreakdown;"+      class="alerts-breakdown-type"+      [ngClass]="[breakdown.type === focusType ? 'focus' : '']"+      (click)="onToggleFocusType.emit(breakdown.type)"

There are other clickable things in the DebuggerV2 UI that are not buttons. I added a TODO item here to address that in a batch fashion in the future.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 limitations under the License.  .alerts-breakdown-container {   font-size: 13px;-  padding: 10px 10px 10px 50px;+  padding: 10px 10px 10px;   position: relative; } +.alerts-breakdown-type {+  border-radius: 0px 10px 10px 0px;

Done here and at another place in the same file. Thanks.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 describe('debugger selectors', () => {     });   }); +  describe('getAlertTypesOfVisibleExecutionDigests', () => {+    it('returns all-null array when there is no focused alert type', () => {+      const state = createState(+        createDebuggerState({+          activeRunId: '__default_debugger_run__',

Ack. In this particular case, the activeRunId is not needed. Removed it.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export const getNumAlerts = createSelector(   } ); +export const getAlertsFocusType = createSelector(+  selectDebuggerState,+  (state: DebuggerState): AlertType | null => {+    return state.alerts.focusType;+  }+);++/**+ * Get number of alerts of the alert type being focused on.+ *+ * If no alert type focus exists, returns 0.+ * The returned number is regardless of whether the detailed Alerts+ * data have been loaded by the front end.+ */+export const getNumAlertsOfFocusedType = createSelector(+  selectDebuggerState,+  (state: DebuggerState): number => {+    if (state.alerts.focusType === null) {+      return 0;+    }+    return state.alerts.alertsBreakdown[state.alerts.focusType] || 0;

Unfortunately, TypeScript does not support that.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 describe('Debugger reducers', () => {     });   }); +  for (const {displayCount, expectedScrollBegin} of [+    {+      displayCount: 4,+      expectedScrollBegin: 8,+    },+    {+      displayCount: 30,+      expectedScrollBegin: 0,+    },+  ]) {+    it('Updates alerts data on alertsOfTypeLoaded: empty initial state', () => {+      const firstAlertExecutionIndex = 10;+      const state = createDebuggerState({+        activeRunId: '__default_debugger_run__',+        alerts: createAlertsState({+          alertsLoaded: {+            state: DataLoadState.LOADING,+            lastLoadedTimeInMs: null,+          },+        }),+        executions: createDebuggerExecutionsState({+          displayCount,+          scrollBeginIndex: 0,+        }),+      }); // `alerts` state is in an empty initial state.+      const alert0 = createTestInfNanAlert({+        op_type: 'RealDiv',+        execution_index: firstAlertExecutionIndex,+      });+      const alert1 = createTestInfNanAlert({+        op_type: 'Log',+        execution_index: firstAlertExecutionIndex + 1,+      });+      const nextState = reducers(+        state,+        actions.alertsOfTypeLoaded({+          numAlerts: 2,+          alertsBreakdown: {+            InfNanAlert: 2,+          },+          begin: 0,+          end: 2,+          alertType: 'InfNanAlert',+          alerts: [alert0, alert1],+        })+      );+      expect(nextState.alerts.alertsLoaded.state).toBe(DataLoadState.LOADED);+      expect(nextState.alerts.alertsLoaded.lastLoadedTimeInMs).toBeGreaterThan(+        0+      );+      expect(nextState.alerts.numAlerts).toBe(2);+      expect(nextState.alerts.alertsBreakdown).toEqual({+        [AlertType.INF_NAN_ALERT]: 2,+      });+      expect(Object.keys(nextState.alerts.alerts)).toEqual([+        AlertType.INF_NAN_ALERT,+      ]);+      const alertsOfType = nextState.alerts.alerts[AlertType.INF_NAN_ALERT];+      expect(Object.keys(alertsOfType).length).toBe(2);+      expect(alertsOfType[0]).toEqual(alert0);+      expect(alertsOfType[1]).toEqual(alert1);+      expect(Object.keys(nextState.alerts.executionIndices)).toEqual([+        AlertType.INF_NAN_ALERT,+      ]);+      const executionIndices =+        nextState.alerts.executionIndices[AlertType.INF_NAN_ALERT];+      expect(executionIndices).toEqual([+        firstAlertExecutionIndex,+        firstAlertExecutionIndex + 1,+      ]);+      // Verify that the first alert is scrolled into view.+      expect(nextState.executions.scrollBeginIndex).toEqual(+        expectedScrollBegin+      );+    });+  }++  it('Updates alerts data on alertsOfTypeLoaded: non-empty initial state', () => {+    const alert0 = createTestInfNanAlert({+      op_type: 'RealDiv',+      execution_index: 10,+    });+    const alert1 = createTestInfNanAlert({+      op_type: 'Log',+      execution_index: 11,+    });+    const state = createDebuggerState({+      activeRunId: '__default_debugger_run__',+      alerts: createAlertsState({+        alertsLoaded: {+          state: DataLoadState.LOADING,+          lastLoadedTimeInMs: null,+        },+        numAlerts: 1,+        alertsBreakdown: {[AlertType.INF_NAN_ALERT]: 1},

Done.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export const getNumAlerts = createSelector(   } ); +export const getAlertsFocusType = createSelector(+  selectDebuggerState,+  (state: DebuggerState): AlertType | null => {+    return state.alerts.focusType;+  }+);++/**+ * Get number of alerts of the alert type being focused on.

Ack. I'll save the fixes for a separate PR as they are logically somewhat unrelated to this PR.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export const getVisibleExecutionDigests = createSelector(   } ); +/**+ * Get the focused alert types (if any) of the execution digests current being+ * displayed. For each displayed execution digest, there are two possibilities:+ * - `null` represents no alert.+ * - An instance of the `AlertType`+ */+export const getFocusAlertTypesOfVisibleExecutionDigests = createSelector(+  selectDebuggerState,+  (state: DebuggerState): Array<AlertType | null> => {+    const beginExecutionIndex = state.executions.scrollBeginIndex;+    const endExecutionIndex =+      state.executions.scrollBeginIndex + state.executions.displayCount;+    const alertTypes: Array<AlertType | null> = [];+    for (let i = beginExecutionIndex; i < endExecutionIndex; ++i) {+      alertTypes.push(null);

Done. I was vaguely remembering this API at the back of my mind. Thanks for reminding me of it.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 describe('Debugger reducers', () => {     });   }); +  for (const {displayCount, expectedScrollBegin} of [+    {+      displayCount: 4,+      expectedScrollBegin: 8,+    },+    {+      displayCount: 30,+      expectedScrollBegin: 0,+    },+  ]) {+    it('Updates alerts data on alertsOfTypeLoaded: empty initial state', () => {

Done.

caisq

comment created time in 4 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export class DebuggerEffects {     );   } +  /**+   * Emits when user focuses on an alert type.+   *+   * Returns an Observable for what additional execution digests need to be fetched.+   */+  private onAlertTypeFocused(): Observable<{+    runId: string;+    begin: number;+    end: number;+  }> {+    return this.actions$.pipe(+      ofType(alertTypeFocusToggled),+      withLatestFrom(+        this.store.select(getActiveRunId),+        this.store.select(getAlertsFocusType),+        this.store.select(getNumAlertsOfFocusedType),+        this.store.select(getLoadedAlertsOfFocusedType),+        this.store.select(getAlertsLoaded)+      ),+      filter(+        ([+          ,+          runId,+          focusType,+          numAlertsOfFocusedType,+          loadedAlertsOfFocusedType,+          alertsLoaded,+        ]) => {+          return (+            runId !== null &&+            focusType !== null &&+            numAlertsOfFocusedType > 0 &&+            (loadedAlertsOfFocusedType === null ||+              Object.keys(loadedAlertsOfFocusedType).length <+                numAlertsOfFocusedType) &&+            alertsLoaded.state !== DataLoadState.LOADING+          );+        }+      ),+      tap(() => this.store.dispatch(numAlertsAndBreakdownRequested())),+      mergeMap(([, runId, focusType]) => {+        const begin = 0;+        // TODO(cais): Use smarter `end` value to reduce the amount of data+        // fetch each time.+        const end = -1;+        return this.dataSource+          .fetchAlerts(runId as string, begin, end, focusType! as string)+          .pipe(

This part is now refactored into two separate functions. (See my reply to your related comment below.)

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 const reducer = createReducer(   on(     actions.executionDigestFocused,     (state: DebuggerState, action): DebuggerState => {-      return {+      const newState = {         ...state,         executions: {           ...state.executions,           focusIndex: state.executions.scrollBeginIndex + action.displayIndex,         },       };+      return newState;

Fixed.

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 describe('Debugger effects', () => {       );     }   });++  describe('load alerts of given type', () => {+    const runId = '__default_debugger_run__';+    const alert0 = createTestInfNanAlert({+      op_type: 'Op0',+      execution_index: 10,+    });+    const alert1 = createTestInfNanAlert({+      op_type: 'Op1',+      execution_index: 11,+    });+    const alertsResponseForTest: AlertsResponse = {+      num_alerts: 2,+      alerts_breakdown: {+        [AlertType.INF_NAN_ALERT]: 2,+      },+      begin: 0,+      end: 2,+      alert_type: AlertType.INF_NAN_ALERT,+      per_type_alert_limit: 1000,+      alerts: [alert0, alert1],+    };+    const execDigest08 = createTestExecutionDigest();+    const execDigest09 = createTestExecutionDigest();+    const execDigest10 = createTestExecutionDigest();+    const execDigest11 = createTestExecutionDigest();++    beforeEach(() => {+      debuggerEffects.loadData$.subscribe();+    });++    it('fetches alerts and execution digest page if data is missing', () => {+      const fetchInfNanAlerts = createFetchAlertsSpy(+        runId,+        0,+        -1,+        alertsResponseForTest,+        AlertType.INF_NAN_ALERT+      );+      const numExecutions = 100;+      const fetchExecutionDigests = createFetchExecutionDigestsSpy(+        runId,+        8,+        12,+        {+          begin: 8,+          end: 12,+          num_digests: numExecutions,+          execution_digests: [+            execDigest08,+            execDigest09,+            execDigest10,+            execDigest11,+          ],+        }+      );+      store.overrideSelector(getActiveRunId, runId);+      store.overrideSelector(getAlertsFocusType, AlertType.INF_NAN_ALERT);+      store.overrideSelector(getNumAlertsOfFocusedType, 2);+      store.overrideSelector(getLoadedAlertsOfFocusedType, null);+      store.overrideSelector(getAlertsLoaded, {+        state: DataLoadState.NOT_LOADED,+        lastLoadedTimeInMs: null,+      });+      store.overrideSelector(getExecutionPageSize, 4);+      store.overrideSelector(getDisplayCount, 2);+      store.overrideSelector(getExecutionScrollBeginIndex, 0);+      store.overrideSelector(getNumExecutions, numExecutions);+      store.overrideSelector(getExecutionDigestsLoaded, {+        numExecutions,+        pageLoadedSizes: {},+        state: DataLoadState.NOT_LOADED,+        lastLoadedTimeInMs: null,+      });++      store.refreshState();++      action.next(+        alertTypeFocusToggled({+          alertType: AlertType.INF_NAN_ALERT,+        })+      );+      expect(fetchInfNanAlerts).toHaveBeenCalledTimes(1);+      expect(fetchExecutionDigests).toHaveBeenCalledTimes(1);+      expect(dispatchedActions).toEqual([+        numAlertsAndBreakdownRequested(),+        alertsOfTypeLoaded({+          numAlerts: 2,+          alertsBreakdown: {+            [AlertType.INF_NAN_ALERT]: 2,+          },+          begin: 0,+          end: 2,+          alertType: AlertType.INF_NAN_ALERT,+          alerts: [alert0, alert1],+        }),+        executionDigestsRequested(),+        executionDigestsLoaded({+          num_digests: numExecutions,+          begin: 8,+          end: 12,+          execution_digests: [+            execDigest08,+            execDigest09,+            execDigest10,+            execDigest11,+          ],+        }),+      ]);+    });++    it('does not fetch alerts when alerts are already loaded', () => {

focusType === null is covered in the it right below this one.

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export class DebuggerEffects {     );   } +  /**+   * Emits when user focuses on an alert type.+   *+   * Returns an Observable for what additional execution digests need to be fetched.+   */+  private onAlertTypeFocused(): Observable<{+    runId: string;+    begin: number;+    end: number;+  }> {+    return this.actions$.pipe(+      ofType(alertTypeFocusToggled),+      withLatestFrom(+        this.store.select(getActiveRunId),+        this.store.select(getAlertsFocusType),+        this.store.select(getNumAlertsOfFocusedType),+        this.store.select(getLoadedAlertsOfFocusedType),+        this.store.select(getAlertsLoaded)+      ),+      filter(+        ([+          ,+          runId,+          focusType,+          numAlertsOfFocusedType,+          loadedAlertsOfFocusedType,+          alertsLoaded,+        ]) => {+          return (+            runId !== null &&+            focusType !== null &&+            numAlertsOfFocusedType > 0 &&+            (loadedAlertsOfFocusedType === null ||+              Object.keys(loadedAlertsOfFocusedType).length <+                numAlertsOfFocusedType) &&+            alertsLoaded.state !== DataLoadState.LOADING+          );+        }+      ),+      tap(() => this.store.dispatch(numAlertsAndBreakdownRequested())),+      mergeMap(([, runId, focusType]) => {+        const begin = 0;+        // TODO(cais): Use smarter `end` value to reduce the amount of data+        // fetch each time.+        const end = -1;+        return this.dataSource+          .fetchAlerts(runId as string, begin, end, focusType! as string)+          .pipe(+            tap(+              ({+                num_alerts,+                alerts_breakdown,+                alert_type,+                begin,+                end,+                alerts,+              }) => {+                this.store.dispatch(+                  alertsOfTypeLoaded({+                    numAlerts: num_alerts,+                    alertsBreakdown: alerts_breakdown,+                    alertType: alert_type!,+                    begin,+                    end,+                    alerts,+                  })+                );+              }+            ),+            withLatestFrom(+              this.store.select(getExecutionPageSize),+              this.store.select(getDisplayCount),+              this.store.select(getNumExecutions),+              this.store.select(getExecutionDigestsLoaded)+            ),+            map(+              ([+                alertsResponse,+                pageSize,+                displayCount,+                numExecutions,+                executionDigestsLoaded,+              ]) => {+                const alert = alertsResponse.alerts[0] as InfNanAlert;+                const executionIndex = alert.execution_index;+                const missingPages = getMissingPages(+                  Math.max(0, executionIndex - Math.floor(displayCount / 2)),+                  Math.min(+                    executionIndex + Math.floor(displayCount / 2),+                    numExecutions+                  ),+                  pageSize,+                  numExecutions,+                  executionDigestsLoaded.pageLoadedSizes+                );+                const begin = missingPages[0] * pageSize;+                const end = Math.min(+                  executionDigestsLoaded.numExecutions,+                  (missingPages[missingPages.length - 1] + 1) * pageSize+                );+                return {runId: runId!, begin, end};+              }+            )+          );

Done the refactoring. Thanks for the suggestion.

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export class DebuggerEffects {     );   } +  /**+   * Emits when user focuses on an alert type.+   *+   * Returns an Observable for what additional execution digests need to be fetched.+   */+  private onAlertTypeFocused(): Observable<{+    runId: string;+    begin: number;+    end: number;+  }> {+    return this.actions$.pipe(+      ofType(alertTypeFocusToggled),+      withLatestFrom(+        this.store.select(getActiveRunId),+        this.store.select(getAlertsFocusType),+        this.store.select(getNumAlertsOfFocusedType),+        this.store.select(getLoadedAlertsOfFocusedType),+        this.store.select(getAlertsLoaded)+      ),+      filter(+        ([+          ,+          runId,+          focusType,+          numAlertsOfFocusedType,+          loadedAlertsOfFocusedType,+          alertsLoaded,+        ]) => {+          return (+            runId !== null &&+            focusType !== null &&+            numAlertsOfFocusedType > 0 &&+            (loadedAlertsOfFocusedType === null ||+              Object.keys(loadedAlertsOfFocusedType).length <+                numAlertsOfFocusedType) &&+            alertsLoaded.state !== DataLoadState.LOADING+          );+        }+      ),+      tap(() => this.store.dispatch(numAlertsAndBreakdownRequested())),+      mergeMap(([, runId, focusType]) => {+        const begin = 0;+        // TODO(cais): Use smarter `end` value to reduce the amount of data+        // fetch each time.+        const end = -1;+        return this.dataSource+          .fetchAlerts(runId as string, begin, end, focusType! as string)

Yes. Done.

caisq

comment created time in 5 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export class Tfdbg2HttpServerDataSource implements Tfdbg2DataSource {   }    fetchAlerts(run: string, begin: number, end: number, alert_type?: string) {+    const params: {[param: string]: string} = {

IMHO, begin and end are better kept as numbers, because that's what they are fundamentally. Changing them to string just to fit the requirement of HTTP Params is too specific. (Consider the possibility of a future data source implementation based on the same interface, backed by something other than HTTP.)

caisq

comment created time in 6 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export abstract class Tfdbg2DataSource {     stackFrameIds: string[]   ): Observable<StackFramesResponse>; +  /**+   * Fetch alerts.+   *+   * @param run Run name.+   * @param begin Beginning index, inclusive.+   * @param end Ending index, exclusive. Can use `begin=0` and `end=0`+   *   to retrieve only the number of alerts and their breakdown by type.+   *   Use `end=-1` to retrieve all alerts (ffor all alert types or only

Done.

caisq

comment created time in 6 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 export abstract class Tfdbg2DataSource {     stackFrameIds: string[]   ): Observable<StackFramesResponse>; +  /**+   * Fetch alerts.+   *+   * @param run Run name.

I think the current style is fine. The type definitions are missing in these doc strings, but they are available in the code below.

caisq

comment created time in 6 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 def Alerts(self, run, begin, end):             else:                 alert_type = "__MiscellaneousAlert__"             alerts_breakdown[alert_type] = len(monitor_alerts)-        end = self._checkBeginEndIndices(begin, end, len(alerts))-        # TODO(cais): Add support for filtering by alert type.-        return {+            alerts_by_type[alert_type] = monitor_alerts++        response_data = {             "begin": begin,-            "end": end,             "num_alerts": len(alerts),             "alerts_breakdown": alerts_breakdown,             "per_type_alert_limit": DEFAULT_PER_TYPE_ALERT_LIMIT,-            "alerts": [_alert_to_json(alert) for alert in alerts[begin:end]],         }+        if alert_type_filter is not None:+            if alert_type_filter not in alerts_breakdown:+                raise errors.InvalidArgumentError(+                    "Filtering of alerts failed: alert type %s does not exist"+                    % alert_type_filter+                )+            end = self._checkBeginEndIndices(+                begin, end, alerts_breakdown[alert_type_filter]+            )+            response_data["alert_type"] = alert_type+            response_data["alerts"] = [+                _alert_to_json(alert)+                for alert in alerts_by_type[alert_type_filter][begin:end]+            ]+        else:+            end = self._checkBeginEndIndices(begin, end, len(alerts))+            response_data["alerts"] = [+                _alert_to_json(alert) for alert in alerts[begin:end]+            ]+        response_data["end"] = end+        return response_data

The suggested change is incorporated into the separate Python-only PR (https://github.com/tensorflow/tensorboard/pull/3285). See also my comment below.

caisq

comment created time in 6 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 STACK_FRAMES_BLOB_TAG_PREFIX = "stack_frames"  -def alerts_run_tag_filter(run, begin, end):+def alerts_run_tag_filter(run, begin, end, alert_type=None):     """Create a RunTagFilter for Alerts.      Args:       run: tfdbg2 run name.       begin: Beginning index of alerts.       end: Ending index of alerts.+      alert_type: Optional alert type, used to restrict retrieval of alerts+        data to a single type of alerts.      Returns:       `RunTagFilter` for the run and range of Alerts.     """-    # TODO(cais): Add filter for alert type.-    return provider.RunTagFilter(-        runs=[run], tags=["%s_%d_%d" % (ALERTS_BLOB_TAG_PREFIX, begin, end)],-    )+    tag = "%s_%d_%d" % (ALERTS_BLOB_TAG_PREFIX, begin, end)+    if alert_type is not None:+        tag += "_%s" % alert_type+    return provider.RunTagFilter(runs=[run], tags=[tag])   def _parse_alerts_blob_key(blob_key):     """Parse the BLOB key for Alerts.      Args:       blob_key: The BLOB key to parse. By contract, it should have the format:-       `${ALERTS_BLOB_TAG_PREFIX}_${begin}_${end}.${run_id}`+       - `${ALERTS_BLOB_TAG_PREFIX}_${begin}_${end}.${run_id}` when there is no+         alert type filter.+      - `${ALERTS_BLOB_TAG_PREFIX}_${begin}_${end}_${alert_filter}.${run_id}`+        when there is an alert type filter.      Returns:       - run ID       - begin index       - end index+      - alert_type: alert type string used to filter retrieved alert data.+          `None` if no filtering is used.     """     # TODO(cais): Add filter for alert type.

Done.

caisq

comment created time in 6 hours

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

 STACK_FRAMES_BLOB_TAG_PREFIX = "stack_frames"  -def alerts_run_tag_filter(run, begin, end):+def alerts_run_tag_filter(run, begin, end, alert_type=None):     """Create a RunTagFilter for Alerts.      Args:       run: tfdbg2 run name.       begin: Beginning index of alerts.       end: Ending index of alerts.+      alert_type: Optional alert type, used to restrict retrieval of alerts+        data to a single type of alerts.      Returns:       `RunTagFilter` for the run and range of Alerts.     """-    # TODO(cais): Add filter for alert type.-    return provider.RunTagFilter(-        runs=[run], tags=["%s_%d_%d" % (ALERTS_BLOB_TAG_PREFIX, begin, end)],-    )+    tag = "%s_%d_%d" % (ALERTS_BLOB_TAG_PREFIX, begin, end)+    if alert_type is not None:+        tag += "_%s" % alert_type+    return provider.RunTagFilter(runs=[run], tags=[tag])   def _parse_alerts_blob_key(blob_key):     """Parse the BLOB key for Alerts.      Args:       blob_key: The BLOB key to parse. By contract, it should have the format:-       `${ALERTS_BLOB_TAG_PREFIX}_${begin}_${end}.${run_id}`+       - `${ALERTS_BLOB_TAG_PREFIX}_${begin}_${end}.${run_id}` when there is no

I've separated out the Python changes into a separate PR (https://github.com/tensorflow/tensorboard/pull/3285) and invited @wchargin to review it.

You can ignore the Python changes in this PR now. I'll merge #3285 before merging this one. But please don't let that block your review of the typescript/html code in this PR.

caisq

comment created time in 6 hours

push eventcaisq/tensorboard

Shanqing Cai

commit sha 6f3da9beed2493d7e2f72fb9b071c5204672a8ef

Python changes for addressing comments

view details

Shanqing Cai

commit sha c6d9d0700420cf3caa0e487e44c37c376f94dede

Address review comments

view details

push time in 4 hours

push eventcaisq/tensorboard

Shanqing Cai

commit sha 0eea5a9e35cc6649f2b17ab0cf77cb7a20f4aa3f

Remove obsolete TODO item

view details

push time in 6 hours

PR opened tensorflow/tensorboard

[DebuggerV2] Add support for alert-type filtering to /alerts route
  • Motivation for features / changes

    • Forms a basis for the already open https://github.com/tensorflow/tensorboard/pull/3269
    • Allow the DebuggerV2 frontend to query alerts that belong to a specific alert type.
  • Technical description of changes

    • Modify the multiplexer, data provider and serving method to support the "alert_type" parameter in requests.
    • Not that there is a slight change to requests to the same route without filters: previously there "alert_type" field was not populated; now it's populated with a None (null) value.
  • Detailed steps to verify changes work correctly (as executed by you)

    • Unit tests added.
+178 -16

0 comment

4 changed files

pr created time in 21 hours

create barnchcaisq/tensorboard

branch : dbg2-alert-fe-4-py

created branch time in 21 hours

push eventcaisq/tensorboard

William Chargin

commit sha 9bb99e6ab6aac88f4b92ede2f98276501fb09846

profile: remove Test PyPI index specification (#3275) Summary: The dynamic profile plugin is now available on stable PyPI: <https://pypi.org/project/tensorboard-plugin-profile/2.2.0a1/> Styling updated because the number of lines of text changed. Test Plan: The instructions still work in a new virtualenv, pulling in `2.2.0a1`. wchargin-branch: profile-stable-pypi

view details

William Chargin

commit sha 5b7f9ad3456270aecd49da8977b7201eab52c36d

data: expose downsampling preferences to plugins (#3271) Summary: We add a `sampling_hints` attribute to the `TBContext` magic container, which is populated with the parsed form of the `--samples_per_plugin` flag. Existing plugins’ generic data modes are updated to read from this map instead of using hard-coded thresholds. Test Plan: This change is not actually observable as is, because the multiplexer data provider ignores its downsampling argument. But after patching in a change to make the data provider respect the downsampling argument, this change has the effect that increasing the `--samples_per_plugin` over the default (e.g., `images=20`) now properly increases the number of samples shown in generic data mode, whereas previously it had no effect. wchargin-branch: data-downsampling-flag

view details

William Chargin

commit sha 4670696cfeba7c44df87c623fa9a5a4e620fe76f

data: perform downsampling in multiplexer provider (#3272) Summary: The `MultiplexerDataProvider` now respects its `downsample` parameter, even though the backing `PluginEventMultiplexer` already performs its own sampling. This serves two purposes: - It enforces that clients are always specifying the `downsample` argument, which is required. - It enables us to test plugins’ downsampling parameters to verify that they will behave correctly with other data providers. Test Plan: Unit tests included. Note that changing the `_DEFAULT_DOWNSAMPLING` constant in (e.g.) the scalars plugin to a small number (like `5`) now actually causes charts in the frontend to be downsampled. wchargin-branch: data-mux-downsample

view details

William Chargin

commit sha 6e85733e75d19cccad42ce9538011fb22c2aca21

profile: replace static plugin with dynamic plugin (#3258) Summary: A working version of the dynamic profile plugin is live on stable PyPI! It’s already a notable improvement over the static profile plugin, because it includes a web components polyfill so that the trace viewer actually works. Thus, we can now safely retire the legacy static plugin and the trace viewer component (only used by the profile plugin). Test Plan: Launch TensorBoard in a fresh virtualenv with only `tf-nightly`, pointing to a directory with profile data. Note that the “Profile” plugin shows installation instructions rather than the old static plugin. Copy and paste the installation instructions into a shell and relaunch TensorBoard. Note that the dynamic plugin dashboard is now available and active by default, and the installation instructions have disappeared. wchargin-branch: profile-dynamic-only

view details

Shanqing Cai

commit sha 90162c85a25dea738deec0cf186cabc1a45c2995

Add expermient name, description and time getters to environmentStore (#3274)

view details

Hannes Filler

commit sha 993f69c3d6a90854e4fd0be039d3f4e14e5de422

support meta labels shorter than the embedding (#3262) Support embeddings that are missing labels in the UI.

view details

bmd3k

commit sha 62745f781a5f3f996ee96a70c367ae417139e38e

Allow tensorboard title in header to be click target with configurable url (#3249) Allow tensorboard title in header to be clickable target with configurable href. Do basic sanitization on the input. Co-authored-by: Stephan Lee <stephanwlee@gmail.com>

view details

William Chargin

commit sha e62297ad060f11d852397f0eda19d4444a030224

build: add an `__init__`-only `tensorboard` library (#3276) Summary: This enables Bazel targets to depend on `tensorboard.notebook` without pulling in all of the summary writing infrastructure, by explicitly depending on both `:lib_init_only` and `:notebook`. This results in a very thin dependency graph: try ``` bazel query 'deps(//tensorboard:lib_init_only + //tensorboard:notebook)' ``` to see. Test Plan: A binary that depends on `:lib_init_only` and `:notebook` can import `tensorboard` and run `tensorboard.notebook.list()`, while trying to evaluate `tensorboard.summary.scalar` raises an `ImportError`. Googlers, see <http://cl/296370945>. wchargin-branch: lib-init-only

view details

William Chargin

commit sha 96b533fc53451c07c86df07689f7559502836eb2

ci: skip `yarn install` on Travis (#3278) Summary: This was previously needed to run `yarn lint`, but we run that on GitHub Actions now (in parallel with Travis!), so it’s entirely superfluous and takes about a minute to run. Test Plan: Ensure that Travis is still happy. wchargin-branch: ci-travis-no-yarn

view details

E

commit sha cc029e324b343c35d1fdef13eb4cf1b56f9016ff

Always pass experiment IDs to scalars_impl (#3280) Hparams and Custom Scalars use the Scalars plugin's implementation to generate data on the frontend. When --generic_data was enabled by default, the DataProvider started validating experiment IDs, so callers of scalars_impl who passed experiment `None` would break. This fixes https://github.com/tensorflow/tensorboard/issues/3279 by making Hparams, Custom Scalars pass the correct experiment ID.

view details

push time in 21 hours

issue commenttensorflow/tensorflow

tf.keras.losses.SparseCategoricalCrossentropy within the multi-GPU strategy.scope() generates NAN value

@YINWIZHANG In order to help us investigate this issue, can you provide the following extra bits of information:

  • Details of your resnet_fcn1
  • Details of your training dataset, train_ds.

If there can be actual code that forms a minimal reproduction case it'll be great.

YINWIZHANG

comment created time in 21 hours

push eventtensorflow/tfjs-models

Carlos Andrés Álvarez Restrepo

commit sha 5141d02b8eb07d9cc1b30ae4de01cebf751f466f

Fix typo speech-commands/README.md (#409)

view details

push time in a day

PR merged tensorflow/tfjs-models

Fix typo speech-commands/README.md cla: yes

Little typo error in README

<!-- Reviewable:start -->

This change is <img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/> <!-- Reviewable:end -->

+1 -1

0 comment

1 changed file

charlielito

pr closed time in a day

push eventtensorflow/tensorboard

Shanqing Cai

commit sha 90162c85a25dea738deec0cf186cabc1a45c2995

Add expermient name, description and time getters to environmentStore (#3274)

view details

push time in a day

PR merged tensorflow/tensorboard

Add experiment name, description and time getters to environmentStore cla: yes
  • Motivation for features / changes

    • Support experiment metadata (name, description, creation time) display in tensorboard.dev
  • Technical description of changes

    • This is a follow-up to https://github.com/tensorflow/tensorboard/pull/3254
    • Add three getter methods to environmentStore.
  • Detailed steps to verify changes work correctly (as executed by you)

    • Manual verify by running a frontend that talks to it (not included in this PR)
+12 -0

0 comment

1 changed file

caisq

pr closed time in a day

PR opened tensorflow/tensorboard

Add expermient name, description and time getters to environmentStore
  • Motivation for features / changes

    • Support experiment metadata (name, description, creation time) display in tensorboard.dev
  • Technical description of changes

    • Add three getter methods to environmentStore.
  • Detailed steps to verify changes work correctly (as executed by you)

    • Manual verify by running a frontend that talks to it (not included in this PR)
+12 -0

0 comment

1 changed file

pr created time in 2 days

create barnchcaisq/tensorboard

branch : envrionment-store

created branch time in 2 days

push eventcaisq/tensorboard

David Soergel

commit sha 9077c10dfef3a3dcf00853f436340bbc17e68b71

Refactor uploader to ease adding new data types (#3215)

view details

Stephan Lee

commit sha 7ea2af7ae0f1539dbc1041a2f73a1aeb74803b2c

Upgrade npm bazel dependency for ibazel (#3252) Also documented how to use ibazel with yarn.

view details

William Chargin

commit sha e3f0f05641a6a21a5c570e2ee0027e82990fa23c

scalars: promote generic data to stable (#3265) Summary: At this point, the generic data APIs are a fully featured replacement for the multiplexer APIs, including `is_active` support. We now enable them by default. They can still be disabled with `--generic_data false`. Test Plan: Patch the `MultiplexerDataProvider` to return hard-coded descriptions so that the generic and non-generic flows are distinguishable, then note that `tensorboard` uses the generic data APIs with `--generic_data` either set to `true` or unspecified, and not when set to `false`. wchargin-branch: data-stabilize-scalars

view details

David Soergel

commit sha 9e99328126fd5ae6808af0f395a12e42c16da0e2

Add trailing newline (#3267)

view details

William Chargin

commit sha 68d03827693b4ba86083b1933265d4300ccc11c1

text: add data provider support (#3266) Summary: This patch teaches the text plugin about the generic data APIs using text tensors. This has the implication that text tensors are required to be not too large in size, which should be fine: the complete works of Shakespeare fit in 5.5 MB, and text summaries should be expected to be far smaller than that. Test Plan: Change `TensorBoardWSGIApp` to set `multiplexer=None` on the context, and note that `--generic_data true` still has a working text plugin, while `--generic_data false` is completely broken, so everything is wired up through the new APIs. wchargin-branch: generic-text

view details

E

commit sha 8c6841bd0418b36ab55bf10e80ec45d22191fdf5

Disable io_wrapper glob test (#3270) Disables `testListRecursivelyViaGlobbingForPathWithGlobCharacters` due to a `tf.io.gfile.glob()` breakage in tf-nightly. This should be re-enabled when this issue is fixed: https://github.com/tensorflow/tensorboard/issues/3260

view details

push time in 2 days

pull request commenttensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline

cc @baileydesign

caisq

comment created time in 2 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha ef3557284d5f87d282112a096fc7cbe81659e730

Remove cruft

view details

push time in 2 days

PR opened tensorflow/tensorboard

[DebuggerV2] Add click callback to alert type; highlight alerts in timeline
  • Motivation for features / changes

    • Continue developing the Debugger V2 plugin
  • Technical description of changes

    • When an alert type (e.g., InfNanAlert) in the AlertComponent's breakdown list is clicked, fetch the detailed alert data.
    • Use the alert data and the execution index associated with each alert to highlight the alert-generating executions in the TimelineComponent
    • When alert data is loaded from the data source, scroll onto the execution digest that corresponds to the first alert in the TimelineComponent.
    • Updated the effects diagram in debugger_effects.ts.
  • Screenshot(s) of UI changes

    • image
  • Detailed steps to verify changes work correctly (as executed by you)

    • Unit tests added for the new selectors, reducers, effects and component/container rendering logic.
    • Manually verified the correct functioning of new functionalities by using actual tfdbg2-format debug data consistent of InfNanAlerts.
+1428 -104

0 comment

24 changed files

pr created time in 2 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 65563e31910c820f15ba8a005698ce7b17229c18

Scroll to execution corresponding to the first alert; unit tests

view details

push time in 2 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha fff237e26d33aa1dc6b7d0022ab7cb1bd5552456

Checkpoint for removing scrollIntoView

view details

Shanqing Cai

commit sha 6a27e93c34bae15a3d619310358aef3a87448ac2

Reimplement scroll into view.

view details

push time in 3 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 36638d736323a63216c8b15a30a15ddbbdd04528

Add new selector and unit tests for focused alert type being displayed

view details

Shanqing Cai

commit sha 22475d92e7bd8b463add6d8c1b87a27ad59d21c1

Add css higlighting to execution digests with InfNanAlert

view details

push time in 3 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha e5155836c71f57960e68c4635e043f767ac40c1d

Add alerts.executionIndexToAlertIndex and reducer / test

view details

push time in 3 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha a5deddf210b7767b43003ce5b229b188a059b624

Add tests for container: rendering and dispatching

view details

push time in 4 days

push eventcaisq/tensorboard

Nick Felt

commit sha a0ce0e70db0fbadf56bcf871347a8bf28d2daaf8

Update --reload_multifile_inactive_secs default to 24 hours (#3243)

view details

David Soergel

commit sha dc27e794c95eb223054073b7378f445307c685dc

Add the WriteBlob bidirectional streaming RPC to the write service. (#3226)

view details

E

commit sha bd108473af95ad0725f8582ccc22ee2b4803cb3e

Show warning if trace viewer is used with WebComponents v0 (#3248) Show warning if trace viewer is used with WebComponents v0. The message directs users to a workaround and more details at: https://github.com/tensorflow/tensorboard/issues/3209

view details

Shanqing Cai

commit sha 3bc9c20dd78481a7d8eec623d5149baa08cddaf4

Add experient_metadata to DataProvider (#3245) * Motivation for features / changes * Lay foundation for displaying experiment metadata (incl. timestamp for creation, name and description) in tensorboard.dev * Technical description of changes * Add method `experiment_metadata()` to `DataProvider` base class, with a default return value of `None`. * Add data class for experiment metadata: `ExperimentMetadata`.

view details

David Soergel

commit sha 6a465d433a683f88c227650cbb469d6301fb164a

Add wall_time field to GetOrCreateBlobSequenceRequest (#3253)

view details

Shanqing Cai

commit sha c2de1526c1adb3fee2347de65e9ee5a4074ab535

[CorePlugin] Add experiment metadata to /data/environment route response (#3254) * Motivation for features / changes * To support experiment metadata (e.g., name, description, time created) in tensorboard.dev, we need to make such metadata servable from the backend. * Technical description of changes * This PR implements part of this data pathway in CorePlugin. `CorePlugin._serve_environment()` now calls `DataProvider.experiment_metadata()` and populates its response with data fields in the object when they are present. * The TypeScript code in `environmentStore.ts` is revised accordingly. * Detailed steps to verify changes work correctly (as executed by you) * Unit tests added in core_plugin_test.py

view details

bmd3k

commit sha cf23d8d53f832ec011dac05138263598b164daf8

Fix typo for 'experiment_id'. (#3251)

view details

James Wexler

commit sha 949d93f70d931154307d079c4ab0ad5f5e1c7bff

Move What-If Tool to a dynamic plugin (#3242) Remove WIT code from TensorBoard and move it to a dynamic plugin.

view details

Nick Felt

commit sha 8accc400aeca3786200d7a4a1624706a3a0f5cdf

Remove now-unused @org_tensorflow_serving_api repo (#3257)

view details

Nick Felt

commit sha 03cc2d9d17b951a2aa3703275178a1a3bfbcc05e

Extract Experiment/ExperimentMask messages into experiment.proto (#3255) * copy export_service.proto to experiment.proto * Extract Experiment/ExperimentMask messages into experiment.proto

view details

Shanqing Cai

commit sha 7d0feb29412c4481ff128fe2851fbc408fd8bee9

Merge branch 'master' into dbg2-alert-fe-4

view details

push time in 4 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha c2de1526c1adb3fee2347de65e9ee5a4074ab535

[CorePlugin] Add experiment metadata to /data/environment route response (#3254) * Motivation for features / changes * To support experiment metadata (e.g., name, description, time created) in tensorboard.dev, we need to make such metadata servable from the backend. * Technical description of changes * This PR implements part of this data pathway in CorePlugin. `CorePlugin._serve_environment()` now calls `DataProvider.experiment_metadata()` and populates its response with data fields in the object when they are present. * The TypeScript code in `environmentStore.ts` is revised accordingly. * Detailed steps to verify changes work correctly (as executed by you) * Unit tests added in core_plugin_test.py

view details

bmd3k

commit sha cf23d8d53f832ec011dac05138263598b164daf8

Fix typo for 'experiment_id'. (#3251)

view details

James Wexler

commit sha 949d93f70d931154307d079c4ab0ad5f5e1c7bff

Move What-If Tool to a dynamic plugin (#3242) Remove WIT code from TensorBoard and move it to a dynamic plugin.

view details

Nick Felt

commit sha 8accc400aeca3786200d7a4a1624706a3a0f5cdf

Remove now-unused @org_tensorflow_serving_api repo (#3257)

view details

Nick Felt

commit sha 03cc2d9d17b951a2aa3703275178a1a3bfbcc05e

Extract Experiment/ExperimentMask messages into experiment.proto (#3255) * copy export_service.proto to experiment.proto * Extract Experiment/ExperimentMask messages into experiment.proto

view details

push time in 4 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 2783c0620135fa3e6aaaf0bdcb2ff018149f4e65

Add alert_filter support to /alerts route; Adjust reducer accordingly; Also add unit tests

view details

Shanqing Cai

commit sha 9191b231f43dd1d5c191b50b7d11c0d5334de530

Add action alertsOfTypeRequested, reducer and unit test

view details

Shanqing Cai

commit sha 38a2912dce3fa1a35c35cde6aed32b4975138e38

Add unit tests for some reducers and selectors

view details

push time in 4 days

push eventtensorflow/tensorboard

Shanqing Cai

commit sha c2de1526c1adb3fee2347de65e9ee5a4074ab535

[CorePlugin] Add experiment metadata to /data/environment route response (#3254) * Motivation for features / changes * To support experiment metadata (e.g., name, description, time created) in tensorboard.dev, we need to make such metadata servable from the backend. * Technical description of changes * This PR implements part of this data pathway in CorePlugin. `CorePlugin._serve_environment()` now calls `DataProvider.experiment_metadata()` and populates its response with data fields in the object when they are present. * The TypeScript code in `environmentStore.ts` is revised accordingly. * Detailed steps to verify changes work correctly (as executed by you) * Unit tests added in core_plugin_test.py

view details

push time in 7 days

PR merged tensorflow/tensorboard

[CorePlugin] Add experiment metadata to /data/environment route response cla: yes
  • Motivation for features / changes

    • To support experiment metadata (e.g., name, description, time created) in tensorboard.dev, we need to make such metadata servable from the backend.
  • Technical description of changes

    • This PR implements part of this data pathway in CorePlugin. CorePlugin._serve_environment() now calls DataProvider.experiment_metadata() and populates its response with data fields in the object when they are present.
    • The TypeScript code in environmentStore.ts is revised accordingly.
  • Detailed steps to verify changes work correctly (as executed by you)

    • Unit tests added in core_plugin_test.py
+115 -9

0 comment

3 changed files

caisq

pr closed time in 7 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 653afaefc0d2780ccd1a3d716f066288345e57c1

Remove unnecessary constructor args

view details

push time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 7d697120f24401c0ff2bb21a3a3a958327160507

Add some doc strings in environmentStore.ts

view details

push time in 8 days

PR opened tensorflow/tensorboard

[CorePlugin] Add experiment metadata to /data/environment route response
  • Motivation for features / changes

    • To support experiment metadata (e.g., name, description, time created) in tensorboard.dev, we need to make such metadata servable from the backend.
  • Technical description of changes

    • This PR implements part of this data pathway in CorePlugin. CorePlugin._serve_environment() now calls DataProvider.experiment_metadata() and populates its response with data fields in the object when they are present.
    • The TypeScript code in environmentStore.ts is revised accordingly.
  • Detailed steps to verify changes work correctly (as executed by you)

    • Unit tests added in core_plugin_test.py
+115 -9

0 comment

3 changed files

pr created time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 8f547171b22f62ccbf22d58d3aa61ed977920707

Improve environmentStore.ts

view details

push time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 40b195ce624ccacd804b608ae193f22c20af0877

Add unit tests for experiment metadata in /data/environment

view details

push time in 8 days

create barnchcaisq/tensorboard

branch : core-plugin-experiment-metadata

created branch time in 8 days

push eventcaisq/tensorboard

push time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha bb95485905caff3647a07330e0c895ffdaa6e907

[CorePlugin] Add experiment name, description and create time

view details

push time in 8 days

push eventcaisq/tensorboard

Nick Felt

commit sha a0ce0e70db0fbadf56bcf871347a8bf28d2daaf8

Update --reload_multifile_inactive_secs default to 24 hours (#3243)

view details

David Soergel

commit sha dc27e794c95eb223054073b7378f445307c685dc

Add the WriteBlob bidirectional streaming RPC to the write service. (#3226)

view details

E

commit sha bd108473af95ad0725f8582ccc22ee2b4803cb3e

Show warning if trace viewer is used with WebComponents v0 (#3248) Show warning if trace viewer is used with WebComponents v0. The message directs users to a workaround and more details at: https://github.com/tensorflow/tensorboard/issues/3209

view details

Shanqing Cai

commit sha 3bc9c20dd78481a7d8eec623d5149baa08cddaf4

Add experient_metadata to DataProvider (#3245) * Motivation for features / changes * Lay foundation for displaying experiment metadata (incl. timestamp for creation, name and description) in tensorboard.dev * Technical description of changes * Add method `experiment_metadata()` to `DataProvider` base class, with a default return value of `None`. * Add data class for experiment metadata: `ExperimentMetadata`.

view details

David Soergel

commit sha 6a465d433a683f88c227650cbb469d6301fb164a

Add wall_time field to GetOrCreateBlobSequenceRequest (#3253)

view details

push time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha fd67e7d259aa7d7975a975cef4e694041b646c81

Focus onto the first NaN/Inf event on loading

view details

push time in 8 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha be06e494dd3bb6409b095a81817af9070c965143

[DebuggerV2] Add focusing on alert type

view details

Shanqing Cai

commit sha 82c647d59a5a0e30c4018db9e81953256f839a20

Make request to backend to retrieve alerts data

view details

push time in 8 days

push eventtensorflow/tensorboard

Shanqing Cai

commit sha 3bc9c20dd78481a7d8eec623d5149baa08cddaf4

Add experient_metadata to DataProvider (#3245) * Motivation for features / changes * Lay foundation for displaying experiment metadata (incl. timestamp for creation, name and description) in tensorboard.dev * Technical description of changes * Add method `experiment_metadata()` to `DataProvider` base class, with a default return value of `None`. * Add data class for experiment metadata: `ExperimentMetadata`.

view details

push time in 8 days

PR merged tensorflow/tensorboard

Reviewers
Add experient_metadata to DataProvider cla: yes
  • Motivation for features / changes

    • Lay foundation for displaying experiment metadata (incl. timestamp for creation, name and description) in tensorboard.dev
  • Technical description of changes

    • Add method experiment_metadata() to DataProvider base class, with a default return value of None.
    • Add data class for experiment metadata: ExperimentMetadata.
+57 -0

1 comment

2 changed files

caisq

pr closed time in 8 days

IssuesEvent

issue commenttensorflow/tfjs

Unknown layer: KerasLayer

This bug shouldn't be closed. The new layer type hasn't been implemented yet.

aledalgrande

comment created time in 8 days

push eventcaisq/tfjs-models

Ping Yu

commit sha f85920f80d44e6bc7d6d85b4abc7bbe6216c335e

use tfhub model url for loading and updated the version (#404) * use tfhub model url for loading and updated the version * point vocab file to tfhub, update the package.json * check for fromTFHub flag of modelConfig param * add note for enable utf-8 for the page

view details

Ping Yu

commit sha f0db9fac56119a43268c35941e671641cb4cbed3

update the qna demo to latest version (#406)

view details

Shanqing Cai

commit sha 5cbb31a79aa0f62c56352c4cde80ef96ee82a20f

[speech-commands] Upgrade version and dependencies (#405) - Version: 0.4.1 --> 0.4.2 - Dependencies: tfjs and tfjs-node --> 1.5.2 TESTED: - Manually verified that demo works (inference and transfer learning)

view details

push time in 9 days

push eventtensorflow/tfjs-models

Shanqing Cai

commit sha 5cbb31a79aa0f62c56352c4cde80ef96ee82a20f

[speech-commands] Upgrade version and dependencies (#405) - Version: 0.4.1 --> 0.4.2 - Dependencies: tfjs and tfjs-node --> 1.5.2 TESTED: - Manually verified that demo works (inference and transfer learning)

view details

push time in 9 days

PR merged tensorflow/tfjs-models

[speech-commands] Upgrade version and dependencies cla: yes
  • Version: 0.4.1 --> 0.4.2
  • Dependencies: tfjs and tfjs-node --> 1.5.2

TESTED:

  • Manually verified that demo works (inference and transfer learning)

<!-- Reviewable:start -->

This change is <img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/> <!-- Reviewable:end -->

+66 -66

0 comment

5 changed files

caisq

pr closed time in 9 days

Pull request review commenttensorflow/tensorboard

Add experient_metadata to DataProvider

 def read_blob(self, blob_key):         pass  +class ExperimentMetadata(object):

Good question. The thinking is that

  1. Defining a data class like this spells out what the experiment metadata is expected to look like.
  2. It can potentially have methods like to_json() to support convenient conversion to a serializable format.
  3. Run is also a class in the same file. So this seems nice and consistent.
caisq

comment created time in 9 days

push eventcaisq/tfjs-models

Ping Yu

commit sha f85920f80d44e6bc7d6d85b4abc7bbe6216c335e

use tfhub model url for loading and updated the version (#404) * use tfhub model url for loading and updated the version * point vocab file to tfhub, update the package.json * check for fromTFHub flag of modelConfig param * add note for enable utf-8 for the page

view details

Ping Yu

commit sha f0db9fac56119a43268c35941e671641cb4cbed3

update the qna demo to latest version (#406)

view details

Shanqing Cai

commit sha 9267ac7b5d00f025cad7b8fcf6f44d6863ac61b2

Merge branch 'master' into sc-0.4.2

view details

push time in 9 days

PR closed tensorflow/tensorboard

[DebuggerV2] For test ; DO NOT SUBMIT; cla: yes
  • Motivation for features / changes

    • Continue developing Debugger V2
  • Technical description of changes

    • Add X interface
    • Add Y effect
  • Screenshots of UI changes * image

  • Detailed steps to verify changes work correctly (as executed by you)

    • Manually verified it
    • Also added unit tests
+59 -0

0 comment

3 changed files

caisq

pr closed time in 9 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] For test ; DO NOT SUBMIT;

 def data_location(self, experiment_id):         """         return "" +    def experiment_metadata(self, experiment_id):+        """Retrieve metadata of a given experiment.

Comment 1

caisq

comment created time in 9 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] For test ; DO NOT SUBMIT;

 def read_blob(self, blob_key):         pass  +class ExperimentMetadata(object):+    """Metadata about an experiment.++    Attributes:

Comment 2

caisq

comment created time in 9 days

PR opened tensorflow/tensorboard

[DebuggerV2] For test ; DO NOT SUBMIT;
  • Motivation for features / changes

    • Continue developing Debugger V2
  • Technical description of changes

    • Add X interface
    • Add Y effect
  • Screenshots of UI changes * image

  • Detailed steps to verify changes work correctly (as executed by you)

    • Manually verified it
    • Also added unit tests
+59 -0

0 comment

3 changed files

pr created time in 9 days

create barnchcaisq/tensorboard

branch : dbg2-alert-fe-4

created branch time in 9 days

push eventcaisq/tfjs-models

Shanqing Cai

commit sha d0126d862b68207054adfac087434d5028ba70dd

Remove cruft

view details

push time in 9 days

pull request commenttensorflow/tensorboard

Add experient_metadata to DataProvider

cc @bileschi

caisq

comment created time in 9 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 2457b3413f06b95857c3bab814ebee0bd5775a4a

Fix typo

view details

push time in 9 days

PR opened tensorflow/tensorboard

Add experient_metadata to DataProvider
  • Motivation for features / changes

    • Lay foundation for displaying experiment metadata (incl. timestamp for creation, name and description) in tensorboard.dev
  • Technical description of changes

    • Add method experiment_metadata() to DataProvider base class, with a default return value of None.
    • Add data class for experiment metadata: ExperimentMetadata.
+57 -0

0 comment

2 changed files

pr created time in 9 days

create barnchcaisq/tensorboard

branch : expeiment-metadata

created branch time in 9 days

push eventcaisq/tensorboard

Stanley Bileschi

commit sha 79b4a57a35e65f826315df21e1ee6dc292241cc6

Proto changes to support experiment name & description. (#3234) Proto changes to support experiment name & description.

view details

Shanqing Cai

commit sha 960273ee8fc5d4c660beac7ec0882216424ed8f9

[DebuggerV2] Start fleshing out alerts component (#3235) * Motivation for features / changes * Continue developing DebuggerV2 plugin * Technical description of changes * In the Python backend code, add alerts_breakdown, which is a breakdown of all alerts by their types. * Add an effect in debugger_effects.ts: On non-empty debugger runs, fetch number of alerts and their breakdown * Add display logic to AlertsComponent to visualize the alerts. * Follow-up PRs will add actions and effects for when the alert categories are clicked. * Screenshots of UI changes * When alerts are present: * ![image](https://user-images.githubusercontent.com/16824702/74278222-e10aec80-4ce6-11ea-8ad7-92437250eeb1.png) * When there are no alerts: * ![image](https://user-images.githubusercontent.com/16824702/74278487-48c13780-4ce7-11ea-965c-92f4503e4174.png) * Detailed steps to verify changes work correctly (as executed by you) * Manual testing on a tfdbg2 dataset with nan and inf * Unit tests added.

view details

ericdnielsen

commit sha 9db185d058de97fa8b1f3ba151ad7c762d877540

Update export/write services for eventual tensor storage (#3236) * Update export/write services to add needed fields & calls for eventual tensor storage

view details

push time in 9 days

PR opened tensorflow/tfjs-models

[speech-commands] Upgrade version and dependencies
  • Version: 0.4.1 --> 0.4.2
  • Dependencies: tfjs and tfjs-node --> 1.5.2

TESTED:

  • Manually verified that demo works (inference and transfer learning)
+67 -66

0 comment

6 changed files

pr created time in 9 days

create barnchcaisq/tfjs-models

branch : sc-0.4.2

created branch time in 9 days

push eventcaisq/tfjs-models

Shanqing Cai

commit sha c459c5e8bd7e34da26fc2fb159d8da8f71458d7d

[speech-commands] Upgrade version and dependencies - Version: 0.4.1 --> 0.4.2 - Dependencies: tfjs and tfjs-node --> 1.5.2

view details

push time in 9 days

push eventcaisq/tfjs-models

tylerzhu-github

commit sha 7c5413c9d326dc3077afba7bee969d882f1657b2

Returns all poses in segmentPerson() and segmentPersonParts(). (#347) Update segmentPerson() and segmentPersonParts() methods to return poses of all people in the image.

view details

phc

commit sha fc26f6e0ca517824e109046f749f83aee8eb461c

Fix datasets urls in deeplab README (#349)

view details

tylerzhu-github

commit sha 5473da02ae7c8ca9c8df94a56e8195f92dc765c1

Update package.json bodypix version to 2.0.0 for release (#350)

view details

tylerzhu-github

commit sha bc65a4b5980d00a3acaba6fdf621be91953cba9f

marks flipHorizontal, internalResolution, segmentationThreshold optional (#351) * marks flipHorizontal, internalResolution, segmentationThreshold optional * fixes test * address comments * fixes long line error * breaks line using +

view details

tylerzhu-github

commit sha cddab31c50152208f84a69ae6aefa6127b32b015

update BodyPix version to 2.0.1 (#352)

view details

tylerzhu-github

commit sha bffbe3765609115408dcd7ffe2aede065b427bd3

Bodypix resnet update switch to readme v2 (#354) * Update README to use README-v2 * update bodypix version to 2.0.2 * adds a sentence refering to the README of BodyPix 1.0.0

view details

tylerzhu-github

commit sha daeef825c0cc260db215502b78205842d309bb27

fixes format (#355)

view details

tylerzhu-github

commit sha 015ccaf2506a7e09ea23dc3b051552eb72e558c0

Updates demo to use the latest bodypix 2.0.2 (#356) * Updates demo to use latest bodypix 2.0.2 * run yarn to update the yarn.lock file

view details

Dan Oved

commit sha 4aa4e1716954c2f1e03283992f343bea22658e9e

[BodyPix] - increase max internal resolution to 2 (#357) * BodyPix - increase max internal resolution to 4, so that inference can be run to emulate a lower output stride and get higher accuracy. * BodyPix version bump * Chnaging to max resolutino of 2 * Revert "BodyPix version bump" This reverts commit f5bc8d36f468be55eb0ac6bad2b0a8e2030631ae. * Set min resolution to 0.1, and added a const for it

view details

tylerzhu-github

commit sha 998bc9a190056d5e3cc62679e8fbe584fe5ee9a6

updates the description on the demo page (#359) DOC

view details

Dan Oved

commit sha 73742720a49fe45d7ff17d3e228dd0a1e5c817dc

BodyPix - fix inference in node. (#358) * BodyPix - fix inference in node. Checking if browser before checking for browser based types * Changing checking of environment to happen from a function * Remove pngjs (it was accidentally committed). * Not checking if browser, but just checking if types defined as per feedback * Lint fixes

view details

tylerzhu-github

commit sha 56fce428fca474d40cd214a2649c6a6360232b61

Releases a BodyPix version that supports Node.js (#360) * updates the description on the demo page * release a version that supports Node.js

view details

Ping Yu

commit sha f389a5555ca3ba93393de4a894ecf92a74f19d34

Update README.md (#361)

view details

Dan Oved

commit sha 34814fa85231551d2abe4c6a89a7aef40c79cef6

BodyPix - fix internal resolution message (#365)

view details

Nikhil Thorat

commit sha e80d693bb43cb0ef234b808021c4def434ea816a

Add publish-npm, make-version, tag-version scripts to models. (#369) Also adds versions and unit tests to each model. We're also bumping the patch version for each of these so I can publish a new version, tag them, and then have them sync back to google.

view details

Nikhil Thorat

commit sha 047108558eb1ec046d75ff979a21b9a46b1bdffe

Remove for-publish in build-npm (#370)

view details

Nikhil Thorat

commit sha 4106c7f98892894867f8d5e779020eceb48a0c2b

Update lock files. (#371)

view details

Ann Yuan

commit sha 1fb1f9464739c4a1e819f41928cec3f3eac0ce43

Actually use TFHub for USE and toxicity models. (#381)

view details

Ann Yuan

commit sha 3f0503289d44d01ad6b5f57e7f5d420aca2977fd

Add blazeface model. (#364)

view details

dependabot[bot]

commit sha d0d5fb1cadda3f63cb6effdaa58cf2f50605fb82

Bump serialize-to-js from 3.0.0 to 3.0.2 in /body-pix/demos (#382) Bumps [serialize-to-js](https://github.com/commenthol/serialize-to-js) from 3.0.0 to 3.0.2. - [Release notes](https://github.com/commenthol/serialize-to-js/releases) - [Commits](https://github.com/commenthol/serialize-to-js/compare/v3.0.0...v3.0.2) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 9 days

push eventtensorflow/tensorboard

Shanqing Cai

commit sha 960273ee8fc5d4c660beac7ec0882216424ed8f9

[DebuggerV2] Start fleshing out alerts component (#3235) * Motivation for features / changes * Continue developing DebuggerV2 plugin * Technical description of changes * In the Python backend code, add alerts_breakdown, which is a breakdown of all alerts by their types. * Add an effect in debugger_effects.ts: On non-empty debugger runs, fetch number of alerts and their breakdown * Add display logic to AlertsComponent to visualize the alerts. * Follow-up PRs will add actions and effects for when the alert categories are clicked. * Screenshots of UI changes * When alerts are present: * ![image](https://user-images.githubusercontent.com/16824702/74278222-e10aec80-4ce6-11ea-8ad7-92437250eeb1.png) * When there are no alerts: * ![image](https://user-images.githubusercontent.com/16824702/74278487-48c13780-4ce7-11ea-965c-92f4503e4174.png) * Detailed steps to verify changes work correctly (as executed by you) * Manual testing on a tfdbg2 dataset with nan and inf * Unit tests added.

view details

push time in 10 days

PR merged tensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component cla: yes
  • Motivation for features / changes

    • Continue developing DebuggerV2 plugin
  • Technical description of changes

    • In the Python backend code, add alerts_breakdown, which is a breakdown of all alerts by their types.
    • Add an effect in debugger_effects.ts: On non-empty debugger runs, fetch number of alerts and their breakdown
    • Add display logic to AlertsComponent to visualize the alerts.
    • Follow-up PRs will add actions and effects for when the alert categories are clicked.
  • Screenshots of UI changes

    • When alerts are present: * image
    • When there are no alerts: * image
  • Detailed steps to verify changes work correctly (as executed by you)

    • Manual testing on a tfdbg2 dataset with nan and inf
    • Unit tests added.
+781 -39

1 comment

21 changed files

caisq

pr closed time in 10 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

 export interface Execution extends ExecutionDigest {   debug_tensor_values: Array<number[] | null> | null; } +export enum AlertType {+  FunctionRecompileAlert = 'FunctionRecompilesAlert',

Done.

caisq

comment created time in 10 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha f389cce68fa89f16dd3b70dae1b79e1303a658ba

Make enum keys UPPER_SNAKE_CASE

view details

push time in 10 days

push eventcaisq/tensorboard

Shanqing Cai

commit sha 96a2a2ebfd4cbf6cddd0a6045ea6f1c7c28b9a65

Address comments

view details

push time in 10 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

+/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.++Licensed under the Apache License, Version 2.0 (the "License");+you may not use this file except in compliance with the License.+You may obtain a copy of the License at++    http://www.apache.org/licenses/LICENSE-2.0++Unless required by applicable law or agreed to in writing, software+distributed under the License is distributed on an "AS IS" BASIS,+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+See the License for the specific language governing permissions and+limitations under the License.+==============================================================================*/+/**+ * Unit tests for the the Alerts component and container.+ */+import {CommonModule} from '@angular/common';+import {TestBed} from '@angular/core/testing';+import {By} from '@angular/platform-browser';++import {Store} from '@ngrx/store';+import {provideMockStore, MockStore} from '@ngrx/store/testing';++import {DebuggerComponent} from '../../debugger_component';+import {DebuggerContainer} from '../../debugger_container';+import {State} from '../../store/debugger_types';+import {+  createAlertsState,+  createDebuggerState,+  createState,+} from '../../testing';+import {AlertsContainer} from './alerts_container';+import {AlertsModule} from './alerts_module';+import {ExecutionDataModule} from '../execution_data/execution_data_module';+import {InactiveModule} from '../inactive/inactive_module';+import {StackTraceModule} from '../stack_trace/stack_trace_module';+import {TimelineModule} from '../timeline/timeline_module';++/** @typehack */ import * as _typeHackStore from '@ngrx/store';++describe('Alerts Container', () => {+  let store: MockStore<State>;++  beforeEach(async () => {+    await TestBed.configureTestingModule({+      declarations: [DebuggerComponent, DebuggerContainer],+      imports: [+        AlertsModule,+        CommonModule,+        ExecutionDataModule,+        InactiveModule,+        StackTraceModule,+        TimelineModule,+      ],+      providers: [+        provideMockStore({+          initialState: createState(createDebuggerState()),+        }),+        DebuggerContainer,+      ],+    }).compileComponents();+    store = TestBed.get(Store);+  });++  it('renders number of alerts and breakdown: no alerts', () => {+    const fixture = TestBed.createComponent(AlertsContainer);+    store.setState(+      createState(+        createDebuggerState({+          activeRunId: '__default_debugger_runs__',+          alerts: createAlertsState(),+        })+      )+    );+    fixture.detectChanges();++    const numAlertsValueElement = fixture.debugElement.query(+      By.css('.num-alerts-value')+    );+    expect(numAlertsValueElement.nativeElement.innerText).toBe('0');+    const alertTypeNameElements = fixture.debugElement.queryAll(+      By.css('.alert-type-name')+    );+    expect(alertTypeNameElements.length).toBe(0);+  });++  it('renders number of alerts and breakdown: one alert type', () => {+    const fixture = TestBed.createComponent(AlertsContainer);+    store.setState(+      createState(+        createDebuggerState({+          activeRunId: '__default_debugger_runs__',+          alerts: createAlertsState({+            numAlerts: 10,+            alertsBreakdown: {+              InfNanAlert: 10,+            },+          }),+        })+      )+    );+    fixture.detectChanges();++    const numAlertsValueElement = fixture.debugElement.query(+      By.css('.num-alerts-value')+    );+    expect(numAlertsValueElement.nativeElement.innerText).toBe('10');+    const alertTypeNameElements = fixture.debugElement.queryAll(+      By.css('.alert-type-name')+    );+    const alertTypeCountElements = fixture.debugElement.queryAll(+      By.css('.alert-type-count')+    );+    expect(alertTypeNameElements.length).toBe(1);+    expect(alertTypeNameElements[0].nativeElement.innerText).toBe('NaN/∞');+    expect(alertTypeCountElements.length).toBe(1);+    expect(alertTypeCountElements[0].nativeElement.innerText).toBe('∞: 10');+  });++  it('renders number of alerts and breakdown: three alert types', () => {+    const fixture = TestBed.createComponent(AlertsContainer);+    store.setState(+      createState(+        createDebuggerState({+          activeRunId: '__default_debugger_runs__',+          alerts: createAlertsState({+            numAlerts: 11,+            alertsBreakdown: {+              FunctionRecompilesAlert: 5,

Yeah. I see your point. The difficulty here is that the keys of an object must be a string or number. I added a TODO item for myself to explore tighter typing.

caisq

comment created time in 10 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/-import {Component, OnInit} from '@angular/core';-import {Store} from '@ngrx/store';+import {ChangeDetectionStrategy, Component} from '@angular/core';+import {createSelector, select, Store} from '@ngrx/store'; -import {alertsViewLoaded} from '../../actions';+import {getAlertsBreakdown, getNumAlerts, State} from '../../store';  /** @typehack */ import * as _typeHackRxjs from 'rxjs'; -// TODO(cais): Move to a separate file.-export interface AlertsState {}+const ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL: {+  [alertType: string]: {displayName: string; displaySymbol: string};+} = {+  FunctionRecompilesAlert: {+    displayName: 'Function recompiles',+    displaySymbol: 'C',+  },+  InfNanAlert: {

Good point. Done. As a part of the fix, I also changed AlertType to an enum.

caisq

comment created time in 10 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

 limitations under the License. --> -<div>-  <div>Debugging</div>-  <div>-    <span>Alerts</span>+<div class="alerts-container">+  <div class="debugging-title">Debugging</div>+  <div class="num-alerts-container">+    <div class="num-alerts-label">Alerts</div>+    <div class="num-alerts-value" [ngClass]="[numAlerts > 0 ? 'non-zero' : '']">+      {{ numAlerts }}+    </div>+  </div>+  <div class="alerts-breakdown-container">+    <div *ngFor="let breakdown of alertsBreakdown;">

Ack. Point taken. But this is not so complicated as to necessitate that yet.

caisq

comment created time in 10 days

Pull request review commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

 See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -/* TODO(cais): Flesh out the styling. */+.alerts-breakdown-container {+  font-size: 13px;+  padding: 10px 10px 10px 50px;+  position: relative;+}++.alerts-container {+  font-family: 'Roboto', Arial, Helvetica, sans-serif;+  vertical-align: middle;+}++.alert-type-count {+  /* TODO(cais): Use colors specific to alert type. */+  background-color: #e52592;+  border-radius: 3px;+  color: #fff;+  display: inline-block;+  padding: 3px;+  position: absolute;+  right: 20px;+}++.alert-type-name {+  display: inline-block;+}++.debugging-title {+  font-size: 18px;+}++.num-alerts-container {+  font-weight: bold;+  padding: 10px 10px 10px 30px;+  position: relative;+}++.num-alerts-label {+  display: inline-block;+  font-size: 13px;+}++.num-alerts-value {+  border-radius: 12px;+  display: inline-block;+  font-size: 13px;+  font-weight: normal;+  line-height: 24px;+  position: absolute;+  right: 20px;+  text-align: center;+  vertical-align: middle;+  width: 24px;+  -moz-border-radius: 12px;

OK. You're right (https://caniuse.com/#feat=border-radius). I removed -moz-border-radius and -webkit-border-radius here.

caisq

comment created time in 10 days

pull request commenttensorflow/tensorboard

[DebuggerV2] Start fleshing out alerts component

cc @baileydesign

caisq

comment created time in 11 days

more