Building upon the answer from Gili.

Using the aws CLI and jq :

aws --region us-east-1 pricing get-products \
  --service-code AmazonSageMaker \
  --filters Type=TERM_MATCH,Field=regionCode,Value=eu-north-1 \
  | jq -r '.PriceList[]|fromjson|select(.product.productFamily == "ML Instance")|.product.attributes.instanceName'\
|sort\
|uniq

ml.c5.12xlarge
ml.c5.18xlarge
ml.c5.24xlarge
ml.c5.2xlarge
ml.c5.4xlarge
ml.c5.9xlarge
ml.c5.large
...
ml.t3.2xlarge
ml.t3.large
ml.t3.medium
ml.t3.xlarge

it uses

  • aws pricing get-products
    • --region us-east-1 is important because the Pricing service is not widely available
    • --filters Type=TERM_MATCH,Field=regionCode,Values=eu-north-1 to restrict the listing to products in eu-north-1 region, the number of products for AmazonSageMaker alone across all regions is huge, so better to let AWS to filter out those early
  • jq is used to further filter the output, it seems it's not possible to filter by productFamily at the aws pricing get-products so we need to do it with jq
    • -r removes the quotes from the output
    • .PriceList[] will iterate over all the prices returned by aws pricing get-products
    • fromjson will parse the each string as JSON (.PriceList is an array of strings)
    • select(.product.productFamily == "ML Instance") will filter out all other products
    • .product.attributes.instanceName extracts the instance type from each product.
Answer from RubenLaguna on Stack Overflow
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.226.0 › api › utility › instance_types.html
Instance Types — sagemaker 2.226.0 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, hub_arn=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
Amazon Web Services
aws.amazon.com › machine learning › amazon sagemaker › pricing
SageMaker pricing - AWS
5 days ago - Fine-grained permissions, powered by AWS Lake Formation, are provided at no extra cost. For the most accurate and detailed pricing information, consult lakehouse pricing. SageMaker AI follows a pay-as-you-go pricing model with no upfront commitments or minimum fees. The key pricing dimensions for SageMaker AI include instance usage (compute resources used in training, hosting, and notebook instances), storage (Amazon SageMaker notebooks, Amazon Elastic Block Store (Amazon EBS) volumes, and Amazon S3), data processing jobs, model deployment, and MLOps (Amazon SageMaker Pipelines and Model Monitor).
Top answer
1 of 2
4

Building upon the answer from Gili.

Using the aws CLI and jq :

aws --region us-east-1 pricing get-products \
  --service-code AmazonSageMaker \
  --filters Type=TERM_MATCH,Field=regionCode,Value=eu-north-1 \
  | jq -r '.PriceList[]|fromjson|select(.product.productFamily == "ML Instance")|.product.attributes.instanceName'\
|sort\
|uniq

ml.c5.12xlarge
ml.c5.18xlarge
ml.c5.24xlarge
ml.c5.2xlarge
ml.c5.4xlarge
ml.c5.9xlarge
ml.c5.large
...
ml.t3.2xlarge
ml.t3.large
ml.t3.medium
ml.t3.xlarge

it uses

  • aws pricing get-products
    • --region us-east-1 is important because the Pricing service is not widely available
    • --filters Type=TERM_MATCH,Field=regionCode,Values=eu-north-1 to restrict the listing to products in eu-north-1 region, the number of products for AmazonSageMaker alone across all regions is huge, so better to let AWS to filter out those early
  • jq is used to further filter the output, it seems it's not possible to filter by productFamily at the aws pricing get-products so we need to do it with jq
    • -r removes the quotes from the output
    • .PriceList[] will iterate over all the prices returned by aws pricing get-products
    • fromjson will parse the each string as JSON (.PriceList is an array of strings)
    • select(.product.productFamily == "ML Instance") will filter out all other products
    • .product.attributes.instanceName extracts the instance type from each product.
2 of 2
1

