pub struct HloInstructionProto {Show 58 fields
pub name: String,
pub opcode: String,
pub shape: Option<ShapeProto>,
pub metadata: Option<OpMetadata>,
pub literal: Option<LiteralProto>,
pub parameter_number: i64,
pub fusion_kind: String,
pub tuple_index: i64,
pub dimensions: Vec<i64>,
pub window: Option<Window>,
pub convolution_dimension_numbers: Option<ConvolutionDimensionNumbers>,
pub feature_group_count: i64,
pub batch_group_count: i64,
pub slice_dimensions: Vec<SliceDimensions>,
pub exponent_bits: i32,
pub mantissa_bits: i32,
pub dynamic_slice_sizes: Vec<i64>,
pub padding_config: Option<PaddingConfig>,
pub outfeed_config: Vec<u8>,
pub distribution: i32,
pub epsilon: f32,
pub feature_index: i64,
pub channel_id: i64,
pub infeed_config: Vec<u8>,
pub custom_call_target: String,
pub outfeed_shape: Option<ShapeProto>,
pub dot_dimension_numbers: Option<DotDimensionNumbers>,
pub fft_type: i32,
pub fft_length: Vec<i64>,
pub comparison_direction: String,
pub gather_dimension_numbers: Option<GatherDimensionNumbers>,
pub gather_slice_sizes: Vec<i64>,
pub channel_name: String,
pub cost_estimate_ns: i64,
pub id: i64,
pub operand_ids: Vec<i64>,
pub control_predecessor_ids: Vec<i64>,
pub called_computation_ids: Vec<i64>,
pub sharding: Option<OpSharding>,
pub backend_config: String,
pub replica_groups: Vec<ReplicaGroup>,
pub all_reduce_id: i64,
pub is_host_transfer: bool,
pub is_stable: bool,
pub scatter_dimension_numbers: Option<ScatterDimensionNumbers>,
pub precision_config: Option<PrecisionConfig>,
pub source_target_pairs: Vec<SourceTarget>,
pub domain_entry_sharding: Option<OpSharding>,
pub domain_exit_sharding: Option<OpSharding>,
pub constrain_layout: bool,
pub operand_shapes_with_layout: Vec<ShapeProto>,
pub triangular_solve_options: Option<TriangularSolveOptions>,
pub cholesky_options: Option<CholeskyOptions>,
pub parameter_replication: Option<ParameterReplication>,
pub outer_dimension_partitions: Vec<i64>,
pub custom_call_has_side_effect: bool,
pub delta: i64,
pub indices_are_sorted: bool,
}Expand description
Serialization of HloInstruction. Next ID: 68
Fields§
§name: String§opcode: String§shape: Option<ShapeProto>§metadata: Option<OpMetadata>§literal: Option<LiteralProto>Literal, only present for kConstant.
parameter_number: i64Parameter number is only present for kParameter.
fusion_kind: StringFusion state, only present for kFusion.
tuple_index: i64Index for kGetTupleElement.
dimensions: Vec<i64>Dimensions present for some operations that require reshaping or broadcasting, including Reshape, Reduce, ReduceWindow, and Reverse.
window: Option<Window>Describes the window in a windowed operation such as convolution.
convolution_dimension_numbers: Option<ConvolutionDimensionNumbers>Describes the dimension numbers used for a convolution.
feature_group_count: i64The number of feature groups. Used for a convolution. Must be a divisor of the input feature dimension and output feature dimension. If not specified, it will use a default value of 1.
batch_group_count: i64§slice_dimensions: Vec<SliceDimensions>§exponent_bits: i32The bit sizes for a reduce-precision operation.
mantissa_bits: i32§dynamic_slice_sizes: Vec<i64>Describes the [start, start + size) range size for a dynamic slice (‘start’ is specified dynamically in the second operand of the operation).
padding_config: Option<PaddingConfig>The padding configuration that describes the edge padding and interior padding of this pad instruction. Only set for pad instructions.
outfeed_config: Vec<u8>Outfeed configuration information, only present for kOutfeed.
distribution: i32The distribution requested for random number generation. Only present for kRng.
epsilon: f32A small float number added to the variance to avoid divide-by-zero error. Only present for kBatchNormTraining.
feature_index: i64An integer value representing the index of the feature dimension. Only present for kBatchNormTraining.
channel_id: i64Represents a unique identifier for each Send/Recv instruction pair or optionally for collective instructions (AllReduce, CollectivePermute, AllToAll). Non-positive channel_id is equivalent to no channel id.
infeed_config: Vec<u8>The string representation of the infeed configuration.
custom_call_target: StringName of a external target (eg, global symbol) to call, only present for kCustomCall.
outfeed_shape: Option<ShapeProto>Shape of outfeed request.
dot_dimension_numbers: Option<DotDimensionNumbers>Describes the dimension numbers used for a dot operation
fft_type: i32FFT type (FFT, IFFT, etc).
fft_length: Vec<i64>FFT length.
comparison_direction: StringComparison direction only used for kCompare.
gather_dimension_numbers: Option<GatherDimensionNumbers>Gather dimension numbers.
gather_slice_sizes: Vec<i64>§channel_name: StringCompute Host.
cost_estimate_ns: i64§id: i64The id of this instruction.
operand_ids: Vec<i64>§control_predecessor_ids: Vec<i64>§called_computation_ids: Vec<i64>§sharding: Option<OpSharding>§backend_config: StringBackend configuration for the instruction. Has backend-specific meaning.
replica_groups: Vec<ReplicaGroup>Cross replica op fields.
all_reduce_id: i64Deprecated, but keeping it for backward compatibility. Use channel_id. Non-positive all_reduce_id is equivalent to no all_reduce_id.
is_host_transfer: boolWhether this Send/Recv instruction transfers data to/from the host. Only present for Send and Recv instructions and their SendDone and RecvDone partners.
is_stable: boolWhether this Sort instruction should be stable.
scatter_dimension_numbers: Option<ScatterDimensionNumbers>§precision_config: Option<PrecisionConfig>Precision configuration for the instruction. Has backend-specific meaning.
source_target_pairs: Vec<SourceTarget>Collective permute field.
domain_entry_sharding: Option<OpSharding>Sharding for kDomain instructions.
domain_exit_sharding: Option<OpSharding>§constrain_layout: boolFor custom call this indicates that the layouts are constrained. If constrain_layout is true then the ‘shape’ field must contain a layout, and ‘operand_shapes_with_layout’ must contain a shape with layout for each operand.
operand_shapes_with_layout: Vec<ShapeProto>§triangular_solve_options: Option<TriangularSolveOptions>Options for TriangularSolve
cholesky_options: Option<CholeskyOptions>Options for Cholesky
parameter_replication: Option<ParameterReplication>Describes how parameters behave with regards to replicas.
outer_dimension_partitions: Vec<i64>If set, the given instruction is run in parallel on e.g. multiple CPU cores. The outermost dimension gets split up into outer_dimension_partitions[0] pieces, the next-outermost dim gets split into outer_dimension_partitions[1] pieces, etc.
It’s illegal to partition a dimension into more shards than there are elements in that dimension.
custom_call_has_side_effect: boolWhether the kCustomCall instruction has side-effects, only present for kCustomCall.
delta: i64The delta value for kRngGetAndUpdateState.
indices_are_sorted: boolSpecifies if the gather/scatter indices are guaranteed to be sorted by the caller.
Implementations§
Source§impl HloInstructionProto
impl HloInstructionProto
Sourcepub fn distribution(&self) -> RandomDistribution
pub fn distribution(&self) -> RandomDistribution
Returns the enum value of distribution, or the default if the field is set to an invalid enum value.
Sourcepub fn set_distribution(&mut self, value: RandomDistribution)
pub fn set_distribution(&mut self, value: RandomDistribution)
Sets distribution to the provided enum value.
Sourcepub fn fft_type(&self) -> FftType
pub fn fft_type(&self) -> FftType
Returns the enum value of fft_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_fft_type(&mut self, value: FftType)
pub fn set_fft_type(&mut self, value: FftType)
Sets fft_type to the provided enum value.
Trait Implementations§
Source§impl Clone for HloInstructionProto
impl Clone for HloInstructionProto
Source§fn clone(&self) -> HloInstructionProto
fn clone(&self) -> HloInstructionProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HloInstructionProto
impl Debug for HloInstructionProto
Source§impl Default for HloInstructionProto
impl Default for HloInstructionProto
Source§impl Message for HloInstructionProto
impl Message for HloInstructionProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.