@@ -573,24 +573,31 @@ Here is an example:
573
573
# When you are done using your endpoint
574
574
model.sagemaker_session.delete_endpoint(' my-endpoint' )
575
575
576
- *********************************************************
577
- Use SageMaker JumpStart Algorithms with Pretrained Models
578
- *********************************************************
576
+ ***********************************************************************
577
+ Use Built-in Algorithms with Pre-trained Models in SageMaker Python SDK
578
+ ***********************************************************************
579
+
580
+ SageMaker Python SDK provides built-in algorithms with pre-trained models from popular open source model
581
+ hubs, such as TensorFlow Hub, Pytorch Hub, and HuggingFace. Customer can deploy these pre-trained models
582
+ as-is or first fine-tune them on a custom dataset and then deploy to a SageMaker endpoint for inference.
583
+
584
+
585
+ SageMaker SDK built-in algorithms allow customers access pre-trained models using model ids and model
586
+ versions. The ‘pre-trained model’ table below provides list of models with information useful in
587
+ selecting the correct model id and corresponding parameters. These models are also available through
588
+ the `JumpStart UI in SageMaker Studio <https://docs.aws.amazon.com/sagemaker/latest/dg/studio-jumpstart.html >`__.
579
589
580
- JumpStart for the SageMaker Python SDK uses model ids and model versions to access the necessary
581
- utilities. This table serves to provide the core material plus some extra information that can be useful
582
- in selecting the correct model id and corresponding parameters.
583
590
584
591
.. toctree ::
585
592
:maxdepth: 2
586
593
587
- doc_utils/jumpstart
594
+ doc_utils/pretrainedmodels
588
595
589
596
Example notebooks
590
597
=================
591
598
592
- JumpStart supports 15 different machine learning problem types. Below is a list of all the supported
593
- problem types with a link to a Jupyter notebook that provides example usage.
599
+ SageMaker built-in algorithms with pre-trained models support 15 different machine learning problem types.
600
+ Below is a list of all the supported problem types with a link to a Jupyter notebook that provides example usage.
594
601
595
602
Vision
596
603
- `Image Classification <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_image_classification/Amazon_JumpStart_Image_Classification.ipynb >`__
@@ -610,25 +617,15 @@ Text
610
617
- `Text Embedding <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_text_embedding/Amazon_JumpStart_Text_Embedding.ipynb >`__
611
618
612
619
Tabular
613
- - `Tabular Classification (LightGBM & Catboost) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_tabular_classification/Amazon_JumpStart_Tabular_Classification_LightGBM_CatBoost.ipynb >`__
614
- - `Tabular Classification (XGBoost & Linear Learner) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_tabular_classification/Amazon_JumpStart_Tabular_Classification_XGBoost_LinearLearner.ipynb >`__
615
- - `Tabular Regression (LightGBM & Catboost) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_tabular_regression/Amazon_JumpStart_Tabular_Regression_LightGBM_CatBoost.ipynb >`__
616
- - `Tabular Regression (XGBoost & Linear Learner) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_tabular_regression/Amazon_JumpStart_Tabular_Regression_XGBoost_LinearLearner.ipynb >`__
617
-
618
-
619
- `Amazon SageMaker JumpStart <https://aws.amazon.com/sagemaker/getting-started/ >`__ is a
620
- SageMaker feature that helps users bring machine learning (ML)
621
- applications to market using prebuilt solutions for common use cases,
622
- example notebooks, open source models from model zoos, and built-in
623
- algorithms.
624
-
625
- A JumpStart model enables you to quickly start a machine learning
626
- workflow. JumpStart takes models from popular open source model hubs,
627
- such as TensorFlow and HuggingFace, and pre-trains them on an open
628
- source dataset. Using the SageMaker Python SDK, you can select a
629
- prebuilt model from the model zoo to train on custom data or deploy
630
- to a SageMaker endpoint for inference without signing up for
631
- SageMaker Studio.
620
+ - `Tabular Classification (LightGBM & Catboost) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/lightgbm_catboost_tabular/Amazon_Tabular_Classification_LightGBM_CatBoost.ipynb >`__
621
+ - `Tabular Classification (XGBoost & Scikit-learn Linear Learner) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/xgboost_linear_learner_tabular/Amazon_Tabular_Classification_XGBoost_LinearLearner.ipynb >`__
622
+ - `Tabular Classification (AutoGluon) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/autogluon_tabular/Amazon_Tabular_Classification_AutoGluon.ipynb >`__
623
+ - `Tabular Classification (TabTransformer) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/tabtransformer_tabular/Amazon_Tabular_Classification_TabTransformer.ipynb >`__
624
+ - `Tabular Regression (LightGBM & Catboost) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/lightgbm_catboost_tabular/Amazon_Tabular_Regression_LightGBM_CatBoost.ipynb >`__
625
+ - `Tabular Regression (XGBoost & Scikit-learn Linear Learner) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/xgboost_linear_learner_tabular/Amazon_Tabular_Regression_XGBoost_LinearLearner.ipynb >`__
626
+ - `Tabular Regression (AutoGluon) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/autogluon_tabular/Amazon_Tabular_Regression_AutoGluon.ipynb >`__
627
+ - `Tabular Regression (TabTransformer) <https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/tabtransformer_tabular/Amazon_Tabular_Regression_TabTransformer.ipynb >`__
628
+
632
629
633
630
The following topic give you information about JumpStart components,
634
631
as well as how to use the SageMaker Python SDK for these workflows.
@@ -644,24 +641,22 @@ Prerequisites
644
641
Amazon S3. For more information about IAM role permissions,
645
642
see `Policies and permissions in IAM <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html>`__.
646
643
647
- JumpStart Components
648
- ====================
644
+ Built-in Components
645
+ ===================
649
646
650
- The following sections give information about the main JumpStart
647
+ The following sections give information about the main built-in
651
648
components and their function.
652
649
653
- JumpStart models
654
- ----------------
650
+ Pre-trained models
651
+ ------------------
655
652
656
- JumpStart maintains a model zoo of over 300 models pre-trained on
657
- open source datasets. You can use the SageMaker Python SDK
658
- to fine-tune a model on your own dataset or deploy it directly to a
659
- SageMaker endpoint for inference.
653
+ SageMaker maintains a model zoo of over 300 models from popular open source model hubs, such as
654
+ TensorFlow Hub, Pytorch Hub, and HuggingFace. You can use the SageMaker Python SDK to fine-tune
655
+ a model on your own dataset or deploy it directly to a SageMaker endpoint for inference.
660
656
661
- JumpStart model artifacts are stored as tarballs in the JumpStart S3
662
- bucket. Each model is versioned and contains a unique ID which can be
663
- used to retrieve the model URI. The following information describes
664
- the ``model_id`` and ``model_version `` needed to retrieve the URI.
657
+ Model artifacts are stored as tarballs in a S3 bucket. Each model is versioned and contains a
658
+ unique ID which can be used to retrieve the model URI. The following information describes the
659
+ ``model_id `` and ``model_version `` needed to retrieve the URI.
665
660
666
661
.. container ::
667
662
@@ -671,7 +666,7 @@ the ``model_id`` and ``model_version`` needed to retrieve the URI.
671
666
required parameter.
672
667
673
668
To retrieve a model, first select a ``model ID `` and ``version `` from
674
- the :doc: `available models <./doc_utils/jumpstart >`.
669
+ the :doc: `available models <./doc_utils/pretrainedmodels >`.
675
670
676
671
.. code :: python
677
672
@@ -688,15 +683,13 @@ Then use those values to retrieve the model as follows.
688
683
model_id = model_id, model_version = model_version, model_scope = scope
689
684
)
690
685
691
- JumpStart scripts
692
- -----------------
686
+ Model scripts
687
+ -------------
693
688
694
- To adapt JumpStart models for SageMaker, a custom
695
- script is needed to perform training or inference. JumpStart
696
- maintains a suite of scripts used for each of the models in the
697
- JumpStart S3 bucket, which can be accessed using the SageMaker Python
698
- SDK. Use the ``model_id`` and ``version `` of the corresponding model
699
- to retrieve the related script as follows.
689
+ To adapt pre-trained models for SageMaker, a custom script is needed to perform training
690
+ or inference. SageMaker maintains a suite of scripts used for each of the models in the
691
+ S3 bucket, which can be accessed using the SageMaker Python SDK Use the ``model_id`` and
692
+ ``version `` of the corresponding model to retrieve the related script as follows.
700
693
701
694
.. code :: python
702
695
@@ -706,11 +699,11 @@ to retrieve the related script as follows.
706
699
model_id = model_id, model_version = model_version, script_scope = scope
707
700
)
708
701
709
- JumpStart images
710
- ----------------
702
+ Model images
703
+ -------------
711
704
712
705
A Docker image is required to perform training or inference on all
713
- SageMaker models. JumpStart relies on Docker images from the
706
+ SageMaker models. SageMaker relies on Docker images from the
714
707
following repos https://github.com/aws/deep-learning-containers,
715
708
https://github.com/aws/sagemaker-xgboost-container,
716
709
and https://github.com/aws/sagemaker-scikit-learn-container. Use
@@ -733,16 +726,16 @@ retrieve the related image as follows.
733
726
Deploy a Pre-Trained Model Directly to a SageMaker Endpoint
734
727
============================================================
735
728
736
- In this section, you learn how to take a pre-trained JumpStart model
737
- and deploy it directly to a SageMaker Endpoint. This is the fastest
738
- way to start machine learning with a JumpStart model. The following
729
+ In this section, you learn how to take a pre-trained model and deploy
730
+ it directly to a SageMaker Endpoint. This is the fastest way to start
731
+ machine learning with a pre-trained model. The following
739
732
assumes familiarity with `SageMaker
740
733
models <https://sagemaker.readthedocs.io/en/stable/api/inference/model.html>`__
741
734
and their deploy functions.
742
735
743
- To begin, select a ``model_id`` and ``version`` from the JumpStart
736
+ To begin, select a ``model_id`` and ``version`` from the pre-trained
744
737
models table, as well as a model scope of either “inference” or
745
- “training”. For this example, you use a pre-trained JumpStart model,
738
+ “training”. For this example, you use a pre-trained model,
746
739
so select “inference” for your model scope. Use the utility
747
740
functions to retrieve the URI of each of the three components you
748
741
need to continue.
@@ -772,7 +765,7 @@ need to continue.
772
765
773
766
Next, pass the URIs and other key parameters as part of a new
774
767
SageMaker Model class. The ``entry_point`` is a JumpStart script
775
- named ``inference.py ``. JumpStart handles the implementation of this
768
+ named ``inference.py ``. SageMaker handles the implementation of this
776
769
script. You must use this value for model inference to be successful.
777
770
For more information about the Model class and its parameters,
778
771
see `Model <https://sagemaker.readthedocs.io/en/stable/api/inference/model.html>`__.
@@ -811,7 +804,7 @@ Deployment may take about 5 minutes.
811
804
Because the model and script URIs are distributed by SageMaker JumpStart,
812
805
the endpoint, endpoint config and model resources will be prefixed with
813
806
``sagemaker-jumpstart ``. Refer to the model ``Tags `` to inspect the
814
- JumpStart artifacts involved in the model creation.
807
+ model artifacts involved in the model creation.
815
808
816
809
Perform Inference
817
810
-----------------
@@ -829,17 +822,16 @@ the
829
822
Fine-tune a Model and Deploy to a SageMaker Endpoint
830
823
====================================================
831
824
832
- In this section, you initiate a training job to further train one of
833
- the pretrained JumpStart models for your use case, then deploy it to
834
- a SageMaker Endpoint for inference. This lets you fine tune the model
835
- for your use case with your custom dataset. The following assumes
825
+ In this section, you initiate a training job to further train one of the pre-trained models
826
+ for your use case, then deploy it to a SageMaker Endpoint for inference. This lets you fine
827
+ tune the model for your use case with your custom dataset. The following assumes
836
828
familiarity with `SageMaker training jobs and their
837
829
architecture <https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works-training.html> `__.
838
830
839
- Fine-tune a JumpStart Model on a Custom Dataset
840
- -----------------------------------------------
831
+ Fine-tune a Pre-trained Model on a Custom Dataset
832
+ -------------------------------------------------
841
833
842
- To begin, select a ``model_id`` and ``version`` from the JumpStart
834
+ To begin, select a ``model_id`` and ``version`` from the pre-trained
843
835
models table, as well as a model scope. In this case, you begin by
844
836
using “training” as the model scope. Use the utility functions to
845
837
retrieve the URI of each of the three components you need to
@@ -875,10 +867,10 @@ Table <https://aws.amazon.com/sagemaker/pricing/#On-Demand_Pricing>`__ and selec
875
867
instance_type = training_instance_type,
876
868
)
877
869
878
- Next, use the JumpStart resource URIs to create an ``Estimator`` and
870
+ Next, use the model resource URIs to create an ``Estimator`` and
879
871
train it on a custom training dataset. You must specify the S3 path
880
872
of your custom training dataset. The Estimator class requires
881
- an ``entry_point`` parameter. In this case, JumpStart uses
873
+ an ``entry_point`` parameter. In this case, SageMaker uses
882
874
“transfer_learning.py”. The training job fails to execute if this
883
875
value is not set.
884
876
0 commit comments