You can get the list of ml instances with this CLI call (doc):

aws pricing get-products --service-code AmazonSageMaker --filters Type=TERM_MATCH,Field=location,Value="US East (N. Virginia)"

You'll need to filter the results further. Note that a particular ml instance type might be available for a certain SageMaker feature like training, but not for inference. And be available in one region but not another.

If you're end goal is to get technical details, you could first fine the relevant ml.* instances (maybe even with regex), then use the EC2 describe instance type to get more details (just strip down the ml. prefix).

You can find relevant Python code in the "Total Cost" section of my notebook here.

🌐
SageMaker
sagemaker.readthedocs.io › en › stable › api › utility › instance_types.html
Instance Types — sagemaker 2.254.1 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, hub_arn=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None) · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.243.1 › api › utility › instance_types.html
Instance Types — sagemaker 2.243.1 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, hub_arn=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.221.1 › api › utility › instance_types.html
Instance Types — sagemaker 2.221.1 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
Find elsewhere
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.224.1 › api › utility › instance_types.html
Instance Types — sagemaker 2.224.1 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, hub_arn=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.213.0 › api › utility › instance_types.html
Instance Types — sagemaker 2.213.0 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
ClassMethod
dev.classmethod.jp › articles › how-to-choose-the-right-amazon-sagemaker-instance-type
How to Choose the Right Amazon SageMaker Instance Type | DevelopersIO
Amazon SageMaker provides a broad choice of instance types tailored for various machine learning workloads, so it's critical to thoroughly consider your options to ensure you're picking the appropriate instance type for your use case. You can guarantee that your SageMaker tasks operate smoothly and effectively by doing so. AWSのGPU系EC2インスタンスをまとめてみた
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.205.0 › api › utility › instance_types.html
Instance Types — sagemaker 2.205.0 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None)¶ · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
SageMaker
sagemaker.readthedocs.io › en › v2.244.1 › api › utility › instance_types.html
Instance Types — sagemaker 2.244.1 documentation
sagemaker.instance_types.retrieve(region=None, model_id=None, model_version=None, hub_arn=None, scope=None, tolerate_vulnerable_model=False, tolerate_deprecated_model=False, sagemaker_session=<sagemaker.session.Session object>, training_instance_type=None) · Retrieves the supported training instance types for the model matching the given arguments. ... region (str) – The AWS Region for which to retrieve the supported instance types.
🌐
Holori
holori.com › accueil › blog › ultimate aws sagemaker pricing guide
Holori - Ultimate AWS Sagemaker pricing guide
October 23, 2024 - SageMaker Inference Options: Provides flexible deployment solutions—such as Real-Time Inference, Batch Transform, Multi-Model Endpoints, and Serverless Inference. Costs are generally based on the compute instance type, prediction duration, and data transfer. AWS SageMaker offers a variety of services that can be broadly categorized into four main areas:
🌐
AWS
docs.aws.amazon.com › amazon sagemaker › developer guide › deploy models for inference › model performance optimization with sagemaker neo › cloud instances › supported instance types and frameworks
Supported Instance Types and Frameworks - Amazon SageMaker AI
Currently, you can use the ml_inf1 instance to deploy your compiled models. Currently, you can deploy your SageMaker Neo-compiled model to AWS Inferentia2-based Amazon EC2 Inf2 instances (in US East (Ohio) Region), and to AWS Trainium-based Amazon EC2 Trn1 instances (in US East (N.
🌐
Medium
arindam-dey.medium.com › a-gentle-introduction-to-aws-sagemaker-part-i-7e4ef93a6ba4
A Gentle Introduction to AWS SageMaker - Part I | by Arindam Dey | Medium
July 2, 2022 - We created a Sagemaker instance of type ml.t2.medium. We associated a lifecycle configuration named imblearn , so that instance always starts up with this package. ... Load dataset into an AWS S3 ( Simple Storage Service ) bucket.