Skip to content

Commit

Permalink
Adding Phi-3-medium TPU configs to Colab deployment notebook
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 687337803
  • Loading branch information
vertex-mg-bot authored and copybara-github committed Oct 18, 2024
1 parent fb1871d commit 9b3bf0b
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@
"# @markdown This section uploads prebuilt Phi-3 models to Model Registry and deploys it to a Vertex AI Endpoint. It takes 15 minutes to 1 hour to finish depending on the size of the model.\n",
"\n",
"# @markdown Select one of the four model variations.\n",
"MODEL_ID = \"Phi-3-mini-4k-instruct\" # @param [\"Phi-3-mini-4k-instruct\", \"Phi-3-mini-128k-instruct\"] {isTemplate: true}\n",
"MODEL_ID = \"Phi-3-mini-4k-instruct\" # @param [\"Phi-3-mini-4k-instruct\", \"Phi-3-mini-128k-instruct\", \"Phi-3-medium-4k-instruct\", \"Phi-3-medium-128k-instruct\"] {isTemplate: true}\n",
"TPU_DEPLOYMENT_REGION = \"us-west1\" # @param [\"us-west1\"] {isTemplate:true}\n",
"model_id = os.path.join(MODEL_BUCKET, MODEL_ID)\n",
"hf_model_id = \"microsoft/\" + MODEL_ID\n",
Expand All @@ -564,8 +564,10 @@
"\n",
"# @markdown | Model Version | Default Max Model Length | Default TPU configuration |\n",
"# @markdown |----------------------------|------------------|-----------------------------|\n",
"# @markdown | Phi-3-mini-4k-instruct | 4096 | 1 TPU_V5e ct5lp-hightpu-1t |\n",
"# @markdown | Phi-3-mini-4k-instruct | 4096 | 1 TPU_V5e ct5lp-hightpu-1t |\n",
"# @markdown | Phi-3-mini-128k-instruct | 131072 | 4 TPU_V5e ct5lp-hightpu-4t |\n",
"# @markdown | Phi-3-medium-4k-instruct | 4096 | 4 TPU_V5e ct5lp-hightpu-4t |\n",
"# @markdown | Phi-3-medium-128k-instruct | 131072 | 4 TPU_V5e ct5lp-hightpu-4t |\n",
"\n",
"\n",
"# Note: 1 TPU V5 chip has only one core.\n",
Expand All @@ -576,7 +578,12 @@
" tpu_topo = \"1x4\"\n",
" max_model_len = 4096\n",
" machine_type = \"ct5lp-hightpu-1t\"\n",
"elif \"mini-128k\" in MODEL_ID:\n",
"elif \"medium-4k\" in MODEL_ID:\n",
" tpu_count = 4\n",
" tpu_topo = \"4x4\"\n",
" max_model_len = 4096\n",
" machine_type = \"ct5lp-hightpu-4t\"\n",
"elif \"mini-128k\" or \"medium-128k\" in MODEL_ID:\n",
" tpu_count = 4\n",
" max_model_len = 131072\n",
" tpu_topo = \"4x4\"\n",
Expand Down

0 comments on commit 9b3bf0b

Please sign in to comment.