What is the Differences between SageMaker pytorch SDK and tensorflow SDK?

0

Dear SageMaker makers,

Hi, I'm reading the docs about sagemaker pytorch, tensorflow SDK. But I can't get how each framework sdks are optimized for that framework. Literally, What makes using pytorch sdk more beneficial to train and deploy pytorch model than using just sagemaker sdk (sagemaker.pytorch.estimator.PyTorch vs. sagemaker.estimator.Estimator)

thank you!

已提問 1 年前檢視次數 275 次
1 個回答
0

Hello,

  • Sagemaker has two types of APIs the Low-level API (i.e. AWS SDK for Python (Boto 3)) [1] and the High-level API (i.e. Amazon SageMaker Python SDK) [2].
  • The low-level API provides APIs for creating and managing SageMaker resources.
  • The High-level API is an open source library for training and deploying machine learning models on Amazon SageMaker.

The high-level API aka Amazon SageMaker Python SDK supports managed training and inferencing for a variety of machine learning frameworks which includes PyTorch, Tensorflow, etc. So what you are referring to as SageMaker Pytorch SDK and Sagemaker Tensorflow SDK are not SDK but the popular ML frameworks included in the SageMaker Python SDK.

SageMaker uses 2 types of estimators:

  • The generic estimator (sagemaker.estimator.Estimator) and
  • the framework estimator (sagemaker.[framework].estimator.[Framework] eg. sagemaker.pytorch.estimator.PyTorch)

The generic estimator allows you to extend one of the pre-built containers or build a custom container to create your own ML environment with SageMaker. You use the generic Estimator class to specify the image URI of the custom Docker container hosted in your Amazon Elastic Container Registry (Amazon ECR) [3].

When using the framework estimator you do not explicitly provide a Docker image as a default image but have the flexibility to set-up a customised image. It can be beneficial in the sense that the framework estimator class picks up your training script and automatically matches the right image URI of the pre-built image, given the value specified to the framework_version parameter. In terms of optimisation, the framework estimator supports a quick adoption of distributed training job [4].

In a nutshell, you use the generic estimator if you want to extend a pre-built container or built a custom container and use the framework estimator for customised models built using framework specific script.

You can find more information about the framework estimator in the documentation [5] and the generic estimator here [6].

Let me know if this answers your question.

References:

[1] https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html?icmpid=docs_sagemaker_lp

[2] https://sagemaker.readthedocs.io/en/stable/index.html

[3] https://docs.amazonaws.cn/en_us/sagemaker/latest/dg/data-parallel-use-api.html#data-parallel-use-python-skd-api

[4] https://docs.amazonaws.cn/en_us/sagemaker/latest/dg/data-parallel-use-api.html#data-parallel-framework-estimator

[5] https://docs.amazonaws.cn/en_us/sagemaker/latest/dg/prebuilt-containers-extend.html

[6] https://docs.amazonaws.cn/en_us/sagemaker/latest/dg/distributed-training-notebook-examples.html

AWS
支援工程師
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南