HloInstructionProto

Struct HloInstructionProto 

Source
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: i64

Parameter number is only present for kParameter.

§fusion_kind: String

Fusion state, only present for kFusion.

§tuple_index: i64

Index 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: i64

The 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: i32

The 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: i32

The distribution requested for random number generation. Only present for kRng.

§epsilon: f32

A small float number added to the variance to avoid divide-by-zero error. Only present for kBatchNormTraining.

§feature_index: i64

An integer value representing the index of the feature dimension. Only present for kBatchNormTraining.

§channel_id: i64

Represents 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: String

Name 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: i32

FFT type (FFT, IFFT, etc).

§fft_length: Vec<i64>

FFT length.

§comparison_direction: String

Comparison direction only used for kCompare.

§gather_dimension_numbers: Option<GatherDimensionNumbers>

Gather dimension numbers.

§gather_slice_sizes: Vec<i64>§channel_name: String

Compute Host.

§cost_estimate_ns: i64§id: i64

The id of this instruction.

§operand_ids: Vec<i64>§control_predecessor_ids: Vec<i64>§called_computation_ids: Vec<i64>§sharding: Option<OpSharding>§backend_config: String

Backend configuration for the instruction. Has backend-specific meaning.

§replica_groups: Vec<ReplicaGroup>

Cross replica op fields.

§all_reduce_id: i64
👎Deprecated

Deprecated, but keeping it for backward compatibility. Use channel_id. Non-positive all_reduce_id is equivalent to no all_reduce_id.

§is_host_transfer: bool

Whether 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: bool

Whether 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: bool

For 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: bool

Whether the kCustomCall instruction has side-effects, only present for kCustomCall.

§delta: i64

The delta value for kRngGetAndUpdateState.

§indices_are_sorted: bool

Specifies if the gather/scatter indices are guaranteed to be sorted by the caller.

Implementations§

Source§

impl HloInstructionProto

Source

pub fn distribution(&self) -> RandomDistribution

Returns the enum value of distribution, or the default if the field is set to an invalid enum value.

Source

pub fn set_distribution(&mut self, value: RandomDistribution)

Sets distribution to the provided enum value.

Source

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.

Source

pub fn set_fft_type(&mut self, value: FftType)

Sets fft_type to the provided enum value.

Trait Implementations§

Source§

impl Clone for HloInstructionProto

Source§

fn clone(&self) -> HloInstructionProto

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HloInstructionProto

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HloInstructionProto

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for HloInstructionProto

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for HloInstructionProto

Source§

fn eq(&self, other: &HloInstructionProto) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for HloInstructionProto

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.