{ "cells": [ { "cell_type": "markdown", "id": "cd832b54-dae8-464f-9287-498c71195038", "metadata": {}, "source": [ "### 1. 安装HuggingFace 并下载模型到本地" ] }, { "cell_type": "code", "execution_count": null, "id": "02785614-9268-41c8-85a5-d579490edbbf", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip install huggingface-hub -Uqq" ] }, { "cell_type": "code", "execution_count": null, "id": "9e6bd7ee-16a3-4f5a-8857-8bbba83eb9e7", "metadata": { "tags": [] }, "outputs": [], "source": [ "from huggingface_hub import snapshot_download\n", "from pathlib import Path\n", "\n", "local_model_path = Path(\"./Buffer_instruct_baichuan_001_model\")\n", "local_model_path.mkdir(exist_ok=True)\n", "model_name = \"csdc-atl/buffer-instruct-baichuan-001\"\n", "commit_hash = \"a0a840f0fb9bc0ce43ca5cb03cd6383412883774\"" ] }, { "cell_type": "code", "execution_count": null, "id": "94e8abc5-a58e-40e2-b1e6-fbf48307c716", "metadata": { "tags": [] }, "outputs": [], "source": [ "snapshot_download(repo_id=model_name, revision=commit_hash, cache_dir=local_model_path)" ] }, { "cell_type": "markdown", "id": "c655e66d-363c-4d88-a02f-ff18aa65e73e", "metadata": {}, "source": [ "### 2. 把模型拷贝到S3为后续部署做准备" ] }, { "cell_type": "code", "execution_count": null, "id": "e9431deb-6359-442d-847b-1563f8dd3854", "metadata": { "tags": [] }, "outputs": [], "source": [ "import sagemaker\n", "from sagemaker import image_uris\n", "import boto3\n", "import os\n", "import time\n", "import json\n", "\n", "role = sagemaker.get_execution_role() # execution role for the endpoint\n", "sess = sagemaker.session.Session() # sagemaker session for interacting with different AWS APIs\n", "bucket = sess.default_bucket() # bucket to house artifacts\n", "\n", "region = sess._region_name\n", "account_id = sess.account_id()\n", "\n", "s3_client = boto3.client(\"s3\")\n", "sm_client = boto3.client(\"sagemaker\")\n", "smr_client = boto3.client(\"sagemaker-runtime\")" ] }, { "cell_type": "code", "execution_count": null, "id": "40dd8f16-ae7c-48bf-8e52-1a15425fa74d", "metadata": { "tags": [] }, "outputs": [], "source": [ "s3_model_prefix = \"LLM-RAG/workshop/Buffer_instruct_baichuan_001_model\" # folder where model checkpoint will go\n", "model_snapshot_path = list(local_model_path.glob(\"**/snapshots/*\"))[0]\n", "s3_code_prefix = \"LLM-RAG/workshop/Buffer_instruct_deploy_code\"\n", "print(f\"s3_code_prefix: {s3_code_prefix}\")\n", "print(f\"model_snapshot_path: {model_snapshot_path}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "067292c9-c066-4649-a61f-b460a24da584", "metadata": { "tags": [] }, "outputs": [], "source": [ "!aws s3 cp --recursive {model_snapshot_path} s3://{bucket}/{s3_model_prefix}" ] }, { "cell_type": "markdown", "id": "dfb09c57-2a65-4de8-b9df-3d97de86b00a", "metadata": {}, "source": [ "### 3. 模型部署准备(entrypoint脚本,容器镜像,服务配置)" ] }, { "cell_type": "code", "execution_count": null, "id": "6f7c4277-4480-42c6-aee6-1fbcca94eb82", "metadata": { "tags": [] }, "outputs": [], "source": [ "inference_image_uri = (\n", " f\"763104351884.dkr.ecr.{region}.amazonaws.com/djl-inference:0.21.0-deepspeed0.8.3-cu117\"\n", ")\n", "\n", "#中国区需要替换为下面的image_uri\n", "# inference_image_uri = (\n", "# f\"727897471807.dkr.ecr.{region}.amazonaws.com.cn/djl-inference:0.21.0-deepspeed0.8.3-cu117\"\n", "# )\n", "\n", "print(f\"Image going to be used is ---- > {inference_image_uri}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "8d771bdb-11d2-45d2-9bef-face29221838", "metadata": { "tags": [] }, "outputs": [], "source": [ "!mkdir -p Buffer_instruct_deploy_code" ] }, { "cell_type": "code", "execution_count": null, "id": "e5348ecb-43df-4094-97d8-a6723004862a", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%writefile Buffer_instruct_deploy_code/model.py\n", "from djl_python import Input, Output\n", "import torch\n", "import logging\n", "import math\n", "import os\n", "from transformers import AutoTokenizer, AutoModelForCausalLM\n", "\n", "\n", "def load_model(properties):\n", " tensor_parallel = properties[\"tensor_parallel_degree\"]\n", " model_location = properties['model_dir']\n", " if \"model_id\" in properties:\n", " model_location = properties['model_id']\n", " logging.info(f\"Loading model in {model_location}\")\n", " \n", " tokenizer = AutoTokenizer.from_pretrained(model_location, trust_remote_code=True)\n", " model = AutoModelForCausalLM.from_pretrained(model_location, trust_remote_code=True)\n", " model = model.eval().half().cuda()\n", " \n", " return model, tokenizer\n", "\n", "\n", "model = None\n", "tokenizer = None\n", "generator = None\n", "\n", "\n", "def handle(inputs: Input):\n", " global model, tokenizer\n", " if not model:\n", " model, tokenizer = load_model(inputs.get_properties())\n", "\n", " if inputs.is_empty():\n", " return None\n", " data = inputs.get_as_json()\n", " \n", " prompt = data[\"inputs\"]\n", " params = data[\"parameters\"]\n", " history = data[\"history\"]\n", "\n", " response, history = model.chat(tokenizer, prompt, history=history, **params)\n", " \n", " result = {\"outputs\": response, \"history\" : history}\n", " return Output().add_as_json(result)" ] }, { "cell_type": "code", "execution_count": null, "id": "6d041fb8-5b99-4ad7-8a42-fdd2456e66b0", "metadata": { "tags": [] }, "outputs": [], "source": [ "print(f\"option.s3url ==> s3://{bucket}/{s3_model_prefix}/\")" ] }, { "cell_type": "markdown", "id": "4361c8df-1ea7-4a65-a08a-22ece6de66c3", "metadata": {}, "source": [ "#### Note: option.s3url 需要按照自己的账号进行修改, 可以拷贝上一个cell的输出" ] }, { "cell_type": "markdown", "id": "9c10eb2b-df81-400f-aacb-96897ab6bae0", "metadata": {}, "source": [ "#### 注意: 必须把transformers升级到4.28.1以上,否则会出现有些module找不到的问题(```from transformers.models.llama.configuration_llama import LlamaConfig```)\n", "\n", "如果是中国区建议添加国内的pip镜像,如下代码所示\n", "```\n", "%%writefile Buffer_instruct_deploy_code/requirements.txt\n", "-i https://pypi.tuna.tsinghua.edu.cn/simple\n", "transformers==4.28.1\n", "```" ] }, { "cell_type": "code", "execution_count": null, "id": "dc8a0816-1807-42b2-9a7d-8b46d2bc4aeb", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%writefile Buffer_instruct_deploy_code/requirements.txt\n", "transformers==4.28.1" ] }, { "cell_type": "code", "execution_count": null, "id": "8996fe44-8e70-468b-abc1-38187cb33f4f", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%writefile Buffer_instruct_deploy_code/serving.properties\n", "engine=Python\n", "option.tensor_parallel_degree=1\n", "option.s3url = s3://sagemaker-us-west-2-106839800180/LLM-RAG/workshop/Buffer_instruct_baichuan_001_model/" ] }, { "cell_type": "code", "execution_count": null, "id": "0ae6734a-aacd-410d-818d-0a962697c3c4", "metadata": { "tags": [] }, "outputs": [], "source": [ "!rm model.tar.gz\n", "!tar czvf model.tar.gz Buffer_instruct_deploy_code" ] }, { "cell_type": "code", "execution_count": null, "id": "0f77dc76-6d8c-4665-ba88-f03e887c136c", "metadata": { "tags": [] }, "outputs": [], "source": [ "s3_code_artifact = sess.upload_data(\"model.tar.gz\", bucket, s3_code_prefix)\n", "print(f\"S3 Code or Model tar ball uploaded to --- > {s3_code_artifact}\")" ] }, { "cell_type": "markdown", "id": "c91d28e0-fa3e-48fa-9572-6abc02dd1c9d", "metadata": {}, "source": [ "### 4. 创建模型 & 创建endpoint" ] }, { "cell_type": "code", "execution_count": null, "id": "ef974ca1-9638-45a8-9145-ea9d03b2b072", "metadata": { "tags": [] }, "outputs": [], "source": [ "from sagemaker.utils import name_from_base\n", "import boto3\n", "\n", "model_name = name_from_base(f\"buffer-instruct-baichuan-001\") # Append a timestamp to the provided string\n", "print(model_name)\n", "print(f\"Image going to be used is ---- > {inference_image_uri}\")\n", "\n", "create_model_response = sm_client.create_model(\n", " ModelName=model_name,\n", " ExecutionRoleArn=role,\n", " PrimaryContainer={\n", " \"Image\": inference_image_uri,\n", " \"ModelDataUrl\": s3_code_artifact\n", " },\n", " \n", ")\n", "model_arn = create_model_response[\"ModelArn\"]\n", "\n", "print(f\"Created Model: {model_arn}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "233bb3a4-d737-41ad-8fcc-7082c6278e8c", "metadata": { "tags": [] }, "outputs": [], "source": [ "endpoint_config_name = f\"{model_name}-config\"\n", "endpoint_name = f\"{model_name}-endpoint\"\n", "\n", "endpoint_config_response = sm_client.create_endpoint_config(\n", " EndpointConfigName=endpoint_config_name,\n", " ProductionVariants=[\n", " {\n", " \"VariantName\": \"variant1\",\n", " \"ModelName\": model_name,\n", " \"InstanceType\": \"ml.g5.4xlarge\",\n", " \"InitialInstanceCount\": 1,\n", " # \"VolumeSizeInGB\" : 400,\n", " # \"ModelDataDownloadTimeoutInSeconds\": 2400,\n", " \"ContainerStartupHealthCheckTimeoutInSeconds\": 15*60,\n", " },\n", " ],\n", ")\n", "endpoint_config_response" ] }, { "cell_type": "code", "execution_count": null, "id": "734a39b0-473e-4421-94c8-74d2b4105038", "metadata": { "tags": [] }, "outputs": [], "source": [ "create_endpoint_response = sm_client.create_endpoint(\n", " EndpointName=f\"{endpoint_name}\", EndpointConfigName=endpoint_config_name\n", ")\n", "print(f\"Created Endpoint: {create_endpoint_response['EndpointArn']}\")" ] }, { "cell_type": "markdown", "id": "771c7c4c-541a-49c4-8c4d-0ea79fa5969e", "metadata": {}, "source": [ "#### 持续检测模型部署进度" ] }, { "cell_type": "code", "execution_count": null, "id": "08969928-6b9e-4d9c-a033-a31f5f77bdfb", "metadata": { "tags": [] }, "outputs": [], "source": [ "import time\n", "\n", "resp = sm_client.describe_endpoint(EndpointName=endpoint_name)\n", "status = resp[\"EndpointStatus\"]\n", "print(\"Status: \" + status)\n", "\n", "while status == \"Creating\":\n", " time.sleep(60)\n", " resp = sm_client.describe_endpoint(EndpointName=endpoint_name)\n", " status = resp[\"EndpointStatus\"]\n", " print(\"Status: \" + status)\n", "\n", "print(\"Arn: \" + resp[\"EndpointArn\"])\n", "print(\"Status: \" + status)" ] }, { "cell_type": "markdown", "id": "c7a6aaf4-1237-4631-a602-c8082969e2a9", "metadata": {}, "source": [ "### 5. 模型测试" ] }, { "cell_type": "code", "execution_count": null, "id": "e56bfdaa-3469-4784-aa8a-e32177cde3f2", "metadata": { "tags": [] }, "outputs": [], "source": [ "%%time\n", "import json\n", "import boto3\n", "\n", "smr_client = boto3.client(\"sagemaker-runtime\")\n", "\n", "parameters = {\n", "\n", "}" ] }, { "cell_type": "code", "execution_count": null, "id": "bd86caf8-01e9-41eb-9199-478ba471a02b", "metadata": { "tags": [] }, "outputs": [], "source": [ "question1 = \"请问AWS Clean Rooms是多方都会收费吗?\"\n", "context1 = \"Q: 是否发起者和数据贡献者都会被收费?\\nA: 是单方收费,只有查询的接收方会收费\"\n", "prompts_template = \"\"\"{system_role_prompt},以下context内的文本内容为背景知识:\\n\\n{context}\\n\\n请根据背景知识, 回答这个问题:{question}\"\"\"\n", "prompt = prompts_template.format(system_role_prompt=\"你是云服务AWS的智能客服机器人AWSBot\", context=context1, question=question1)\n", "\n", "response_model = smr_client.invoke_endpoint(\n", " EndpointName=endpoint_name,\n", " Body=json.dumps(\n", " {\n", " \"inputs\": prompt,\n", " \"parameters\": parameters,\n", " 'context': '',\n", " 'existing_answer': '',\n", " 'history':[]\n", " }\n", " ),\n", " ContentType=\"application/json\",\n", " )\n", "\n", "response_model['Body'].read().decode('utf8')" ] }, { "cell_type": "code", "execution_count": null, "id": "f70d116f-4fb1-4f04-8732-3d6e4fb520de", "metadata": { "tags": [] }, "outputs": [], "source": [ "!aws sagemaker delete-endpoint --endpoint-name buffer-instruct-baichuan-001-2023-07-20-05-11-49-585-endpoint" ] }, { "cell_type": "code", "execution_count": null, "id": "184e4d1d-3d62-43df-9b17-5d64ece928bd", "metadata": { "tags": [] }, "outputs": [], "source": [ "!aws sagemaker delete-endpoint-config --endpoint-config-name buffer-instruct-baichuan-001-2023-07-20-05-11-49-585-config" ] }, { "cell_type": "code", "execution_count": null, "id": "adcad31f-da69-4474-9e5f-a4004b17deb1", "metadata": { "tags": [] }, "outputs": [], "source": [ "!aws sagemaker delete-model --model-name buffer-instruct-baichuan-001-2023-07-20-05-11-49-585" ] }, { "cell_type": "code", "execution_count": null, "id": "d2851a2e-e280-4090-84af-5a78ae516a1d", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "availableInstances": [ { "_defaultOrder": 0, "_isFastLaunch": true, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 4, "name": "ml.t3.medium", "vcpuNum": 2 }, { "_defaultOrder": 1, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 8, "name": "ml.t3.large", "vcpuNum": 2 }, { "_defaultOrder": 2, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.t3.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 3, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.t3.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 4, "_isFastLaunch": true, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 8, "name": "ml.m5.large", "vcpuNum": 2 }, { "_defaultOrder": 5, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.m5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 6, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.m5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 7, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 64, "name": "ml.m5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 8, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 128, "name": "ml.m5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 9, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 192, "name": "ml.m5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 10, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 256, "name": "ml.m5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 11, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 384, "name": "ml.m5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 12, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 8, "name": "ml.m5d.large", "vcpuNum": 2 }, { "_defaultOrder": 13, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.m5d.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 14, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.m5d.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 15, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 64, "name": "ml.m5d.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 16, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 128, "name": "ml.m5d.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 17, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 192, "name": "ml.m5d.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 18, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 256, "name": "ml.m5d.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 19, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 384, "name": "ml.m5d.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 20, "_isFastLaunch": false, "category": "General purpose", "gpuNum": 0, "hideHardwareSpecs": true, "memoryGiB": 0, "name": "ml.geospatial.interactive", "supportedImageNames": [ "sagemaker-geospatial-v1-0" ], "vcpuNum": 0 }, { "_defaultOrder": 21, "_isFastLaunch": true, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 4, "name": "ml.c5.large", "vcpuNum": 2 }, { "_defaultOrder": 22, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 8, "name": "ml.c5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 23, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.c5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 24, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.c5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 25, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 72, "name": "ml.c5.9xlarge", "vcpuNum": 36 }, { "_defaultOrder": 26, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 96, "name": "ml.c5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 27, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 144, "name": "ml.c5.18xlarge", "vcpuNum": 72 }, { "_defaultOrder": 28, "_isFastLaunch": false, "category": "Compute optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 192, "name": "ml.c5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 29, "_isFastLaunch": true, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.g4dn.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 30, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.g4dn.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 31, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 64, "name": "ml.g4dn.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 32, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 128, "name": "ml.g4dn.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 33, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "hideHardwareSpecs": false, "memoryGiB": 192, "name": "ml.g4dn.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 34, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 256, "name": "ml.g4dn.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 35, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 61, "name": "ml.p3.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 36, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "hideHardwareSpecs": false, "memoryGiB": 244, "name": "ml.p3.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 37, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "hideHardwareSpecs": false, "memoryGiB": 488, "name": "ml.p3.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 38, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "hideHardwareSpecs": false, "memoryGiB": 768, "name": "ml.p3dn.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 39, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.r5.large", "vcpuNum": 2 }, { "_defaultOrder": 40, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.r5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 41, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 64, "name": "ml.r5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 42, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 128, "name": "ml.r5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 43, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 256, "name": "ml.r5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 44, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 384, "name": "ml.r5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 45, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 512, "name": "ml.r5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 46, "_isFastLaunch": false, "category": "Memory Optimized", "gpuNum": 0, "hideHardwareSpecs": false, "memoryGiB": 768, "name": "ml.r5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 47, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 16, "name": "ml.g5.xlarge", "vcpuNum": 4 }, { "_defaultOrder": 48, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 32, "name": "ml.g5.2xlarge", "vcpuNum": 8 }, { "_defaultOrder": 49, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 64, "name": "ml.g5.4xlarge", "vcpuNum": 16 }, { "_defaultOrder": 50, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 128, "name": "ml.g5.8xlarge", "vcpuNum": 32 }, { "_defaultOrder": 51, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 1, "hideHardwareSpecs": false, "memoryGiB": 256, "name": "ml.g5.16xlarge", "vcpuNum": 64 }, { "_defaultOrder": 52, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "hideHardwareSpecs": false, "memoryGiB": 192, "name": "ml.g5.12xlarge", "vcpuNum": 48 }, { "_defaultOrder": 53, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 4, "hideHardwareSpecs": false, "memoryGiB": 384, "name": "ml.g5.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 54, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "hideHardwareSpecs": false, "memoryGiB": 768, "name": "ml.g5.48xlarge", "vcpuNum": 192 }, { "_defaultOrder": 55, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "hideHardwareSpecs": false, "memoryGiB": 1152, "name": "ml.p4d.24xlarge", "vcpuNum": 96 }, { "_defaultOrder": 56, "_isFastLaunch": false, "category": "Accelerated computing", "gpuNum": 8, "hideHardwareSpecs": false, "memoryGiB": 1152, "name": "ml.p4de.24xlarge", "vcpuNum": 96 } ], "instance_type": "ml.t3.medium", "kernelspec": { "display_name": "Python 3 (Data Science 3.0)", "language": "python", "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706: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": 5 }