#[non_exhaustive]pub struct ResourceConfigBuilder { /* private fields */ }
Expand description
A builder for ResourceConfig
.
Implementations§
Source§impl ResourceConfigBuilder
impl ResourceConfigBuilder
Sourcepub fn instance_type(self, input: TrainingInstanceType) -> Self
pub fn instance_type(self, input: TrainingInstanceType) -> Self
The ML compute instance type.
SageMaker Training on Amazon Elastic Compute Cloud (EC2) P4de instances is in preview release starting December 9th, 2022.
Amazon EC2 P4de instances (currently in preview) are powered by 8 NVIDIA A100 GPUs with 80GB high-performance HBM2e GPU memory, which accelerate the speed of training ML models that need to be trained on large datasets of high-resolution data. In this preview release, Amazon SageMaker supports ML training jobs on P4de instances (ml.p4de.24xlarge
) to reduce model training time. The ml.p4de.24xlarge
instances are available in the following Amazon Web Services Regions.
-
US East (N. Virginia) (us-east-1)
-
US West (Oregon) (us-west-2)
To request quota limit increase and start using P4de instances, contact the SageMaker Training service team through your account team.
Sourcepub fn set_instance_type(self, input: Option<TrainingInstanceType>) -> Self
pub fn set_instance_type(self, input: Option<TrainingInstanceType>) -> Self
The ML compute instance type.
SageMaker Training on Amazon Elastic Compute Cloud (EC2) P4de instances is in preview release starting December 9th, 2022.
Amazon EC2 P4de instances (currently in preview) are powered by 8 NVIDIA A100 GPUs with 80GB high-performance HBM2e GPU memory, which accelerate the speed of training ML models that need to be trained on large datasets of high-resolution data. In this preview release, Amazon SageMaker supports ML training jobs on P4de instances (ml.p4de.24xlarge
) to reduce model training time. The ml.p4de.24xlarge
instances are available in the following Amazon Web Services Regions.
-
US East (N. Virginia) (us-east-1)
-
US West (Oregon) (us-west-2)
To request quota limit increase and start using P4de instances, contact the SageMaker Training service team through your account team.
Sourcepub fn get_instance_type(&self) -> &Option<TrainingInstanceType>
pub fn get_instance_type(&self) -> &Option<TrainingInstanceType>
The ML compute instance type.
SageMaker Training on Amazon Elastic Compute Cloud (EC2) P4de instances is in preview release starting December 9th, 2022.
Amazon EC2 P4de instances (currently in preview) are powered by 8 NVIDIA A100 GPUs with 80GB high-performance HBM2e GPU memory, which accelerate the speed of training ML models that need to be trained on large datasets of high-resolution data. In this preview release, Amazon SageMaker supports ML training jobs on P4de instances (ml.p4de.24xlarge
) to reduce model training time. The ml.p4de.24xlarge
instances are available in the following Amazon Web Services Regions.
-
US East (N. Virginia) (us-east-1)
-
US West (Oregon) (us-west-2)
To request quota limit increase and start using P4de instances, contact the SageMaker Training service team through your account team.
Sourcepub fn instance_count(self, input: i32) -> Self
pub fn instance_count(self, input: i32) -> Self
The number of ML compute instances to use. For distributed training, provide a value greater than 1.
Sourcepub fn set_instance_count(self, input: Option<i32>) -> Self
pub fn set_instance_count(self, input: Option<i32>) -> Self
The number of ML compute instances to use. For distributed training, provide a value greater than 1.
Sourcepub fn get_instance_count(&self) -> &Option<i32>
pub fn get_instance_count(&self) -> &Option<i32>
The number of ML compute instances to use. For distributed training, provide a value greater than 1.
Sourcepub fn volume_size_in_gb(self, input: i32) -> Self
pub fn volume_size_in_gb(self, input: i32) -> Self
The size of the ML storage volume that you want to provision.
ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File
as the TrainingInputMode
in the algorithm specification.
When using an ML instance with NVMe SSD volumes, SageMaker doesn't provision Amazon EBS General Purpose SSD (gp2) storage. Available storage is fixed to the NVMe-type instance's storage capacity. SageMaker configures storage paths for training datasets, checkpoints, model artifacts, and outputs to use the entire capacity of the instance storage. For example, ML instance families with the NVMe-type instance storage include ml.p4d
, ml.g4dn
, and ml.g5
.
When using an ML instance with the EBS-only storage option and without instance storage, you must define the size of EBS volume through VolumeSizeInGB
in the ResourceConfig
API. For example, ML instance families that use EBS volumes include ml.c5
and ml.p2
.
To look up instance types and their instance storage types and volumes, see Amazon EC2 Instance Types.
To find the default local paths defined by the SageMaker training platform, see Amazon SageMaker Training Storage Folders for Training Datasets, Checkpoints, Model Artifacts, and Outputs.
This field is required.Sourcepub fn set_volume_size_in_gb(self, input: Option<i32>) -> Self
pub fn set_volume_size_in_gb(self, input: Option<i32>) -> Self
The size of the ML storage volume that you want to provision.
ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File
as the TrainingInputMode
in the algorithm specification.
When using an ML instance with NVMe SSD volumes, SageMaker doesn't provision Amazon EBS General Purpose SSD (gp2) storage. Available storage is fixed to the NVMe-type instance's storage capacity. SageMaker configures storage paths for training datasets, checkpoints, model artifacts, and outputs to use the entire capacity of the instance storage. For example, ML instance families with the NVMe-type instance storage include ml.p4d
, ml.g4dn
, and ml.g5
.
When using an ML instance with the EBS-only storage option and without instance storage, you must define the size of EBS volume through VolumeSizeInGB
in the ResourceConfig
API. For example, ML instance families that use EBS volumes include ml.c5
and ml.p2
.
To look up instance types and their instance storage types and volumes, see Amazon EC2 Instance Types.
To find the default local paths defined by the SageMaker training platform, see Amazon SageMaker Training Storage Folders for Training Datasets, Checkpoints, Model Artifacts, and Outputs.
Sourcepub fn get_volume_size_in_gb(&self) -> &Option<i32>
pub fn get_volume_size_in_gb(&self) -> &Option<i32>
The size of the ML storage volume that you want to provision.
ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File
as the TrainingInputMode
in the algorithm specification.
When using an ML instance with NVMe SSD volumes, SageMaker doesn't provision Amazon EBS General Purpose SSD (gp2) storage. Available storage is fixed to the NVMe-type instance's storage capacity. SageMaker configures storage paths for training datasets, checkpoints, model artifacts, and outputs to use the entire capacity of the instance storage. For example, ML instance families with the NVMe-type instance storage include ml.p4d
, ml.g4dn
, and ml.g5
.
When using an ML instance with the EBS-only storage option and without instance storage, you must define the size of EBS volume through VolumeSizeInGB
in the ResourceConfig
API. For example, ML instance families that use EBS volumes include ml.c5
and ml.p2
.
To look up instance types and their instance storage types and volumes, see Amazon EC2 Instance Types.
To find the default local paths defined by the SageMaker training platform, see Amazon SageMaker Training Storage Folders for Training Datasets, Checkpoints, Model Artifacts, and Outputs.
Sourcepub fn volume_kms_key_id(self, input: impl Into<String>) -> Self
pub fn volume_kms_key_id(self, input: impl Into<String>) -> Self
The Amazon Web Services KMS key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.
Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can't request a VolumeKmsKeyId
when using an instance type with local storage.
For a list of instance types that support local instance storage, see Instance Store Volumes.
For more information about local instance storage encryption, see SSD Instance Store Volumes.
The VolumeKmsKeyId
can be in any of the following formats:
-
// KMS Key ID
"1234abcd-12ab-34cd-56ef-1234567890ab"
-
// Amazon Resource Name (ARN) of a KMS Key
"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
Sourcepub fn set_volume_kms_key_id(self, input: Option<String>) -> Self
pub fn set_volume_kms_key_id(self, input: Option<String>) -> Self
The Amazon Web Services KMS key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.
Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can't request a VolumeKmsKeyId
when using an instance type with local storage.
For a list of instance types that support local instance storage, see Instance Store Volumes.
For more information about local instance storage encryption, see SSD Instance Store Volumes.
The VolumeKmsKeyId
can be in any of the following formats:
-
// KMS Key ID
"1234abcd-12ab-34cd-56ef-1234567890ab"
-
// Amazon Resource Name (ARN) of a KMS Key
"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
Sourcepub fn get_volume_kms_key_id(&self) -> &Option<String>
pub fn get_volume_kms_key_id(&self) -> &Option<String>
The Amazon Web Services KMS key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.
Certain Nitro-based instances include local storage, dependent on the instance type. Local storage volumes are encrypted using a hardware module on the instance. You can't request a VolumeKmsKeyId
when using an instance type with local storage.
For a list of instance types that support local instance storage, see Instance Store Volumes.
For more information about local instance storage encryption, see SSD Instance Store Volumes.
The VolumeKmsKeyId
can be in any of the following formats:
-
// KMS Key ID
"1234abcd-12ab-34cd-56ef-1234567890ab"
-
// Amazon Resource Name (ARN) of a KMS Key
"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
Sourcepub fn keep_alive_period_in_seconds(self, input: i32) -> Self
pub fn keep_alive_period_in_seconds(self, input: i32) -> Self
The duration of time in seconds to retain configured resources in a warm pool for subsequent training jobs.
Sourcepub fn set_keep_alive_period_in_seconds(self, input: Option<i32>) -> Self
pub fn set_keep_alive_period_in_seconds(self, input: Option<i32>) -> Self
The duration of time in seconds to retain configured resources in a warm pool for subsequent training jobs.
Sourcepub fn get_keep_alive_period_in_seconds(&self) -> &Option<i32>
pub fn get_keep_alive_period_in_seconds(&self) -> &Option<i32>
The duration of time in seconds to retain configured resources in a warm pool for subsequent training jobs.
Sourcepub fn instance_groups(self, input: InstanceGroup) -> Self
pub fn instance_groups(self, input: InstanceGroup) -> Self
Appends an item to instance_groups
.
To override the contents of this collection use set_instance_groups
.
The configuration of a heterogeneous cluster in JSON format.
Sourcepub fn set_instance_groups(self, input: Option<Vec<InstanceGroup>>) -> Self
pub fn set_instance_groups(self, input: Option<Vec<InstanceGroup>>) -> Self
The configuration of a heterogeneous cluster in JSON format.
Sourcepub fn get_instance_groups(&self) -> &Option<Vec<InstanceGroup>>
pub fn get_instance_groups(&self) -> &Option<Vec<InstanceGroup>>
The configuration of a heterogeneous cluster in JSON format.
Sourcepub fn training_plan_arn(self, input: impl Into<String>) -> Self
pub fn training_plan_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN); of the training plan to use for this resource configuration.
Sourcepub fn set_training_plan_arn(self, input: Option<String>) -> Self
pub fn set_training_plan_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN); of the training plan to use for this resource configuration.
Sourcepub fn get_training_plan_arn(&self) -> &Option<String>
pub fn get_training_plan_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN); of the training plan to use for this resource configuration.
Sourcepub fn build(self) -> ResourceConfig
pub fn build(self) -> ResourceConfig
Consumes the builder and constructs a ResourceConfig
.
Trait Implementations§
Source§impl Clone for ResourceConfigBuilder
impl Clone for ResourceConfigBuilder
Source§fn clone(&self) -> ResourceConfigBuilder
fn clone(&self) -> ResourceConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ResourceConfigBuilder
impl Debug for ResourceConfigBuilder
Source§impl Default for ResourceConfigBuilder
impl Default for ResourceConfigBuilder
Source§fn default() -> ResourceConfigBuilder
fn default() -> ResourceConfigBuilder
Source§impl PartialEq for ResourceConfigBuilder
impl PartialEq for ResourceConfigBuilder
impl StructuralPartialEq for ResourceConfigBuilder
Auto Trait Implementations§
impl Freeze for ResourceConfigBuilder
impl RefUnwindSafe for ResourceConfigBuilder
impl Send for ResourceConfigBuilder
impl Sync for ResourceConfigBuilder
impl Unpin for ResourceConfigBuilder
impl UnwindSafe for ResourceConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);