Skip to content

Commit

Permalink
update IMG_URI reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tottenjordan committed Sep 25, 2023
1 parent 4982e1a commit 0009283
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 49 deletions.
38 changes: 19 additions & 19 deletions 03b-build-retrieval-image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "aa9157c3-4189-4ca2-b210-874540cc85f5",
"metadata": {},
"outputs": [
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "a13c7445-9e33-4852-89be-6a5eb397dda4",
"metadata": {},
"outputs": [
Expand All @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "1dcebfde-8981-43aa-805b-0e8520fef5e6",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -128,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "b318b5d4-417a-483f-b9d1-2a1e071e16de",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -160,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "3f858913-b13c-4d5d-ba54-24c36b0365c0",
"metadata": {},
"outputs": [],
Expand All @@ -179,7 +179,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "d6f423c0-5bd5-401a-aa77-f14205ca9603",
"metadata": {},
"outputs": [
Expand All @@ -203,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 84,
"execution_count": 8,
"id": "99098cc3-982e-4e53-9ca5-5cc868cd376f",
"metadata": {},
"outputs": [
Expand All @@ -221,7 +221,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 11,
"id": "50dc7713-07f5-4fd5-8448-10b5fca82cd1",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -296,12 +296,12 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 12,
"id": "9ae3bd0d-efdc-4060-9ef5-0cf5ee947580",
"metadata": {},
"outputs": [],
"source": [
"! gcloud artifacts repositories create $REPOSITORY --repository-format=docker --location=$LOCATION"
"# ! gcloud artifacts repositories create $REPOSITORY --repository-format=docker --location=$LOCATION"
]
},
{
Expand All @@ -315,7 +315,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 13,
"id": "04d30d5d-8fd0-4ad3-a1c4-e54f64498a62",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -355,7 +355,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 14,
"id": "14a89b21-1ec4-44d4-8707-9d445169fe1b",
"metadata": {},
"outputs": [
Expand All @@ -375,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 15,
"id": "0ae3cae3-54e3-4e22-ace8-8c12d1b697e8",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -424,7 +424,7 @@
},
{
"cell_type": "code",
"execution_count": 113,
"execution_count": 19,
"id": "0811a484-33f2-47a0-b22e-6764d2156d7d",
"metadata": {},
"outputs": [
Expand All @@ -447,10 +447,10 @@
"\n",
"WORKDIR $APP_HOME\n",
"\n",
"COPY /two_tower_jt $APP_HOME/src/two_tower_jt\n",
"COPY src/two_tower_jt $APP_HOME/src/two_tower_jt\n",
"\n",
"RUN pip install --upgrade pip\n",
"RUN pip install --no-cache-dir -r $APP_HOME/src/two_tower_jt/requirements.txt\n",
"RUN pip install -r $APP_HOME/src/two_tower_jt/requirements.txt\n",
"\n",
"RUN apt update && apt -y install nvtop\n",
"\n",
Expand All @@ -467,7 +467,7 @@
},
{
"cell_type": "code",
"execution_count": 114,
"execution_count": 17,
"id": "c6617e81-58f2-4f9a-934f-f4b70f3c350a",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -498,7 +498,7 @@
},
{
"cell_type": "code",
"execution_count": 115,
"execution_count": 18,
"id": "177d09ef-bd88-4154-a687-651ec28d89e8",
"metadata": {
"tags": []
Expand Down Expand Up @@ -538,7 +538,7 @@
},
{
"cell_type": "code",
"execution_count": 116,
"execution_count": 20,
"id": "670737e4-a802-4799-b462-bff489e23c79",
"metadata": {},
"outputs": [
Expand Down
32 changes: 17 additions & 15 deletions 04-custom-train-retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"id": "3325fcee-3bd1-4c1c-8ff8-5fac4be8fc16",
"metadata": {},
"outputs": [
Expand All @@ -176,7 +176,7 @@
"'vocab_dict.pkl'"
]
},
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -187,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"id": "03bbe4be-68ed-4084-b4cd-eee9a311da58",
"metadata": {},
"outputs": [],
Expand All @@ -199,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"id": "d9dfaf03-9b67-438d-bcd6-131a75d9d51d",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -236,7 +236,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"id": "03410e35-7e1c-481c-aef2-55c25a90bcc4",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -299,7 +299,7 @@
"output_type": "stream",
"text": [
"EXPERIMENT_NAME: scale-training-v1\n",
"RUN_NAME: run-20230925-145451\n"
"RUN_NAME: run-20230925-203116\n"
]
}
],
Expand Down Expand Up @@ -330,7 +330,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"TB_RESOURCE_NAME: projects/934903580331/locations/us-central1/tensorboards/7204483970304573440\n",
"TB_RESOURCE_NAME: projects/934903580331/locations/us-central1/tensorboards/1356559854163984384\n",
"TB display name: scale-training-v1\n"
]
}
Expand Down Expand Up @@ -527,7 +527,7 @@
" f'--max_tokens={MAX_TOKENS}',\n",
" f'--tb_resource_name={TB_RESOURCE_NAME}',\n",
" f'--embed_frequency={EMBED_FREQUENCY}',\n",
" # f'--update_frequency={UPDATE_FREQ}', # TODO - turn on\n",
" f'--update_frequency={UPDATE_FREQ}', # TODO - turn on\n",
" f'--hist_frequency={HIST_FREQUENCY}', \n",
" f'--tf_gpu_thread_count={TF_GPU_THREAD_COUNT}',\n",
" f'--block_length={BLOCK_LENGTH}',\n",
Expand Down Expand Up @@ -565,7 +565,7 @@
" '--candidate_file_dir=ndr-v1-hybrid-vertex-bucket',\n",
" '--candidate_files_prefix=data/v1/candidates',\n",
" '--experiment_name=scale-training-v1',\n",
" '--experiment_run=run-20230925-145451',\n",
" '--experiment_run=run-20230925-203116',\n",
" '--num_epochs=15',\n",
" '--batch_size=4096',\n",
" '--embedding_dim=128',\n",
Expand All @@ -580,8 +580,9 @@
" '--pipeline_version=v1',\n",
" '--seed=1234',\n",
" '--max_tokens=20000',\n",
" '--tb_resource_name=projects/934903580331/locations/us-central1/tensorboards/7204483970304573440',\n",
" '--tb_resource_name=projects/934903580331/locations/us-central1/tensorboards/1356559854163984384',\n",
" '--embed_frequency=1',\n",
" '--update_frequency=500',\n",
" '--hist_frequency=0',\n",
" '--tf_gpu_thread_count=8',\n",
" '--block_length=64',\n",
Expand Down Expand Up @@ -639,7 +640,7 @@
"output_type": "stream",
"text": [
"\n",
" Copied training package and Dockerfile to gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451\n",
" Copied training package and Dockerfile to gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-203116\n",
"\n"
]
}
Expand Down Expand Up @@ -668,9 +669,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451/Dockerfile_tfrs\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451/vocab_dict.pkl\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451/trainer/\n"
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-203116/Dockerfile_tfrs\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-203116/cloudbuild.yaml\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-203116/vocab_dict.pkl\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-203116/trainer/\n"
]
}
],
Expand All @@ -696,7 +698,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"JOB_NAME: train-v1-run-20230925-145451\n"
"JOB_NAME: train-v1-run-20230925-203116\n"
]
}
],
Expand Down
22 changes: 9 additions & 13 deletions 06-deploy-index-and-query-tower.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@
"id": "f523ce16-b93d-4107-8905-f3e07176174c",
"metadata": {},
"source": [
"# Implementing Recommendation Engines with Matching Engine"
"# Deploy Matching Engine Index and Query Model"
]
},
{
"cell_type": "markdown",
"id": "211c8ed5-f34b-44f8-9028-b8b716165b08",
"metadata": {},
"source": [
"### VPC Network peering\n",
"Matching engine is a high performance vector matching service that requires a seperate VPC to ensure performance. \n",
"### Steps in this notebook:\n",
"\n",
"Below are the one-time instructions to set up a peering network. \n",
"* Create brute-force (BF) and ANN indexes\n",
"* Deploy indexes to index endpoints\n",
"* Deploy Query model to online prediction endpoint\n",
"* Setup model monitoring for online prediction endpoint\n",
"* Test model deployment endpoint (e.g., prediction requests)\n",
"* Test index deployment endpoint (e.g., recall accuracy between BF and ANN indices)\n",
"\n",
"**Once created, be sure to your notebook instance running this particular notebook is in the subnetwork... https://cloud.google.com/vertex-ai/docs/matching-engine/match-eng-setup**\n",
"\n",
"Steps in this notebook:\n",
"1. Build and deploy a brute force and ANN index\n",
"2. Test the recall accuracy between BF and ANN\n",
"Note BF will always be 100% recall but at cost of speed and computational complexity\n",
"Here's a good benchmark of Matching Engine (ScaNN is the algorithm)\n",
"\n",
"![](https://1.bp.blogspot.com/--mbMV8fQY28/XxsvbGL_l-I/AAAAAAAAGQ0/Br9B3XGnBa07barUxC4XTi8hSDxYzwAEgCLcBGAsYHQ/s640/image5.png)"
"> * Note BF will always be 100% recall but at cost of speed and computational complexity"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions 07-train-pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
"metadata": {},
"outputs": [],
"source": [
"PIPELINE_VERSION = 'pipev2' # TODO"
"PIPELINE_VERSION = 'pipe_v2' # TODO"
]
},
{
Expand Down Expand Up @@ -2716,7 +2716,7 @@
" f'--max_tokens={MAX_TOKENS}',\n",
" # f'--tb_resource_name={TB_RESOURCE_NAME}',\n",
" f'--embed_frequency={EMBED_FREQUENCY}',\n",
" # f'--update_frequency={UPDATE_FREQ}', # TODO - turn on\n",
" f'--update_frequency={UPDATE_FREQ}', # TODO - turn on\n",
" f'--hist_frequency={HIST_FREQUENCY}',\n",
" f'--tf_gpu_thread_count={TF_GPU_THREAD_COUNT}',\n",
" f'--block_length={BLOCK_LENGTH}',\n",
Expand Down

0 comments on commit 0009283

Please sign in to comment.