// This file must be kept in sync with the corresponding proto file.

import {SourceInfo} from 'org_xprof/frontend/app/common/interfaces/source_info.jsonpb_decls';

/** See corresponding proto */
export interface HeapObject {
  numbered?: /* int32 */ number;
  named?: string;
  label?: string;
  logicalBufferId?: /* int32 */ number;
  logicalBufferSizeMib?: /* double */ number;
  unpaddedShapeMib?: /* double */ number;
  instructionName?: string;
  shapeString?: string;
  tfOpName?: string;
  groupName?: string;
  opCode?: string;
  sourceInfo?: SourceInfo;
}

/** See corresponding proto */
export interface BufferSpan {
  start?: /* int32 */ number;
  limit?: /* int32 */ number;
}

/** See corresponding proto */
export interface LogicalBuffer {
  id?: /* int64 */ string;
  shape?: string;
  sizeMib?: /* double */ number;
  hloName?: string;
  shapeIndex?: /* int64 */ string[];
}

/** See corresponding proto */
export interface BufferAllocation {
  id?: /* int64 */ string;
  sizeMib?: /* double */ number;
  attributes?: string[];
  logicalBuffers?: LogicalBuffer[];
  commonShape?: string;
}

/** See corresponding proto */
export interface PreprocessResult {
  heapSizes?: /* double */ number[];
  unpaddedHeapSizes?: /* double */ number[];
  hloInstructionNames?: string[];
  maxHeap?: HeapObject[];
  maxHeapBySize?: HeapObject[];
  logicalBufferSpans?: {[key: /* int32 */ string]: BufferSpan};
  maxHeapToBySize?: /* int32 */ number[];
  bySizeToMaxHeap?: /* int32 */ number[];
  moduleName?: string;
  entryComputationName?: string;
  peakHeapMib?: /* double */ number;
  peakUnpaddedHeapMib?: /* double */ number;
  peakHeapSizePosition?: /* int32 */ number;
  entryComputationParametersMib?: /* double */ number;
  nonReusableMib?: /* double */ number;
  maybeLiveOutMib?: /* double */ number;
  totalBufferAllocationMib?: /* double */ number;
  indefiniteBufferAllocationMib?: /* double */ number;
  indefiniteLifetimes?: BufferAllocation[];
  allocationTimeline?: string;
  maxScopedVmemAllocationMib?: /* double */ number;
  maxScopedVmemInstructionName?: string;
  bufferBlocks?: BufferBlockProto[];
}

/** See corresponding proto */
export interface BufferBlockProto {
  logicalBufferId?: /* int32 */ number;
  name?: string;
  offset?: /* double */ number;
  size?: /* double */ number;
  startStep?: /* int32 */ number;
  endStep?: /* int32 */ number;
  tfOpName?: string;
  category?: string;
  sourceInfo?: SourceInfo;
  shapeString?: string;
  unpaddedSize?: /* double */ number;
  color?: string;
}
