Class: AWSCDK::Sagemaker::CfnInferenceComponent::InferenceComponentComputeResourceRequirementsProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Sagemaker::CfnInferenceComponent::InferenceComponentComputeResourceRequirementsProperty
- Defined in:
- sagemaker/cfn_inference_component.rb
Overview
Defines the compute resources to allocate to run a model, plus any adapter models, that you assign to an inference component.
These resources include CPU cores, accelerators, and memory.
Instance Attribute Summary collapse
-
#max_memory_required_in_mb ⇒ Numeric?
readonly
The maximum MB of memory to allocate to run a model that you assign to an inference component.
-
#min_memory_required_in_mb ⇒ Numeric?
readonly
The minimum MB of memory to allocate to run a model that you assign to an inference component.
-
#number_of_accelerator_devices_required ⇒ Numeric?
readonly
The number of accelerators to allocate to run a model that you assign to an inference component.
-
#number_of_cpu_cores_required ⇒ Numeric?
readonly
The number of CPU cores to allocate to run a model that you assign to an inference component.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(max_memory_required_in_mb: nil, min_memory_required_in_mb: nil, number_of_accelerator_devices_required: nil, number_of_cpu_cores_required: nil) ⇒ InferenceComponentComputeResourceRequirementsProperty
constructor
A new instance of InferenceComponentComputeResourceRequirementsProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(max_memory_required_in_mb: nil, min_memory_required_in_mb: nil, number_of_accelerator_devices_required: nil, number_of_cpu_cores_required: nil) ⇒ InferenceComponentComputeResourceRequirementsProperty
Returns a new instance of InferenceComponentComputeResourceRequirementsProperty.
842 843 844 845 846 847 848 849 850 851 |
# File 'sagemaker/cfn_inference_component.rb', line 842 def initialize(max_memory_required_in_mb: nil, min_memory_required_in_mb: nil, number_of_accelerator_devices_required: nil, number_of_cpu_cores_required: nil) @max_memory_required_in_mb = max_memory_required_in_mb Jsii::Type.check_type(@max_memory_required_in_mb, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxMemoryRequiredInMb") unless @max_memory_required_in_mb.nil? @min_memory_required_in_mb = min_memory_required_in_mb Jsii::Type.check_type(@min_memory_required_in_mb, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minMemoryRequiredInMb") unless @min_memory_required_in_mb.nil? @number_of_accelerator_devices_required = number_of_accelerator_devices_required Jsii::Type.check_type(@number_of_accelerator_devices_required, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "numberOfAcceleratorDevicesRequired") unless @number_of_accelerator_devices_required.nil? @number_of_cpu_cores_required = number_of_cpu_cores_required Jsii::Type.check_type(@number_of_cpu_cores_required, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "numberOfCpuCoresRequired") unless @number_of_cpu_cores_required.nil? end |
Instance Attribute Details
#max_memory_required_in_mb ⇒ Numeric? (readonly)
The maximum MB of memory to allocate to run a model that you assign to an inference component.
857 858 859 |
# File 'sagemaker/cfn_inference_component.rb', line 857 def max_memory_required_in_mb @max_memory_required_in_mb end |
#min_memory_required_in_mb ⇒ Numeric? (readonly)
The minimum MB of memory to allocate to run a model that you assign to an inference component.
862 863 864 |
# File 'sagemaker/cfn_inference_component.rb', line 862 def min_memory_required_in_mb @min_memory_required_in_mb end |
#number_of_accelerator_devices_required ⇒ Numeric? (readonly)
The number of accelerators to allocate to run a model that you assign to an inference component.
Accelerators include GPUs and AWS Inferentia.
869 870 871 |
# File 'sagemaker/cfn_inference_component.rb', line 869 def number_of_accelerator_devices_required @number_of_accelerator_devices_required end |
#number_of_cpu_cores_required ⇒ Numeric? (readonly)
The number of CPU cores to allocate to run a model that you assign to an inference component.
874 875 876 |
# File 'sagemaker/cfn_inference_component.rb', line 874 def number_of_cpu_cores_required @number_of_cpu_cores_required end |
Class Method Details
.jsii_properties ⇒ Object
876 877 878 879 880 881 882 883 |
# File 'sagemaker/cfn_inference_component.rb', line 876 def self.jsii_properties { :max_memory_required_in_mb => "maxMemoryRequiredInMb", :min_memory_required_in_mb => "minMemoryRequiredInMb", :number_of_accelerator_devices_required => "numberOfAcceleratorDevicesRequired", :number_of_cpu_cores_required => "numberOfCpuCoresRequired", } end |
Instance Method Details
#to_jsii ⇒ Object
885 886 887 888 889 890 891 892 893 894 |
# File 'sagemaker/cfn_inference_component.rb', line 885 def to_jsii result = {} result.merge!({ "maxMemoryRequiredInMb" => @max_memory_required_in_mb, "minMemoryRequiredInMb" => @min_memory_required_in_mb, "numberOfAcceleratorDevicesRequired" => @number_of_accelerator_devices_required, "numberOfCpuCoresRequired" => @number_of_cpu_cores_required, }) result.compact end |