{ "cells": [ { "cell_type": "markdown", "id": "2150cda8", "metadata": {}, "source": [ "## CatBoost XGBoost Script Mode Training and Serving \n", "\n", "This is a sample Python program that trains a simple CatBoost model and a XGBoost model using SageMaker XGBoost Docker image, and then performs inference. This implementation will work on your *local computer* or in the *AWS Cloud*.\n", "\n", "#### Prerequisites:\n", "If you are going to run the code locally, making sure you follow the below prerequisites. Otherwise, if you are running the notebook on SageMaker Studio or notebook instance, you can just follow the code cells to create resources in the cloud.\n", "\n", "1. Install required Python packages:\n", " `pip install -r requirements.txt`\n", "2. Docker Desktop installed and running on your computer:\n", " `docker ps`\n", "3. You should have AWS credentials configured on your local machine in order to be able to pull the docker image from ECR.\n", "\n", "In this notebook, we will provide options to just the training job or hyperparameter tuning job that will launch mulitple training jobs to find the optimal hyperparameters of the model. We will also provide options to deploy the trained model to a real-time endpoint (section of the code has been commented out, you can uncomment the code to deploy to a real-time endpoint). Also provide the code to deploy the code to a serverless endpoint to save cost during experimentation stage. Read the instructions to uncomment necessary section of code to experiment with different options provided by the SageMaker service." ] }, { "cell_type": "code", "execution_count": null, "id": "4ba63d23", "metadata": { "tags": [] }, "outputs": [], "source": [ "import os\n", "import sagemaker\n", "import pandas as pd\n", "from sagemaker.predictor import csv_serializer\n", "# from sagemaker.xgboost import XGBoost\n", "from sagemaker.sklearn.estimator import SKLearn\n", "from sklearn.datasets import load_diabetes\n", "from sklearn.model_selection import train_test_split" ] }, { "cell_type": "code", "execution_count": null, "id": "d79ad448", "metadata": { "tags": [] }, "outputs": [], "source": [ "sess = sagemaker.Session()\n", "bucket = sess.default_bucket()\n", "role = sagemaker.get_execution_role()\n", "\n", " \n", "prefix = \"xgboost_catboost\"" ] }, { "cell_type": "markdown", "id": "5c02c793", "metadata": {}, "source": [ "## Downloading Data\n", "Download training and eval data" ] }, { "cell_type": "code", "execution_count": null, "id": "07740d31", "metadata": { "tags": [] }, "outputs": [], "source": [ "local_train = './data/train/diabetes_train.csv'\n", "local_validation = './data/validation/diabetes_validation.csv'\n", "local_test = './data/test/diabetes_test.csv'" ] }, { "cell_type": "code", "execution_count": null, "id": "206974b6", "metadata": { "tags": [] }, "outputs": [], "source": [ "if os.path.isfile('./data/train/diabetes_train.csv') and \\\n", " os.path.isfile('./data/validation/diabetes_validation.csv') and \\\n", " os.path.isfile('./data/test/diabetes_test.csv'):\n", " print('Training dataset exist. Skipping Download')\n", "else:\n", " print('Downloading training dataset')\n", "\n", " os.makedirs(\"./data\", exist_ok=True)\n", " os.makedirs(\"./data/train\", exist_ok=True)\n", " os.makedirs(\"./data/validation\", exist_ok=True)\n", " os.makedirs(\"./data/test\", exist_ok=True)\n", "\n", " data = load_diabetes()\n", "\n", " X_train, X_test, y_train, y_test = train_test_split(data.data, data.target, test_size=0.25, random_state=45)\n", " X_val, X_test, y_val, y_test = train_test_split(X_test, y_test, test_size=0.5, random_state=45)\n", "\n", " trainX = pd.DataFrame(X_train, columns=data.feature_names)\n", " trainX['target'] = y_train\n", "\n", " valX = pd.DataFrame(X_test, columns=data.feature_names)\n", " valX['target'] = y_test\n", "\n", " testX = pd.DataFrame(X_test, columns=data.feature_names)\n", "\n", " trainX.to_csv(local_train, header=None, index=False)\n", " valX.to_csv(local_validation, header=None, index=False)\n", " testX.to_csv(local_test, header=None, index=False)\n", "\n", " print('Downloading completed')" ] }, { "cell_type": "markdown", "id": "019ff41c", "metadata": {}, "source": [ "## Model Training\n", "Starting model training using **local mode**. Note: if launching for the first time in local mode, container image download might take a few minutes to complete. Regarding the S3 bucket: if not provided, a default bucket will be created by the SageMaker session based on the following format: “sagemaker-{region}-{aws-account-id}”. For high-level security needs, you can configure a bucket policy that restricts the AWS roles that have access to this default SageMaker S3 bucket." ] }, { "cell_type": "code", "execution_count": null, "id": "75eb918c", "metadata": { "tags": [] }, "outputs": [], "source": [ "training_instance_type = \"ml.m5.xlarge\"\n", "train_location = sess.upload_data(\n", " local_train, key_prefix=\"{}/data/{}\".format(prefix, \"train\")\n", ")\n", "validation_location = sess.upload_data(\n", " local_validation, key_prefix=\"{}/data/{}\".format(prefix, \"validation\")\n", ")\n", " " ] }, { "cell_type": "code", "execution_count": null, "id": "8b693db6", "metadata": { "tags": [] }, "outputs": [], "source": [ "train_location, validation_location" ] }, { "cell_type": "code", "execution_count": null, "id": "32b6a246", "metadata": { "tags": [] }, "outputs": [], "source": [ "hyperparameters = {\"num_round\": 6, \"max_depth\": 5}\n", "\n", "estimator_parameters = {\n", " \"entry_point\": \"multi_model_hpo.py\",\n", " \"source_dir\": \"code\",\n", " \"dependencies\": [\"my_custom_library\"],\n", " \"instance_type\": training_instance_type,\n", " \"instance_count\": 1,\n", " \"hyperparameters\": hyperparameters,\n", " \"role\": role,\n", " \"base_job_name\": \"xgboost-catboost-model\",\n", " \"framework_version\": \"1.0-1\",\n", " \"metric_definitions\":[\n", " {'Name': 'validation:rmse', 'Regex': 'validation-rmse:(.*?);'}\n", " ]\n", "} \n", " \n", "\n", "estimator = SKLearn(**estimator_parameters)" ] }, { "cell_type": "markdown", "id": "712d4f10", "metadata": {}, "source": [ "If you only want to train the model once and not use hyperparameter optimization, un-comment the next cell" ] }, { "cell_type": "code", "execution_count": null, "id": "2986d586", "metadata": { "scrolled": true, "tags": [] }, "outputs": [], "source": [ "# estimator.fit({'train': train_location, 'validation': validation_location})\n", "# print('Completed model training')" ] }, { "cell_type": "markdown", "id": "d6aa728f", "metadata": {}, "source": [ "In the following cells, we will define a Hyperparameter Optimization job." ] }, { "cell_type": "code", "execution_count": null, "id": "25874070", "metadata": { "tags": [] }, "outputs": [], "source": [ "from sagemaker.tuner import (\n", " IntegerParameter,\n", " CategoricalParameter,\n", " ContinuousParameter,\n", " HyperparameterTuner,\n", ")\n", "\n", "hyperparameter_ranges = {\n", " \"eta\": ContinuousParameter(0.2, 0.3),\n", " \"max_depth\": IntegerParameter(3, 4)\n", "}\n", "metric_definitions = [{\"Name\": \"validation:rmse\", \"Regex\": \"validation-rmse:([0-9\\\\.]+)\"}]\n", "objective_metric_name = \"validation:rmse\"" ] }, { "cell_type": "code", "execution_count": null, "id": "0fbead8d", "metadata": { "tags": [] }, "outputs": [], "source": [ "tuner = HyperparameterTuner(\n", " estimator, \n", " objective_metric_name,\n", " hyperparameter_ranges, \n", " metric_definitions,\n", " max_jobs=4, \n", " max_parallel_jobs=2, \n", " objective_type='Minimize'\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "a05fa748", "metadata": { "tags": [] }, "outputs": [], "source": [ "tuner.fit({\"train\": train_location, \"validation\": validation_location}, include_cls_metadata=False)\n" ] }, { "cell_type": "markdown", "id": "45620407", "metadata": {}, "source": [ "Get the best training job's values" ] }, { "cell_type": "code", "execution_count": null, "id": "f3179138", "metadata": { "tags": [] }, "outputs": [], "source": [ "job_name=tuner.latest_tuning_job.name\n", "attached_tuner = HyperparameterTuner.attach(job_name)" ] }, { "cell_type": "code", "execution_count": null, "id": "2e3f41cb", "metadata": { "tags": [] }, "outputs": [], "source": [ "attached_tuner.describe()[\"BestTrainingJob\"]" ] }, { "cell_type": "markdown", "id": "5a4c1a30", "metadata": {}, "source": [ "# Deployment options" ] }, { "cell_type": "markdown", "id": "306dad3c", "metadata": {}, "source": [ "## Deploy best model to real time endpoint\n", "Parameters for launching an m5.xlarge instance and deploy best model from HPO job" ] }, { "cell_type": "code", "execution_count": null, "id": "5b591729", "metadata": {}, "outputs": [], "source": [ "# predictor_params = {\n", "# \"endpoint_name\": \"xgboost-catboost-ensemble\",\n", "# \"entry_point\": \"multi_model_hpo.py\",\n", "# \"dependencies\": [\"my_custom_library\"],\n", "# \"source_dir\": \"code\",\n", "# \"initial_instance_count\": 1,\n", "# \"instance_type\": \"ml.m5.xlarge\"\n", "# }" ] }, { "cell_type": "code", "execution_count": null, "id": "7507afa5", "metadata": {}, "outputs": [], "source": [ "# predictor = attached_tuner.deploy(**predictor_params)" ] }, { "cell_type": "markdown", "id": "e9b00c6d", "metadata": {}, "source": [ "## Deploy best model to a serverless endpoint\n", "Parameters for deploying best model from HPO job as a serverless endpoint" ] }, { "cell_type": "code", "execution_count": null, "id": "4129c732", "metadata": { "tags": [] }, "outputs": [], "source": [ "from sagemaker.serverless.serverless_inference_config import ServerlessInferenceConfig\n", "\n", "serverless_config = ServerlessInferenceConfig(\n", " memory_size_in_mb=6144,\n", " max_concurrency=1,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "ee3d9dbb", "metadata": { "scrolled": true, "tags": [] }, "outputs": [], "source": [ "estimator=attached_tuner.best_estimator()" ] }, { "cell_type": "code", "execution_count": null, "id": "3fc29958", "metadata": { "tags": [] }, "outputs": [], "source": [ "predictor = estimator.deploy(serverless_inference_config=serverless_config)" ] }, { "cell_type": "code", "execution_count": null, "id": "b6eb475a", "metadata": { "tags": [] }, "outputs": [], "source": [ "predictor.endpoint_context()" ] }, { "cell_type": "markdown", "id": "4e1f7b31", "metadata": {}, "source": [ "## Deploying a trained model \n", "If you are not using HPO, you can also deploy the trained model from the estimator object and perform invocation. \n", "If you want to deploy to a real time endpoint (as opposed to a serverless endpoint) uncomment the below cell. " ] }, { "cell_type": "code", "execution_count": null, "id": "fc3d912b", "metadata": {}, "outputs": [], "source": [ "# endpoint_name = \"xgboost-catboost-endpoint\"\n", "# predictor = estimator.deploy(\n", "# initial_instance_count=1, instance_type=\"ml.m5.xlarge\", endpoint_name=endpoint_name\n", "# )\n" ] }, { "cell_type": "markdown", "id": "cef75684", "metadata": {}, "source": [ "If you already have a model trained previously, you can use the model s3 uri in the model_data field and create a model object for deployment. No need to retrain the model using the estimator." ] }, { "cell_type": "code", "execution_count": null, "id": "c7fded11", "metadata": {}, "outputs": [], "source": [ "# from sagemaker.sklearn.model import SKLearnModel\n", "\n", "# inference_model = SKLearnModel(\n", "# model_data=model_data,\n", "# role=role,\n", "# entry_point=\"multi_model_hpo.py\",\n", "# framework_version=\"1.0-1\",\n", "# dependencies=[\"my_custom_library\"],\n", "# source_dir=\"code\",\n", "# )" ] }, { "cell_type": "markdown", "id": "a19c7bf9", "metadata": {}, "source": [ "The entry point script \"multi_model_hpo.py\" will handle the multiple models in the model artifacts and perform inference against each model. The results will be the mean of each inference output. This is a simple demonstration of how to work with multiple models, but you can design the model ensemble as you need." ] }, { "cell_type": "code", "execution_count": null, "id": "3965f12a", "metadata": {}, "outputs": [], "source": [ "# predictor = inference_model.deploy(\n", "# initial_instance_count=1,\n", "# instance_type=\"ml.m5.xlarge\",\n", "# )" ] }, { "cell_type": "markdown", "id": "6699eb19", "metadata": {}, "source": [ "# Invoke the model" ] }, { "cell_type": "code", "execution_count": null, "id": "e6b54f36", "metadata": { "tags": [] }, "outputs": [], "source": [ "\n", "from sagemaker.serializers import NumpySerializer, JSONSerializer, CSVSerializer\n", "from sagemaker.deserializers import NumpyDeserializer, JSONDeserializer\n", "predictor.serializer = CSVSerializer()\n", "predictor.deserializer = JSONDeserializer()\n" ] }, { "cell_type": "code", "execution_count": null, "id": "5b6d5c04", "metadata": { "tags": [] }, "outputs": [], "source": [ "with open(local_test, 'r') as f:\n", " payload = f.read().strip()\n", "\n", "predictions = predictor.predict(payload)\n", "print('predictions: {}'.format(predictions))" ] }, { "cell_type": "markdown", "id": "4b0810b4", "metadata": {}, "source": [ "## Clear up resources\n", "Delete the endpoint deployed." ] }, { "cell_type": "code", "execution_count": null, "id": "d8d28a0d", "metadata": {}, "outputs": [], "source": [ "# predictor.delete_endpoint(predictor.endpoint)" ] }, { "cell_type": "code", "execution_count": null, "id": "cdeb1849", "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": "conda_python3", "language": "python", "name": "conda_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.10.8" } }, "nbformat": 4, "nbformat_minor": 5 }