/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SageMaker { namespace Model { /** *

The configuration of resources, including compute instances and storage * volumes for use in training jobs launched by hyperparameter tuning jobs. * HyperParameterTuningResourceConfig is similar to * ResourceConfig, but has the additional InstanceConfigs * and AllocationStrategy fields to allow for flexible instance * management. Specify one or more instance types, count, and the allocation * strategy for instance selection.

* HyperParameterTuningResourceConfig supports the capabilities of * ResourceConfig with the exception of * KeepAlivePeriodInSeconds. Hyperparameter tuning jobs use warm pools * by default, which reuse clusters between training jobs.

See * Also:

AWS * API Reference

*/ class HyperParameterTuningResourceConfig { public: AWS_SAGEMAKER_API HyperParameterTuningResourceConfig(); AWS_SAGEMAKER_API HyperParameterTuningResourceConfig(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API HyperParameterTuningResourceConfig& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline const TrainingInstanceType& GetInstanceType() const{ return m_instanceType; } /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline bool InstanceTypeHasBeenSet() const { return m_instanceTypeHasBeenSet; } /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline void SetInstanceType(const TrainingInstanceType& value) { m_instanceTypeHasBeenSet = true; m_instanceType = value; } /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline void SetInstanceType(TrainingInstanceType&& value) { m_instanceTypeHasBeenSet = true; m_instanceType = std::move(value); } /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline HyperParameterTuningResourceConfig& WithInstanceType(const TrainingInstanceType& value) { SetInstanceType(value); return *this;} /** *

The instance type used to run hyperparameter optimization tuning jobs. See * descriptions of instance types for more information.

*/ inline HyperParameterTuningResourceConfig& WithInstanceType(TrainingInstanceType&& value) { SetInstanceType(std::move(value)); return *this;} /** *

The number of compute instances of type InstanceType to use. For * distributed * training, select a value greater than 1.

*/ inline int GetInstanceCount() const{ return m_instanceCount; } /** *

The number of compute instances of type InstanceType to use. For * distributed * training, select a value greater than 1.

*/ inline bool InstanceCountHasBeenSet() const { return m_instanceCountHasBeenSet; } /** *

The number of compute instances of type InstanceType to use. For * distributed * training, select a value greater than 1.

*/ inline void SetInstanceCount(int value) { m_instanceCountHasBeenSet = true; m_instanceCount = value; } /** *

The number of compute instances of type InstanceType to use. For * distributed * training, select a value greater than 1.

*/ inline HyperParameterTuningResourceConfig& WithInstanceCount(int value) { SetInstanceCount(value); return *this;} /** *

The volume size in GB for the storage volume to be used in processing * hyperparameter optimization jobs (optional). These volumes store model * artifacts, incremental states and optionally, scratch space for training * algorithms. Do not provide a value for this parameter if a value for * InstanceConfigs is also specified.

Some instance types have * a fixed total local storage size. If you select one of these instances for * training, VolumeSizeInGB cannot be greater than this total size. * For a list of instance types with local instance storage and their sizes, see instance * store volumes.

SageMaker supports only the General * Purpose SSD (gp2) storage volume type.

*/ inline int GetVolumeSizeInGB() const{ return m_volumeSizeInGB; } /** *

The volume size in GB for the storage volume to be used in processing * hyperparameter optimization jobs (optional). These volumes store model * artifacts, incremental states and optionally, scratch space for training * algorithms. Do not provide a value for this parameter if a value for * InstanceConfigs is also specified.

Some instance types have * a fixed total local storage size. If you select one of these instances for * training, VolumeSizeInGB cannot be greater than this total size. * For a list of instance types with local instance storage and their sizes, see instance * store volumes.

SageMaker supports only the General * Purpose SSD (gp2) storage volume type.

*/ inline bool VolumeSizeInGBHasBeenSet() const { return m_volumeSizeInGBHasBeenSet; } /** *

The volume size in GB for the storage volume to be used in processing * hyperparameter optimization jobs (optional). These volumes store model * artifacts, incremental states and optionally, scratch space for training * algorithms. Do not provide a value for this parameter if a value for * InstanceConfigs is also specified.

Some instance types have * a fixed total local storage size. If you select one of these instances for * training, VolumeSizeInGB cannot be greater than this total size. * For a list of instance types with local instance storage and their sizes, see instance * store volumes.

SageMaker supports only the General * Purpose SSD (gp2) storage volume type.

*/ inline void SetVolumeSizeInGB(int value) { m_volumeSizeInGBHasBeenSet = true; m_volumeSizeInGB = value; } /** *

The volume size in GB for the storage volume to be used in processing * hyperparameter optimization jobs (optional). These volumes store model * artifacts, incremental states and optionally, scratch space for training * algorithms. Do not provide a value for this parameter if a value for * InstanceConfigs is also specified.

Some instance types have * a fixed total local storage size. If you select one of these instances for * training, VolumeSizeInGB cannot be greater than this total size. * For a list of instance types with local instance storage and their sizes, see instance * store volumes.

SageMaker supports only the General * Purpose SSD (gp2) storage volume type.

*/ inline HyperParameterTuningResourceConfig& WithVolumeSizeInGB(int value) { SetVolumeSizeInGB(value); return *this;} /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline const Aws::String& GetVolumeKmsKeyId() const{ return m_volumeKmsKeyId; } /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline bool VolumeKmsKeyIdHasBeenSet() const { return m_volumeKmsKeyIdHasBeenSet; } /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline void SetVolumeKmsKeyId(const Aws::String& value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId = value; } /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline void SetVolumeKmsKeyId(Aws::String&& value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId = std::move(value); } /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline void SetVolumeKmsKeyId(const char* value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId.assign(value); } /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline HyperParameterTuningResourceConfig& WithVolumeKmsKeyId(const Aws::String& value) { SetVolumeKmsKeyId(value); return *this;} /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline HyperParameterTuningResourceConfig& WithVolumeKmsKeyId(Aws::String&& value) { SetVolumeKmsKeyId(std::move(value)); return *this;} /** *

A key used by Amazon Web Services Key Management Service to encrypt data on * the storage volume attached to the compute instances used to run the training * job. You can use either of the following formats to specify a key.

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" *

Some instances use local storage, which use a hardware * module to encrypt storage volumes. If you choose one of these instance * types, you cannot request a VolumeKmsKeyId. For a list of instance * types that use local storage, see instance * store volumes. For more information about Amazon Web Services Key Management * Service, see KMS * encryption for more information.

*/ inline HyperParameterTuningResourceConfig& WithVolumeKmsKeyId(const char* value) { SetVolumeKmsKeyId(value); return *this;} /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline const HyperParameterTuningAllocationStrategy& GetAllocationStrategy() const{ return m_allocationStrategy; } /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; } /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline void SetAllocationStrategy(const HyperParameterTuningAllocationStrategy& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = value; } /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline void SetAllocationStrategy(HyperParameterTuningAllocationStrategy&& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = std::move(value); } /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline HyperParameterTuningResourceConfig& WithAllocationStrategy(const HyperParameterTuningAllocationStrategy& value) { SetAllocationStrategy(value); return *this;} /** *

The strategy that determines the order of preference for resources specified * in InstanceConfigs used in hyperparameter optimization.

*/ inline HyperParameterTuningResourceConfig& WithAllocationStrategy(HyperParameterTuningAllocationStrategy&& value) { SetAllocationStrategy(std::move(value)); return *this;} /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline const Aws::Vector& GetInstanceConfigs() const{ return m_instanceConfigs; } /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline bool InstanceConfigsHasBeenSet() const { return m_instanceConfigsHasBeenSet; } /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline void SetInstanceConfigs(const Aws::Vector& value) { m_instanceConfigsHasBeenSet = true; m_instanceConfigs = value; } /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline void SetInstanceConfigs(Aws::Vector&& value) { m_instanceConfigsHasBeenSet = true; m_instanceConfigs = std::move(value); } /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline HyperParameterTuningResourceConfig& WithInstanceConfigs(const Aws::Vector& value) { SetInstanceConfigs(value); return *this;} /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline HyperParameterTuningResourceConfig& WithInstanceConfigs(Aws::Vector&& value) { SetInstanceConfigs(std::move(value)); return *this;} /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline HyperParameterTuningResourceConfig& AddInstanceConfigs(const HyperParameterTuningInstanceConfig& value) { m_instanceConfigsHasBeenSet = true; m_instanceConfigs.push_back(value); return *this; } /** *

A list containing the configuration(s) for one or more resources for * processing hyperparameter jobs. These resources include compute instances and * storage volumes to use in model training jobs launched by hyperparameter tuning * jobs. The AllocationStrategy controls the order in which multiple * configurations provided in InstanceConfigs are used.

*

If you only want to use a single instance configuration inside the * HyperParameterTuningResourceConfig API, do not provide a value for * InstanceConfigs. Instead, use InstanceType, * VolumeSizeInGB and InstanceCount. If you use * InstanceConfigs, do not provide values for * InstanceType, VolumeSizeInGB or * InstanceCount.

*/ inline HyperParameterTuningResourceConfig& AddInstanceConfigs(HyperParameterTuningInstanceConfig&& value) { m_instanceConfigsHasBeenSet = true; m_instanceConfigs.push_back(std::move(value)); return *this; } private: TrainingInstanceType m_instanceType; bool m_instanceTypeHasBeenSet = false; int m_instanceCount; bool m_instanceCountHasBeenSet = false; int m_volumeSizeInGB; bool m_volumeSizeInGBHasBeenSet = false; Aws::String m_volumeKmsKeyId; bool m_volumeKmsKeyIdHasBeenSet = false; HyperParameterTuningAllocationStrategy m_allocationStrategy; bool m_allocationStrategyHasBeenSet = false; Aws::Vector m_instanceConfigs; bool m_instanceConfigsHasBeenSet = false; }; } // namespace Model } // namespace SageMaker } // namespace Aws