{ "cells": [ { "cell_type": "markdown", "id": "d5845c0a-25c6-40e6-a3ba-2b3316bd38c2", "metadata": { "tags": [] }, "source": [ "# Step 5: Add a deployment pipeline\n", "In previous four steps you implemented an automated data processing and model building pipeline. Each run of the pipeline produces a new version of the model. This notebook implements the automated model deployment step in our ML workflow.\n", "\n", "You can use a [SageMaker MLOps project template](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-templates.html) to provision a ready-to use model deployment CI/CD pipeline.\n", "\n", "This template automates the deployment of models in the SageMaker model registry to SageMaker endpoints for real-time inference. This template recognizes changes in the model registry. When a new model version is registered and approved, it automatically initiates a deployment.\n", "\n", "![](img/six-steps-5.png)" ] }, { "cell_type": "code", "execution_count": null, "id": "6cd36377-d862-4d18-a575-860bf0c15b31", "metadata": { "tags": [] }, "outputs": [], "source": [ "import boto3\n", "import sagemaker \n", "from time import gmtime, strftime, sleep\n", "\n", "sagemaker.__version__" ] }, { "cell_type": "code", "execution_count": null, "id": "aa13831e-7aad-49ac-9ea9-10ebb9fb16c9", "metadata": { "tags": [] }, "outputs": [], "source": [ "%store -r \n", "\n", "%store\n", "\n", "try:\n", " initialized\n", "except NameError:\n", " print(\"+++++++++++++++++++++++++++++++++++++++++++++++++\")\n", " print(\"[ERROR] YOU HAVE TO RUN 00-start-here notebook \")\n", " print(\"+++++++++++++++++++++++++++++++++++++++++++++++++\")" ] }, { "cell_type": "code", "execution_count": null, "id": "d0bb83a8-521f-4405-bb4f-eee77ab56094", "metadata": { "tags": [] }, "outputs": [], "source": [ "sm = boto3.client(\"sagemaker\")" ] }, { "cell_type": "markdown", "id": "f9e91bef-93a8-4265-ad0c-d6f72fde9099", "metadata": {}, "source": [ "## Create an MLOps project\n", "Follow the same procedure as in the step 4 notebook to create a model deployment MLOps project. " ] }, { "cell_type": "markdown", "id": "7c8f3124-56f3-4d5a-b354-9e7930ba1c4d", "metadata": {}, "source": [ "### Option 1: Create project programmatically\n", "Use `boto3` to create an MLOps project via a SageMaker API." ] }, { "cell_type": "code", "execution_count": null, "id": "e23f268b-1dbe-40f9-884a-7ce63f7d1352", "metadata": { "tags": [] }, "outputs": [], "source": [ "sc = boto3.client(\"servicecatalog\")\n", "\n", "sc_provider_name = \"Amazon SageMaker\"\n", "sc_product_name = \"MLOps template for model deployment\"" ] }, { "cell_type": "code", "execution_count": null, "id": "b0eb4137-e7c7-447e-9f87-2012963ea2d6", "metadata": { "tags": [] }, "outputs": [], "source": [ "p_ids = [p['ProductId'] for p in sc.search_products(\n", " Filters={\n", " 'FullTextSearch': [sc_product_name]\n", " },\n", ")['ProductViewSummaries'] if p[\"Name\"]==sc_product_name]" ] }, { "cell_type": "code", "execution_count": null, "id": "9b8ca253-eca3-4de2-9d8a-7dcfd8dc1c0f", "metadata": { "tags": [] }, "outputs": [], "source": [ "p_ids" ] }, { "cell_type": "code", "execution_count": null, "id": "3b3c3f09-ca7d-43de-9432-c106f32d0c21", "metadata": { "tags": [] }, "outputs": [], "source": [ "# If you get any exception from this code, go to the Option 2 and create a project in Studio UX\n", "if not len(p_ids):\n", " raise Exception(\"No Amazon SageMaker ML Ops products found!\")\n", "elif len(p_ids) > 1:\n", " raise Exception(\"Too many matching Amazon SageMaker ML Ops products found!\")\n", "else:\n", " product_id = p_ids[0]\n", " print(f\"ML Ops product id: {product_id}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "38294903-3f86-4a3a-9849-40af57753c34", "metadata": { "tags": [] }, "outputs": [], "source": [ "provisioning_artifact_id = sorted(\n", " [i for i in sc.list_provisioning_artifacts(\n", " ProductId=product_id\n", " )['ProvisioningArtifactDetails'] if i['Guidance']=='DEFAULT'],\n", " key=lambda d: d['Name'], reverse=True)[0]['Id']" ] }, { "cell_type": "code", "execution_count": null, "id": "70b48d04-b558-4727-8e1f-1ac6b38dc7a4", "metadata": { "tags": [] }, "outputs": [], "source": [ "provisioning_artifact_id" ] }, { "cell_type": "code", "execution_count": null, "id": "8ae543a2-a20e-40e2-b251-c87462be9507", "metadata": { "tags": [] }, "outputs": [], "source": [ "project_name = f\"model-deploy-{strftime('%-m-%d-%H-%M-%S', gmtime())}\"" ] }, { "cell_type": "code", "execution_count": null, "id": "7ee8a72b-53d3-461a-95d4-6af781d7ce44", "metadata": { "tags": [] }, "outputs": [], "source": [ "project_parameters = [\n", " {\n", " 'Key': 'SourceModelPackageGroupName',\n", " 'Value': model_package_group_name\n", " },\n", "]" ] }, { "cell_type": "markdown", "id": "d1fef1a7-0396-4501-85c6-18ad874cabb9", "metadata": {}, "source": [ "Finally, create a SageMaker project from the service catalog product template:" ] }, { "cell_type": "code", "execution_count": null, "id": "acf05f97-ad6a-4503-9e47-b220f257cb58", "metadata": { "tags": [] }, "outputs": [], "source": [ "# create SageMaker project\n", "r = sm.create_project(\n", " ProjectName=project_name,\n", " ProjectDescription=\"Model build project\",\n", " ServiceCatalogProvisioningDetails={\n", " 'ProductId': product_id,\n", " 'ProvisioningArtifactId': provisioning_artifact_id,\n", " 'ProvisioningParameters': project_parameters\n", " },\n", ")\n", "\n", "print(r)\n", "project_id = r[\"ProjectId\"]" ] }, { "cell_type": "markdown", "id": "1f2e65a3-0185-4b33-b8b4-f3db9689dab8", "metadata": {}, "source": [ "
💡 Wait until project creation is completed \n", "
" ] }, { "cell_type": "markdown", "id": "e9058fa5", "metadata": {}, "source": [ "\"Time" ] }, { "cell_type": "code", "execution_count": null, "id": "1a7537e2-e377-48d1-a246-0c5f1083d519", "metadata": { "tags": [] }, "outputs": [], "source": [ "while sm.describe_project(ProjectName=project_name)['ProjectStatus'] != 'CreateCompleted':\n", " sleep(10)\n", " print(\"Waiting for project creation completion\")\n", "\n", "print(f\"MLOps project {project_name} creation completed\")" ] }, { "cell_type": "markdown", "id": "f9981b62", "metadata": {}, "source": [ "\"Time" ] }, { "cell_type": "markdown", "id": "5d9545f6-e793-41be-ae2c-9223fe8f6fb8", "metadata": {}, "source": [ "### Option 2: Create a project in Studio\n", "
💡 Skip this section if you created a project programmatically " ] }, { "cell_type": "markdown", "id": "87d43237-6357-48ca-8e86-c3babc30011c", "metadata": {}, "source": [ "To create a project in Studio:\n", "\n", "1. In the Studio sidebar, choose the **Home** icon.\n", "2. Select **Deployments** from the menu, and then select **Projects**.\n", "3. Choose **Create project**.\n", " - The **Create project** tab opens displaying a list of available project templates.\n", "4. For **SageMaker project templates**, choose **SageMaker templates**. \n", "5. Choose **MLOps template for model deployment**\n", "6. Choose **Select project template**.\n", "\n", "![](img/create-mlops-project.png)\n", "\n", "![](img/create-mlops-project-deploy.png)\n", "\n", "The **Create project** tab changes to display **Project details**.\n", "Enter the following information:\n", "1. Project name. Note the name requirements\n", "2. Project description, optional\n", "3. Model package group name - enter your model package group name you used in the step 3 and 4 notebooks. It is `from-idea-to-prod-model-group` if you used the default one\n", "\n", "Optionally, add tags, which are key-value pairs that you can use to track your projects.\n", "\n", "![](img/project-details-deploy.png)\n", "\n", "Choose **Create project** and wait for the project to appear in the Projects list." ] }, { "cell_type": "markdown", "id": "fceddf72-4a24-447d-9718-d940a3b54252", "metadata": {}, "source": [ "## Working with MLOps project for model deployment\n", "The template provisions a CodeCommit repository with configuration files to specify the model deployment steps, AWS CloudFormation templates to define endpoints as infrastructure, and seed code for testing the endpoint.\n", "\n", "This template provides the following resources:\n", "\n", "1. An AWS CodeCommit repository that contains sample code that deploys models to endpoints in staging and production environments\n", "2. An AWS CodePipeline pipeline that has `source`, `build`, `deploy-to-staging`, and `deploy-to-production` steps. The `source` step points to the CodeCommit repository, and the `build` step gets the code from that repository and generates CloudFormation stacks to deploy. The `deploy-to-staging` and `deploy-to-production` steps deploy the CloudFormation stacks to their respective environments. There is a manual approval step between the staging and production build steps, so that a MLOps engineer must approve the model before it is deployed to production.\n", "3. An Amazon EventBridge rule to launch a CodePipeline pipeline execution when a model package version is approved or rejected.\n", "4. There is also a manual approval step after the placeholder unit tests. You can implement your own tests to replace the placeholders tests.\n", "\n", "The template also deploys an Amazon S3 bucket to store artifacts, including CodePipeline and CodeBuild artifacts, and any artifacts generated from the SageMaker pipeline runs.\n", "\n", "The following diagram shows the architecture.\n", "\n", "\n", "\n", "You don't need to implement any configuration changes for the project. The model deployment pipeline works out of the box.\n", "To start the model deployment pipeline, you must approve the model version in the model registry." ] }, { "cell_type": "markdown", "id": "64405ac3-aefa-4ba9-aa8a-f7fca4a78009", "metadata": {}, "source": [ "### Approve the model version\n", "Approving the model version causes the MLOps system to launch the model deployment process. First, the model deployment pipeline deploys the model version to staging.\n", "\n", "You can approve the model version either in Studio in the Model registry or do it programmatically in the notebook. Let's do it programatically." ] }, { "cell_type": "code", "execution_count": null, "id": "f13610b3-be77-4a2e-abe9-bc0d55acf082", "metadata": { "tags": [] }, "outputs": [], "source": [ "model_package_group_name" ] }, { "cell_type": "code", "execution_count": null, "id": "639e8925-5e0d-4911-a087-a026b3b1a21f", "metadata": { "tags": [] }, "outputs": [], "source": [ "# list all model packages and select the latest one\n", "model_packages = []\n", "\n", "for p in sm.get_paginator('list_model_packages').paginate(\n", " ModelPackageGroupName=model_package_group_name,\n", " SortBy=\"CreationTime\",\n", " SortOrder=\"Descending\",\n", " ):\n", " model_packages.extend(p[\"ModelPackageSummaryList\"])\n", "\n", "if len(model_packages) == 0:\n", " raise Exception(f\"No model package is found for {model_package_group_name} model package group\")\n", " \n", "latest_model_package_arn = model_packages[0][\"ModelPackageArn\"]\n", "print(latest_model_package_arn)" ] }, { "cell_type": "markdown", "id": "57e69876-c48e-441a-adb1-94f37f3c3cc5", "metadata": {}, "source": [ "The following statement sets the `ModelApprovalStatus` for the most recent model package in the model registry to `Approved`. The model package state change launches the EventBridge rule and the rule launches the CodePipeline CI/CD pipeline with model deployment." ] }, { "cell_type": "code", "execution_count": null, "id": "3ef387cb-c889-4e58-a52a-8c7def24836d", "metadata": { "tags": [] }, "outputs": [], "source": [ "model_package_update_response = sm.update_model_package(\n", " ModelPackageArn=latest_model_package_arn,\n", " ModelApprovalStatus=\"Approved\",\n", ")" ] }, { "cell_type": "markdown", "id": "ca217b12-d020-4eb3-820a-de6431f4e82d", "metadata": {}, "source": [ "### Deployment pipeline execution\n", "The model deployment CI/CD pipeline performs the following actions:\n", "1. Create a SageMaker endpoint with the name `-staging` in the current account\n", "2. Run the test script on the staging endpoint\n", "3. Wait until the test result is manually approved in [AWS CodePipeline console](https://console.aws.amazon.com/codesuite/codepipeline)\n", "4. Create a SageMaker endpoint with the name `-prod` in the current account" ] }, { "cell_type": "markdown", "id": "3956a712-c8d6-4093-b9d0-e3a5cce443d8", "metadata": {}, "source": [ "Wait about 10-15 minutes until the pipeline deploys the staging endpoint. You can see the status of the endpoint in **Home** > **Deployments** > **Endpoints**:\n", "\n", "![](img/endpoint-staging.png)\n", "\n", "After the endpoint status changed from `Creating` to `InService`, you can launch the model deployment process to the production stage by manually approving the **DeployStaging** stage of the CodePipeline pipeline." ] }, { "cell_type": "markdown", "id": "579140af-5441-47d9-bf54-da9a01b851e6", "metadata": {}, "source": [ "### Deploy the model version to production\n", "Let's construct the approval link. \n", "If you used the option 1 `boto3` to create an MLOps project, the `project_name` and `project_id` are set automatically. You can run the following code cell to print the values. If you followed the UX instructions to create a project, you must set the `project_name` manually." ] }, { "cell_type": "code", "execution_count": null, "id": "fa30c033-daa8-4ab5-899c-aed5f8f4d9af", "metadata": { "tags": [] }, "outputs": [], "source": [ "try:\n", " print(project_name)\n", " print(project_id)\n", "except NameError:\n", " print(\"++++++++++++++++++++++++++++++++++++++\")\n", " print(\"You must set the project_name manually\")\n", " print(\"++++++++++++++++++++++++++++++++++++++\")" ] }, { "cell_type": "code", "execution_count": null, "id": "e29598cf-3c99-440a-886f-6045605d7f97", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Set to the model deployment project name if you didn't use boto3-based deployment\n", "# project_name = \"\"\n", "\n", "# Get project id\n", "project_id = sm.describe_project(ProjectName=project_name)['ProjectId']\n", "\n", "# Construct the CodePipline pipeline name\n", "code_pipeline_name = f\"sagemaker-{project_name}-{project_id}-modeldeploy\"" ] }, { "cell_type": "code", "execution_count": null, "id": "a0d199ea-5ec0-441a-b58f-be85b9a4788b", "metadata": { "tags": [] }, "outputs": [], "source": [ "from IPython.core.display import display, HTML\n", "\n", "# Show the approval link\n", "display(\n", " HTML(\n", " 'Please approve the manual step in AWS CodePipeline'.format(\n", " code_pipeline_name, region)\n", " )\n", ")" ] }, { "cell_type": "markdown", "id": "e825c8b7-77e4-4929-9b73-396502f9d83a", "metadata": {}, "source": [ "Click on the link ^^^ above ^^^ to open the CodePipeline console with the pipeline execution workflow." ] }, { "cell_type": "markdown", "id": "a87e002e-e776-4c73-adcc-5ea79d937579", "metadata": {}, "source": [ "In the **DeployStaging stage**, choose **Review** on the **ApproveDeployment** step. In the **Review** dialog box, choose **Approve**.\n", "\n", "Approving the **DeployStaging** stage causes the deployment pipeline to deploy the model to production. To view the endpoint, choose the **Deployments** > **Endpoints** in **Home** in Studio." ] }, { "cell_type": "markdown", "id": "39494560-27a0-49af-92b9-1caafb7c34ae", "metadata": {}, "source": [ "After a successful completion of the CI/CD pipeline, you see two endpoints in status `InService` in **SageMaker resources** > **Endpoints**:\n", "\n", "![](img/endpoint-prod.png)\n", "\n", "You can also see that both endpoints, `staging` and `prod`, are visible in the deployment project:\n", "\n", "![](img/project-endpoints.png)\n" ] }, { "cell_type": "markdown", "id": "477ace97-ba05-44bc-bc36-38df670fafb9", "metadata": {}, "source": [ "## Summary\n", "In this notebook you implemented an automated CI/CD deployment pipeline with the following features:\n", "- use CloudFormation IaC templates for SageMaker real-time inference endpoint deployment\n", "- model approval in the model registry launches the model deployment pipeline\n", "- model deployment pipeline contains two stages, staging and production with automated tests for the staging endpoint and manual approval for the production deployment" ] }, { "cell_type": "markdown", "id": "51023094-905a-4dc3-ae36-f8fb20ec3330", "metadata": {}, "source": [ "## Continue with the step 6\n", "open the step 6 [notebook](06-monitoring.ipynb)." ] }, { "cell_type": "markdown", "id": "c9b9d484-5022-4816-8a1b-89e27ffadc66", "metadata": {}, "source": [ "## Further development ideas for your real-world projects\n", "- Add end-to-end data encryption using AWS KMS keys\n", "- Create a [custom SageMaker project template](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-templates-custom.html) for model deployment to cover your specific project requirements\n", "- Add [multi-account model deployment](https://aws.amazon.com/blogs/machine-learning/multi-account-model-deployment-with-amazon-sagemaker-pipelines/) to your ML workflow\n", "- Add automated model tests to the placeholder in the CodePipeline pipeline\n", "- Use [Amazon SageMaker Inference Recommender](https://docs.aws.amazon.com/sagemaker/latest/dg/inference-recommender.html) to run automated load tests for your inference endpoints and to select the best instance type and configuration" ] }, { "cell_type": "markdown", "id": "cbed7d41-921d-4174-a177-33c3acc95049", "metadata": {}, "source": [ "## Additional resources\n", "- [Deploy a Machine Learning Model to a Real-Time Inference Endpoint](https://aws.amazon.com/getting-started/hands-on/machine-learning-tutorial-deploy-model-to-real-time-inference-endpoint/)\n", "- [SageMaker MLOps Project Walkthrough](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-walkthrough.html)\n", "- [Amazon SageMaker Pipelines lab in SageMaker Immersion Day](https://catalog.us-east-1.prod.workshops.aws/workshops/63069e26-921c-4ce1-9cc7-dd882ff62575/en-US/lab6)\n", "- [Amazon SageMaker secure MLOps](https://github.com/aws-samples/amazon-sagemaker-secure-mlops)\n", "- [Testing approaches for Amazon SageMaker ML models](https://aws.amazon.com/blogs/machine-learning/testing-approaches-for-amazon-sagemaker-ml-models/)\n", "- [Model hosting patterns in Amazon SageMaker blog series](https://aws.amazon.com/blogs/machine-learning/model-hosting-patterns-in-amazon-sagemaker-part-1-common-design-patterns-for-building-ml-applications-on-amazon-sagemaker/)\n", "- [Take advantage of advanced deployment strategies using Amazon SageMaker deployment guardrails](https://aws.amazon.com/blogs/machine-learning/take-advantage-of-advanced-deployment-strategies-using-amazon-sagemaker-deployment-guardrails/)\n", "- [MLOps deployment best practices for real-time inference model serving endpoints with Amazon SageMaker](https://aws.amazon.com/blogs/machine-learning/mlops-deployment-best-practices-for-real-time-inference-model-serving-endpoints-with-amazon-sagemaker/)" ] }, { "cell_type": "markdown", "id": "ca846f6c-3645-493a-a923-7457b2e32a5f", "metadata": {}, "source": [ "# Shutdown kernel" ] }, { "cell_type": "code", "execution_count": null, "id": "f60e56c7-b568-4208-818c-42634870f690", "metadata": {}, "outputs": [], "source": [ "%%html\n", "\n", "

Shutting down your kernel for this notebook to release resources.

\n", "\n", " \n", "" ] }, { "cell_type": "code", "execution_count": null, "id": "2d861de3-ee5a-4c3d-8b8f-04c2523547e4", "metadata": {}, "outputs": [], "source": [] } ], "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", "language": "python", "name": "python3" }, "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.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }