#[non_exhaustive]pub struct MachineSpec {
pub machine_type: String,
pub accelerator_type: AcceleratorType,
pub accelerator_count: i32,
pub gpu_partition_size: String,
pub tpu_topology: String,
pub reservation_affinity: Option<ReservationAffinity>,
/* private fields */
}deployment-resource-pool-service or endpoint-service or index-endpoint-service or job-service or model-garden-service or notebook-service or persistent-resource-service or schedule-service only.Expand description
Specification of a single machine.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.machine_type: StringImmutable. The type of the machine.
See the list of machine types supported for prediction
See the list of machine types supported for custom training.
For DeployedModel this field is
optional, and the default value is n1-standard-2. For
BatchPredictionJob or as
part of WorkerPoolSpec this
field is required.
accelerator_type: AcceleratorTypeImmutable. The type of accelerator(s) that may be attached to the machine as per accelerator_count.
accelerator_count: i32The number of accelerators to attach to the machine.
gpu_partition_size: StringOptional. Immutable. The Nvidia GPU partition size.
When specified, the requested accelerators will be partitioned into smaller GPU partitions. For example, if the request is for 8 units of NVIDIA A100 GPUs, and gpu_partition_size=“1g.10gb”, the service will create 8 * 7 = 56 partitioned MIG instances.
The partition size must be a value supported by the requested accelerator. Refer to Nvidia GPU Partitioning for the available partition sizes.
If set, the accelerator_count should be set to 1.
tpu_topology: StringImmutable. The topology of the TPUs. Corresponds to the TPU topologies available from GKE. (Example: tpu_topology: “2x2x1”).
reservation_affinity: Option<ReservationAffinity>Optional. Immutable. Configuration controlling how this resource pool consumes reservation.
Implementations§
Source§impl MachineSpec
impl MachineSpec
pub fn new() -> Self
Sourcepub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
pub fn set_machine_type<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_accelerator_type<T: Into<AcceleratorType>>(self, v: T) -> Self
pub fn set_accelerator_type<T: Into<AcceleratorType>>(self, v: T) -> Self
Sets the value of accelerator_type.
§Example
use google_cloud_aiplatform_v1::model::AcceleratorType;
let x0 = MachineSpec::new().set_accelerator_type(AcceleratorType::NvidiaTeslaP100);
let x1 = MachineSpec::new().set_accelerator_type(AcceleratorType::NvidiaTeslaV100);
let x2 = MachineSpec::new().set_accelerator_type(AcceleratorType::NvidiaTeslaP4);Sourcepub fn set_accelerator_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_accelerator_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of accelerator_count.
§Example
let x = MachineSpec::new().set_accelerator_count(42);Sourcepub fn set_gpu_partition_size<T: Into<String>>(self, v: T) -> Self
pub fn set_gpu_partition_size<T: Into<String>>(self, v: T) -> Self
Sets the value of gpu_partition_size.
§Example
let x = MachineSpec::new().set_gpu_partition_size("example");Sourcepub fn set_tpu_topology<T: Into<String>>(self, v: T) -> Self
pub fn set_tpu_topology<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_reservation_affinity<T>(self, v: T) -> Selfwhere
T: Into<ReservationAffinity>,
pub fn set_reservation_affinity<T>(self, v: T) -> Selfwhere
T: Into<ReservationAffinity>,
Sets the value of reservation_affinity.
§Example
use google_cloud_aiplatform_v1::model::ReservationAffinity;
let x = MachineSpec::new().set_reservation_affinity(ReservationAffinity::default()/* use setters */);Sourcepub fn set_or_clear_reservation_affinity<T>(self, v: Option<T>) -> Selfwhere
T: Into<ReservationAffinity>,
pub fn set_or_clear_reservation_affinity<T>(self, v: Option<T>) -> Selfwhere
T: Into<ReservationAffinity>,
Sets or clears the value of reservation_affinity.
§Example
use google_cloud_aiplatform_v1::model::ReservationAffinity;
let x = MachineSpec::new().set_or_clear_reservation_affinity(Some(ReservationAffinity::default()/* use setters */));
let x = MachineSpec::new().set_or_clear_reservation_affinity(None::<ReservationAffinity>);Trait Implementations§
Source§impl Clone for MachineSpec
impl Clone for MachineSpec
Source§fn clone(&self) -> MachineSpec
fn clone(&self) -> MachineSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more