{ "cells": [ { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "# Orchestrating Jobs, Model Registration, and Continuous Deployment with Amazon SageMaker\n", "\n", "Amazon SageMaker offers Machine Learning application developers and Machine Learning operations engineers the ability to orchestrate SageMaker jobs and author reproducible Machine Learning pipelines, deploy custom-build models for inference in real-time with low latency or offline inferences with Batch Transform, and track lineage of artifacts. You can institute sound operational practices in deploying and monitoring production workflows, deployment of model artifacts, and track artifact lineage through a simple interface, adhering to safety and best-practice paradigmsfor Machine Learning application development.\n", "\n", "The SageMaker Pipelines service supports a SageMaker Machine Learning Pipeline Domain Specific Language (DSL), which is a declarative Json specification. This DSL defines a Directed Acyclic Graph (DAG) of pipeline parameters and SageMaker job steps. The SageMaker Python Software Developer Kit (SDK) streamlines the generation of the pipeline DSL using constructs that are already familiar to engineers and scientists alike.\n", "\n", "The SageMaker Model Registry is where trained models are stored, versioned, and managed. Data Scientists and Machine Learning Engineers can compare model versions, approve models for deployment, and deploy models from different AWS accounts, all from a single Model Registry. SageMaker enables customers to follow the best practices with ML Ops and getting started right. Customers are able to standup a full ML Ops end-to-end system with a single API call." ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "## SageMaker Pipelines\n", "\n", "Amazon SageMaker Pipelines support the following activites:\n", "\n", "* Pipelines - A Directed Acyclic Graph of steps and conditions to orchestrate SageMaker jobs and resource creation.\n", "* Processing Job steps - A simplified, managed experience on SageMaker to run data processing workloads, such as feature engineering, data validation, model evaluation, and model interpretation.\n", "* Training Job steps - An iterative process that teaches a model to make predictions by presenting examples from a training dataset.\n", "* Conditional step execution - Provides conditional execution of branches in a pipeline.\n", "* Registering Models - Creates a model package resource in the Model Registry that can be used to create deployable models in Amazon SageMaker.\n", "* Creating Model steps - Create a model for use in transform steps or later publication as an endpoint.\n", "* Parameterized Pipeline executions - Allows pipeline executions to vary by supplied parameters.\n", "* Transform Job steps - A batch transform to preprocess datasets to remove noise or bias that interferes with training or inference from your dataset, get inferences from large datasets, and run inference when you don't need a persistent endpoint." ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "## Layout of the SageMaker ModelBuild Project Template\n", "\n", "The template provides a starting point for bringing your SageMaker Pipeline development to production.\n", "\n", "```\n", "|-- codebuild-buildspec.yml\n", "|-- CONTRIBUTING.md\n", "|-- pipelines\n", "| |-- nlp\n", "| | |-- evaluate.py\n", "| | |-- __init__.py\n", "| | |-- pipeline.py\n", "| | |-- processing.py\n", "| | |-- train_model_1.py\n", "| | |-- train_model_2.py\n", "| |-- get_pipeline_definition.py\n", "| |-- __init__.py\n", "| |-- run_pipeline.py\n", "| |-- _utils.py\n", "| `-- __version__.py\n", "|-- README.md\n", "|-- sagemaker-pipelines-project.ipynb\n", "|-- setup.cfg\n", "|-- setup.py\n", "|-- tests\n", "| `-- test_pipelines.py\n", "`-- tox.ini\n", "```" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "A description of some of the artifacts is provided below:\n", "

\n", "Your codebuild execution instructions:\n", "```\n", "|-- codebuild-buildspec.yml\n", "```\n", "

\n", "Your pipeline artifacts, which includes a pipeline module defining the required `get_pipeline` method that returns an instance of a SageMaker pipeline, a preprocessing script that is used in feature engineering, and a model evaluation script to measure the Mean Squared Error of the model that's trained by the pipeline:\n", "\n", "```\n", "|-- pipelines\n", "| |-- nlp\n", "| | |-- evaluate.py\n", "| | |-- __init__.py\n", "| | |-- pipeline.py\n", "| | |-- processing.py\n", "| | |-- train_model_1.py\n", "| | |-- train_model_2.py\n", "\n", "```\n", "\n", "For additional subfolders with code and/or artifacts needed by pipeline, they need to be packaged correctly by the `setup.py` file. For example, to package a `pipelines/source` folder,\n", "\n", "* Include a `__init__.py` file within the `source` folder.\n", "* Add it to the `setup.py` file's `package_data` like so:\n", "\n", "```\n", "...\n", " packages=setuptools.find_packages(),\n", " include_package_data=True,\n", " package_data={\"pipelines.my_pipeline.src\": [\"*.txt\"]},\n", " python_requires=\">=3.6\",\n", " install_requires=required_packages,\n", " extras_require=extras,\n", "...\n", "```\n", "\n", "

\n", "Utility modules for getting pipeline definition jsons and running pipelines:\n", "\n", "```\n", "|-- pipelines\n", "| |-- get_pipeline_definition.py\n", "| |-- __init__.py\n", "| |-- run_pipeline.py\n", "| |-- _utils.py\n", "| `-- __version__.py\n", "```\n", "

\n", "Python package artifacts:\n", "```\n", "|-- setup.cfg\n", "|-- setup.py\n", "```\n", "

\n", "A stubbed testing module for testing your pipeline as you develop:\n", "```\n", "|-- tests\n", "| `-- test_pipelines.py\n", "```\n", "

\n", "The `tox` testing framework configuration:\n", "```\n", "`-- tox.ini\n", "```" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "### A SageMaker Pipeline\n", "\n", "The pipeline that we create follows a typical Machine Learning Application pattern of pre-processing, training, evaluation, and conditional model registration and publication, if the quality of the model is sufficient.\n", "\n", "![A typical ML Application pipeline](img/pipeline-full.png)\n", "\n", "### Getting some constants\n", "\n", "We get some constants from the local execution environment." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "! pip install -U sagemaker" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2.135.1.post0\n" ] } ], "source": [ "import boto3\n", "import sagemaker\n", "\n", "print(sagemaker.__version__)\n", "\n", "\n", "region = boto3.Session().region_name\n", "role = sagemaker.get_execution_role()\n", "default_bucket = sagemaker.session.Session().default_bucket()\n", "\n", "# Change these to reflect your project/business name or if you want to separate ModelPackageGroup/Pipeline from the rest of your team\n", "model_package_group_name_1 = f\"NlpModelPackageGroup-Example\"\n", "model_package_group_name_2 = f\"mlops-demo-batch-p-ypcnnfv6l5mn\"\n", "pipeline_name = f\"NlpPipeline-Example\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sagemaker-eu-west-1-691148928602\n" ] } ], "source": [ "! echo {default_bucket}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "processing.py\n", "requirements.txt\n", "mkdir: cannot create directory ‘../dist’: File exists\n", "Code for pipelines/nlp/processing compressed in the file dist/processing/sourcedir.tar.gz\n", "S3 Bucket not specified, no upload\n" ] } ], "source": [ "! chmod +x buildspec.sh\n", "! ./buildspec.sh pipelines/nlp/processing" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "upload: pipelines/nlp/dist/processing/sourcedir.tar.gz to s3://sagemaker-eu-west-1-691148928602/artifacts/processing/sourcedir.tar.gz\n" ] } ], "source": [ "! aws s3 cp ./pipelines/nlp/dist/processing/sourcedir.tar.gz s3://{default_bucket}/artifacts/processing/sourcedir.tar.gz" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "requirements.txt\n", "train.py\n", "mkdir: cannot create directory ‘../dist’: File exists\n", "Code for pipelines/nlp/training compressed in the file dist/training/sourcedir.tar.gz\n", "S3 Bucket not specified, no upload\n" ] } ], "source": [ "! chmod +x buildspec.sh\n", "! ./buildspec.sh pipelines/nlp/training" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "upload: pipelines/nlp/dist/training/sourcedir.tar.gz to s3://sagemaker-eu-west-1-691148928602/artifacts/training/sourcedir.tar.gz\n" ] } ], "source": [ "! aws s3 cp ./pipelines/nlp/dist/training/sourcedir.tar.gz s3://{default_bucket}/artifacts/training/sourcedir.tar.gz" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "### Get the pipeline instance\n", "\n", "Here we get the pipeline instance from your pipeline module so that we can work with it." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "This function has been deprecated and could break pipeline step caching. We recommend using the run() function directly with pipeline sessionsto access step arguments.\n" ] } ], "source": [ "from pipelines.nlp.pipeline import get_pipeline\n", "\n", "pipeline = get_pipeline(\n", " region=region,\n", " role=role,\n", " default_bucket=default_bucket,\n", " model_package_group_name_1=model_package_group_name_1,\n", " model_package_group_name_2=model_package_group_name_2,\n", " pipeline_name=pipeline_name,\n", ")" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "### Submit the pipeline to SageMaker and start execution\n", "\n", "Let's submit our pipeline definition to the workflow service. The role passed in will be used by the workflow service to create all the jobs defined in the steps." ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "Popping out 'CertifyForMarketplace' from the pipeline definition since it will be overridden in pipeline execution time.\n", "No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "Popping out 'CertifyForMarketplace' from the pipeline definition since it will be overridden in pipeline execution time.\n", "No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "Popping out 'CertifyForMarketplace' from the pipeline definition since it will be overridden in pipeline execution time.\n", "No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "Popping out 'CertifyForMarketplace' from the pipeline definition since it will be overridden in pipeline execution time.\n" ] }, { "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:eu-west-1:691148928602:pipeline/nlppipeline-example',\n", " 'ResponseMetadata': {'RequestId': '74ae3aa3-0a2e-4e1a-8fb9-909869527f66',\n", " 'HTTPStatusCode': 200,\n", " 'HTTPHeaders': {'x-amzn-requestid': '74ae3aa3-0a2e-4e1a-8fb9-909869527f66',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '91',\n", " 'date': 'Thu, 02 Mar 2023 10:15:06 GMT'},\n", " 'RetryAttempts': 0}}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pipeline.upsert(role_arn=role)" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "We'll start the pipeline, accepting all the default parameters.\n", "\n", "Values can also be passed into these pipeline parameters on starting of the pipeline, and will be covered later. " ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "execution = pipeline.start()" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "### Pipeline Operations: examining and waiting for pipeline execution\n", "\n", "Now we describe execution instance and list the steps in the execution to find out more about the execution." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:eu-west-1:691148928602:pipeline/nlppipeline-example',\n", " 'PipelineExecutionArn': 'arn:aws:sagemaker:eu-west-1:691148928602:pipeline/nlppipeline-example/execution/z9d8h8ign2vu',\n", " 'PipelineExecutionDisplayName': 'execution-1677752108776',\n", " 'PipelineExecutionStatus': 'Executing',\n", " 'CreationTime': datetime.datetime(2023, 3, 2, 10, 15, 8, 690000, tzinfo=tzlocal()),\n", " 'LastModifiedTime': datetime.datetime(2023, 3, 2, 10, 15, 8, 690000, tzinfo=tzlocal()),\n", " 'CreatedBy': {'UserProfileArn': 'arn:aws:sagemaker:eu-west-1:691148928602:user-profile/d-mvo2fb4z7box/bpistone',\n", " 'UserProfileName': 'bpistone',\n", " 'DomainId': 'd-mvo2fb4z7box'},\n", " 'LastModifiedBy': {'UserProfileArn': 'arn:aws:sagemaker:eu-west-1:691148928602:user-profile/d-mvo2fb4z7box/bpistone',\n", " 'UserProfileName': 'bpistone',\n", " 'DomainId': 'd-mvo2fb4z7box'},\n", " 'ResponseMetadata': {'RequestId': '819551e0-0285-40d7-b739-2cd6bd37671f',\n", " 'HTTPStatusCode': 200,\n", " 'HTTPHeaders': {'x-amzn-requestid': '819551e0-0285-40d7-b739-2cd6bd37671f',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '715',\n", " 'date': 'Thu, 02 Mar 2023 10:15:08 GMT'},\n", " 'RetryAttempts': 0}}" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "execution.describe()" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "We can wait for the execution by invoking `wait()` on the execution:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "tags": [], "pycharm": { "name": "#%%\n" } }, "outputs": [ { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", "\u001B[0;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", "Cell \u001B[0;32mIn[13], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mexecution\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mwait\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m/opt/conda/lib/python3.10/site-packages/sagemaker/workflow/pipeline.py:588\u001B[0m, in \u001B[0;36m_PipelineExecution.wait\u001B[0;34m(self, delay, max_attempts)\u001B[0m\n\u001B[1;32m 559\u001B[0m model \u001B[38;5;241m=\u001B[39m botocore\u001B[38;5;241m.\u001B[39mwaiter\u001B[38;5;241m.\u001B[39mWaiterModel(\n\u001B[1;32m 560\u001B[0m {\n\u001B[1;32m 561\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mversion\u001B[39m\u001B[38;5;124m\"\u001B[39m: \u001B[38;5;241m2\u001B[39m,\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 583\u001B[0m }\n\u001B[1;32m 584\u001B[0m )\n\u001B[1;32m 585\u001B[0m waiter \u001B[38;5;241m=\u001B[39m botocore\u001B[38;5;241m.\u001B[39mwaiter\u001B[38;5;241m.\u001B[39mcreate_waiter_with_client(\n\u001B[1;32m 586\u001B[0m waiter_id, model, \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msagemaker_session\u001B[38;5;241m.\u001B[39msagemaker_client\n\u001B[1;32m 587\u001B[0m )\n\u001B[0;32m--> 588\u001B[0m \u001B[43mwaiter\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mwait\u001B[49m\u001B[43m(\u001B[49m\u001B[43mPipelineExecutionArn\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43marn\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m/opt/conda/lib/python3.10/site-packages/botocore/waiter.py:55\u001B[0m, in \u001B[0;36mcreate_waiter_with_client..wait\u001B[0;34m(self, **kwargs)\u001B[0m\n\u001B[1;32m 54\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mwait\u001B[39m(\u001B[38;5;28mself\u001B[39m, \u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39mkwargs):\n\u001B[0;32m---> 55\u001B[0m \u001B[43mWaiter\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mwait\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "File \u001B[0;32m/opt/conda/lib/python3.10/site-packages/botocore/waiter.py:393\u001B[0m, in \u001B[0;36mWaiter.wait\u001B[0;34m(self, **kwargs)\u001B[0m\n\u001B[1;32m 384\u001B[0m reason \u001B[38;5;241m=\u001B[39m (\n\u001B[1;32m 385\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mMax attempts exceeded. Previously accepted state: \u001B[39m\u001B[38;5;132;01m%s\u001B[39;00m\u001B[38;5;124m'\u001B[39m\n\u001B[1;32m 386\u001B[0m \u001B[38;5;241m%\u001B[39m (acceptor\u001B[38;5;241m.\u001B[39mexplanation)\n\u001B[1;32m 387\u001B[0m )\n\u001B[1;32m 388\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m WaiterError(\n\u001B[1;32m 389\u001B[0m name\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mname,\n\u001B[1;32m 390\u001B[0m reason\u001B[38;5;241m=\u001B[39mreason,\n\u001B[1;32m 391\u001B[0m last_response\u001B[38;5;241m=\u001B[39mresponse,\n\u001B[1;32m 392\u001B[0m )\n\u001B[0;32m--> 393\u001B[0m \u001B[43mtime\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43msleep\u001B[49m\u001B[43m(\u001B[49m\u001B[43msleep_amount\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[0;31mKeyboardInterrupt\u001B[0m: " ] } ], "source": [ "execution.wait()" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "We can list the execution steps to check out the status and artifacts:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "execution.list_steps()" ] }, { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "### Parameterized Executions\n", "\n", "We can run additional executions of the pipeline specifying different pipeline parameters. The parameters argument is a dictionary whose names are the parameter names, and whose values are the primitive values to use as overrides of the defaults.\n", "\n", "Of particular note, based on the performance of the model, we may want to kick off another pipeline execution, but this time on a compute-optimized instance type and set the model approval status automatically be \"Approved\". This means that the model package version generated by the `RegisterModel` step will automatically be ready for deployment through CI/CD pipelines, such as with SageMaker Projects." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "execution = pipeline.start(\n", " parameters=dict(\n", " ProcessingInstanceType=\"ml.c5.xlarge\",\n", " ModelApprovalStatus=\"Approved\",\n", " )\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "execution.wait()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "execution.list_steps()" ] } ], "metadata": { "availableInstances": [ { "_defaultOrder": 0, "_isFastLaunch": true, "category": "General purpose", "gpuNum": 0, "memoryGiB": 4, "name": "ml.t3.medium", "vcpuNum": 2 }, { "_defaultOrder": 1, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 8, "name": "ml.t3.large", "vcpuNum": 2 }, { "_defaultOrder": 2, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 16, "name": "ml.t3.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 3, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 32, "name": "ml.t3.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 4, "_isFastLaunch": true, "category": "General purpose", "gpuNum": 0, "memoryGiB": 8, "name": "ml.m5.large", "vcpuNum": 2 }, { "_defaultOrder": 5, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 16, "name": "ml.m5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 6, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 32, "name": "ml.m5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 7, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 64, "name": "ml.m5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 8, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 128, "name": "ml.m5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 9, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 192, "name": "ml.m5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 10, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 256, "name": "ml.m5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 11, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 384, "name": "ml.m5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 12, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 8, "name": "ml.m5d.large", "vcpuNum": 2 }, { "_defaultOrder": 13, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 16, "name": "ml.m5d.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 14, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 32, "name": "ml.m5d.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 15, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 64, "name": "ml.m5d.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 16, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 128, "name": "ml.m5d.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 17, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 192, "name": "ml.m5d.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 18, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 256, "name": "ml.m5d.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 19, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "memoryGiB": 384, "name": "ml.m5d.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 20, "_isFastLaunch": true, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 4, "name": "ml.c5.large", "vcpuNum": 2 }, { "_defaultOrder": 21, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 8, "name": "ml.c5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 22, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 16, "name": "ml.c5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 23, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 32, "name": "ml.c5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 24, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 72, "name": "ml.c5.9xlarge", "vcpuNum": 36 }, { "_defaultOrder": 25, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 96, "name": "ml.c5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 26, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 144, "name": "ml.c5.18xlarge", "vcpuNum": 72 }, { "_defaultOrder": 27, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "memoryGiB": 192, "name": "ml.c5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 28, "_isFastLaunch": true, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 16, "name": "ml.g4dn.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 29, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 32, "name": "ml.g4dn.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 30, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 64, "name": "ml.g4dn.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 31, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 128, "name": "ml.g4dn.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 32, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "memoryGiB": 192, "name": "ml.g4dn.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 33, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 256, "name": "ml.g4dn.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 34, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 61, "name": "ml.p3.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 35, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "memoryGiB": 244, "name": "ml.p3.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 36, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "memoryGiB": 488, "name": "ml.p3.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 37, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "memoryGiB": 768, "name": "ml.p3dn.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 38, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 16, "name": "ml.r5.large", "vcpuNum": 2 }, { "_defaultOrder": 39, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 32, "name": "ml.r5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 40, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 64, "name": "ml.r5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 41, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 128, "name": "ml.r5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 42, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 256, "name": "ml.r5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 43, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 384, "name": "ml.r5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 44, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 512, "name": "ml.r5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 45, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "memoryGiB": 768, "name": "ml.r5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 46, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 16, "name": "ml.g5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 47, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 32, "name": "ml.g5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 48, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 64, "name": "ml.g5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 49, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 128, "name": "ml.g5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 50, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "memoryGiB": 256, "name": "ml.g5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 51, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "memoryGiB": 192, "name": "ml.g5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 52, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "memoryGiB": 384, "name": "ml.g5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 53, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "memoryGiB": 768, "name": "ml.g5.48xlarge", "vcpuNum": 192 } ], "instance_type": "ml.t3.medium", "kernelspec": { "display_name": "Python 3 (Data Science 3.0)", "language": "python", "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:eu-west-1:470317259841:image/sagemaker-data-science-310-v1" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" } }, "nbformat": 4, "nbformat_minor": 4 }