ExecutionOptions

Struct ExecutionOptions 

Source
pub struct ExecutionOptions {
Show 22 fields pub shape_with_output_layout: Option<ShapeProto>, pub seed: u64, pub debug_options: Option<DebugOptions>, pub device_handles: Vec<DeviceHandle>, pub num_replicas: i32, pub device_assignment: Option<DeviceAssignmentProto>, pub alias_passthrough_params: bool, pub num_partitions: i32, pub launch_id: i32, pub use_spmd_partitioning: bool, pub use_auto_spmd_partitioning: bool, pub auto_spmd_partitioning_mesh_shape: Vec<i64>, pub auto_spmd_partitioning_mesh_ids: Vec<i64>, pub deduplicate_hlo: bool, pub allow_spmd_sharding_propagation_to_parameters: Vec<bool>, pub allow_spmd_sharding_propagation_to_output: Vec<bool>, pub param_requires_broadcast_via_collectives: Vec<bool>, pub allow_separate_sharding_programs: bool, pub shardable_value_update_pairs: Vec<ShardableValueUpdatePairProto>, pub fdo_profile: Vec<u8>, pub device_memory_size: i64, pub use_shardy_partitioner: bool,
}
Expand description

These settings control how XLA compiles and/or runs code. Not all settings will have an effect on every platform.

When adding new fields, keep in mind that boolean fields default to false. Next id: 25.

Fields§

§shape_with_output_layout: Option<ShapeProto>

This optional field’s layout is used as a hint when storing the output of this computation. Subsequent transfers of this output array to the client may be faster when using this layout.

We use a Shape here to accommodate computations that return a tuple.

§seed: u64

Used to seed random-number generators used in this computation. If this is 0, we generate a seed ourselves.

TODO(b/32083678): Changing the seed unnecessarily forces a recompilation.

§debug_options: Option<DebugOptions>§device_handles: Vec<DeviceHandle>

This optional field specifies a particular set of devices to run the computation on. The computation will be partitioned across these devices. If not provided, the default device will be chosen.

§num_replicas: i32

Number of replicas of the computation to run. If zero, uses the default number of replicas for the XLA service.

§device_assignment: Option<DeviceAssignmentProto>

This optional field specifies the device assignment if known at compile time.

§alias_passthrough_params: bool

Alias input and output buffers for parameters that are passed-through XLA modules without being changed.

§num_partitions: i32

Number of partitions of the computation to run (model parallelism). If zero, uses the default number of partitions for the XLA service.

§launch_id: i32

Used to identify a set of programs that should be launch together.

§use_spmd_partitioning: bool

Indicates whether to use SPMD (true) or MPMD (false) partitioning when num_partitions > 1 and XLA is requested to partition the input program.

§use_auto_spmd_partitioning: bool

Whether to automatically generate XLA shardings for SPMD partitioner.

§auto_spmd_partitioning_mesh_shape: Vec<i64>

Device mesh shape used to create the sharding search space when use_auto_spmd_partitioning=true.

§auto_spmd_partitioning_mesh_ids: Vec<i64>

Device mesh ids compatible with the above mesh_shape used when use_auto_spmd_partitioning=true.

§deduplicate_hlo: bool

If set, deduplicate hlo into function calls to reduce binary size. Only works on TPU.

§allow_spmd_sharding_propagation_to_parameters: Vec<bool>

Allows sharding propagation to propagate to the parameters. This changes the input shape of the computation (which is undesirable), but it can be used to allow to run partial compilation to determine what would be the input sharding of a computation if XLA would be allowed to propagate the sharding which can be used by higher level framework as a way to query intermediate sharding of operations when multiple computation would be chained and merged together. This is a vector of bool, because the user can control which parameters can have the sharding substituted. If only one boolean value is passed in the vector that is interpreted as the value to be applied for every parameter.

§allow_spmd_sharding_propagation_to_output: Vec<bool>

Allows sharding propagation to propagate to the outputs. This changes the output shape of the computation (which is undesirable), but it can be used to allow to run partial compilation to determine what would be the output sharding of a computation if XLA would be allowed to propagate the sharding which can be used by higher level framework as a way to query intermediate sharding of operations when multiple computation would be chained and merged together. This is a vector of bool, because the user can control (if the output of the computation is a tuple) which elements of the tuple can have the sharding substituted and which don’t. If only one boolean value is passed in the vector that’s interpreted as the value to be applied for every single element of the output tuple. One value per element of the tuple means that each value is attached to one of the output elements.

§param_requires_broadcast_via_collectives: Vec<bool>

Whether to broadcast args across all replicas. One entry per arg.

§allow_separate_sharding_programs: bool

If enabled, the compiler may generate sharding and unsharding programs as separate HLO modules, and modify the main program’s input and output to be sharded.

§shardable_value_update_pairs: Vec<ShardableValueUpdatePairProto>

The list of input/output pairs in the main program that could be sharded.

§fdo_profile: Vec<u8>

Profiling data for feedback directed optimizations. Note that this is not the only way to feed FDO data into the compiler and individual backends may choose to get FDO data by other means.

§device_memory_size: i64

Amount of device memory available for the executable to use.

§use_shardy_partitioner: bool

Use Shardy, a new partitioner, to replace the existing ShardingPropagation and SpmdPartitioner. See go/xla-sdy-pipeline for details.

Trait Implementations§

Source§

impl Clone for ExecutionOptions

Source§

fn clone(&self) -> ExecutionOptions

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionOptions

Source§

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

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

impl Default for ExecutionOptions

Source§

fn default() -> Self

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

impl Message for ExecutionOptions

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(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

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

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

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

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

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

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

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

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

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

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

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

impl PartialEq for ExecutionOptions

Source§

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

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

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 ExecutionOptions

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.