Skip to content

Commit

Permalink
update names
Browse files Browse the repository at this point in the history
  • Loading branch information
tottenjordan committed Sep 25, 2023
1 parent d10c1ec commit 0eb2e67
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 113 deletions.
59 changes: 25 additions & 34 deletions 04-custom-train-retrieval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"id": "03855d9e-afe2-4edc-8b78-6b1d44b109ce",
"metadata": {},
"outputs": [
Expand All @@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"id": "7322bf4e-0bb0-486c-b041-6882ecee7239",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "319b0b73-d1bc-4a90-a4aa-864d2215d646",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -146,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"id": "2e4b6da8-8246-410c-8718-6a0dea4ea269",
"metadata": {},
"outputs": [],
Expand All @@ -166,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 8,
"id": "3325fcee-3bd1-4c1c-8ff8-5fac4be8fc16",
"metadata": {},
"outputs": [
Expand All @@ -176,7 +176,7 @@
"'vocab_dict.pkl'"
]
},
"execution_count": 5,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -187,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"id": "03bbe4be-68ed-4084-b4cd-eee9a311da58",
"metadata": {},
"outputs": [],
Expand All @@ -199,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 10,
"id": "d9dfaf03-9b67-438d-bcd6-131a75d9d51d",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -236,7 +236,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 11,
"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-20230922-202508\n"
"RUN_NAME: run-20230925-145451\n"
]
}
],
Expand Down Expand Up @@ -330,7 +330,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"TB_RESOURCE_NAME: projects/934903580331/locations/us-central1/tensorboards/4282210762094542848\n",
"TB_RESOURCE_NAME: projects/934903580331/locations/us-central1/tensorboards/7204483970304573440\n",
"TB display name: scale-training-v1\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-20230922-202508',\n",
" '--experiment_run=run-20230925-145451',\n",
" '--num_epochs=15',\n",
" '--batch_size=4096',\n",
" '--embedding_dim=128',\n",
Expand All @@ -580,7 +580,7 @@
" '--pipeline_version=v1',\n",
" '--seed=1234',\n",
" '--max_tokens=20000',\n",
" '--tb_resource_name=projects/934903580331/locations/us-central1/tensorboards/4282210762094542848',\n",
" '--tb_resource_name=projects/934903580331/locations/us-central1/tensorboards/7204483970304573440',\n",
" '--embed_frequency=1',\n",
" '--hist_frequency=0',\n",
" '--tf_gpu_thread_count=8',\n",
Expand Down Expand Up @@ -639,7 +639,7 @@
"output_type": "stream",
"text": [
"\n",
" Copied training package and Dockerfile to gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230922-202508\n",
" Copied training package and Dockerfile to gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451\n",
"\n"
]
}
Expand Down Expand Up @@ -668,9 +668,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230922-202508/Dockerfile_tfrs\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230922-202508/vocab_dict.pkl\n",
"gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230922-202508/trainer/\n"
"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"
]
}
],
Expand All @@ -696,7 +696,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"JOB_NAME: train-v1-run-20230922-202508\n"
"JOB_NAME: train-v1-run-20230925-145451\n"
]
}
],
Expand Down Expand Up @@ -766,15 +766,15 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 12,
"id": "33a58184-e0c4-4403-ad80-da5fdb7dbaed",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"TB_LOGS_PATH: gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230922-153317/logs\n"
"TB_LOGS_PATH: gs://ndr-v1-hybrid-vertex-bucket/scale-training-v1/run-20230925-145451/logs\n"
]
}
],
Expand All @@ -789,7 +789,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 14,
"id": "d432d552-4416-4f4c-964f-bcca57b60a07",
"metadata": {},
"outputs": [],
Expand All @@ -800,29 +800,20 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 15,
"id": "171227db-d5f9-47e4-8b67-a528950233ab",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Reusing TensorBoard on port 6006 (pid 30025), started 0:04:41 ago. (Use '!kill 30025' to kill it.)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe id=\"tensorboard-frame-64233e23ab6abec0\" width=\"100%\" height=\"800\" frameborder=\"0\">\n",
" <iframe id=\"tensorboard-frame-633ff50d405cd4f5\" width=\"100%\" height=\"800\" frameborder=\"0\">\n",
" </iframe>\n",
" <script>\n",
" (function() {\n",
" const frame = document.getElementById(\"tensorboard-frame-64233e23ab6abec0\");\n",
" const url = new URL(\"/proxy/6006/\", window.location);\n",
" const frame = document.getElementById(\"tensorboard-frame-633ff50d405cd4f5\");\n",
" const url = new URL(\"/proxy/6007/\", window.location);\n",
" const port = 0;\n",
" if (port) {\n",
" url.port = port;\n",
Expand Down
File renamed without changes.
26 changes: 15 additions & 11 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 = 'pipev1' # TODO"
"PIPELINE_VERSION = 'pipev2' # TODO"
]
},
{
Expand Down Expand Up @@ -1416,7 +1416,7 @@
"\n",
" index_endpoint = index_endpoint.deploy_index(\n",
" index=brute_index, \n",
" deployed_index_id=f'{deployed_brute_force_index_name}', #-{TIMESTAMP}'\n",
" deployed_index_id=f'{deployed_brute_force_index_name}' #-{TIMESTAMP}'\n",
" )\n",
"\n",
" logging.info(f\"index_endpoint.deployed_indexes: {index_endpoint.deployed_indexes}\")\n",
Expand Down Expand Up @@ -1466,7 +1466,7 @@
" base_image=\"python:3.9\",\n",
" packages_to_install=[\n",
" 'google-cloud-aiplatform==1.26.1',\n",
" # 'google-cloud-pipeline-components',\n",
" 'google-cloud-pipeline-components',\n",
" 'google-cloud-storage',\n",
" 'tensorflow==2.11.0',\n",
" 'numpy'\n",
Expand All @@ -1478,6 +1478,7 @@
" version: str,\n",
" prefix: str,\n",
" emails: str,\n",
" train_output_gcs_bucket: str,\n",
" # feature_dict: dict, # TODO\n",
" bq_dataset: str,\n",
" bq_train_table: str,\n",
Expand Down Expand Up @@ -1566,7 +1567,7 @@
" # ===================================================\n",
" QUERY_FILENAME = 'query_feats_dict.pkl'\n",
" # FEATURES_PREFIX = f'{experiment_name}/{experiment_run}/features'\n",
" GCS_PATH_TO_BLOB = f'{experiment_name}/{experiment_run}/features'\n",
" GCS_PATH_TO_BLOB = f'{experiment_name}/{experiment_run}/features/{QUERY_FILENAME}'\n",
" \n",
" loaded_feat_dict = download_blob(\n",
" bucket_name=train_output_gcs_bucket,\n",
Expand All @@ -1575,7 +1576,7 @@
" )\n",
" logging.info(f'loaded_feat_dict: {loaded_feat_dict}')\n",
" \n",
" filehandler = open(loaded_feat_dict, 'rb')\n",
" filehandler = open(QUERY_FILENAME, 'rb')\n",
" FEAT_DICT = pkl.load(filehandler)\n",
" filehandler.close()\n",
" \n",
Expand Down Expand Up @@ -1654,7 +1655,7 @@
" display_name=JOB_DISPLAY_NAME,\n",
" project=project,\n",
" location=location,\n",
" endpoint=endpoint,\n",
" endpoint=_endpoint,\n",
" logging_sampling_strategy=logging_sampling_strategy,\n",
" schedule_config=schedule_config,\n",
" alert_config=alert_config,\n",
Expand Down Expand Up @@ -1699,7 +1700,7 @@
" base_image=\"python:3.9\",\n",
" packages_to_install=[\n",
" 'google-cloud-aiplatform==1.26.1',\n",
" # 'google-cloud-pipeline-components',\n",
" 'google-cloud-pipeline-components',\n",
" 'google-cloud-storage',\n",
" 'tensorflow==2.11.0',\n",
" 'numpy'\n",
Expand Down Expand Up @@ -2218,7 +2219,8 @@
"source": [
"EXPERIMENT_PREFIX = 'tfrs-pipe' # custom identifier for organizing experiments\n",
"EXPERIMENT_NAME=f'{EXPERIMENT_PREFIX}-{VERSION}'\n",
"RUN_NAME = f'run-{time.strftime(\"%Y%m%d-%H%M%S\")}'\n",
"# RUN_NAME = f'run-{time.strftime(\"%Y%m%d-%H%M%S\")}'\n",
"RUN_NAME = f'run-20230922-202528'\n",
"\n",
"print(f\"EXPERIMENT_NAME: {EXPERIMENT_NAME}\")\n",
"print(f\"RUN_NAME: {RUN_NAME}\")"
Expand Down Expand Up @@ -2558,7 +2560,7 @@
"valid_samples_cnt = 82_959\n",
"\n",
"# validation & evaluation\n",
"VALID_FREQUENCY = NUM_EPOCHS // 2 # 20\n",
"VALID_FREQUENCY = NUM_EPOCHS // 3 # 20\n",
"VALID_STEPS = valid_samples_cnt // BATCH_SIZE # 100\n",
"EPOCH_STEPS = train_sample_cnt // BATCH_SIZE\n",
"\n",
Expand Down Expand Up @@ -3123,6 +3125,7 @@
" version=model_version,\n",
" prefix=prefix,\n",
" emails=emails,\n",
" train_output_gcs_bucket=train_output_gcs_bucket,\n",
" # feature_dict=feature_dict, # TODO\n",
" bq_dataset= bq_dataset,\n",
" bq_train_table=bq_train_table,\n",
Expand Down Expand Up @@ -3207,7 +3210,7 @@
" version=model_version,\n",
" location=location,\n",
" vpc_network_name=vpc_network_name,\n",
" ann_index_endpoint_display_name=f'ann-index-endpoint_{model_version}'.replace('-', '_'),\n",
" ann_index_endpoint_display_name=f'ann-index-endpoint_{pipeline_version}'.replace('-', '_'),\n",
" ann_index_endpoint_description='endpoint for ann index',\n",
" ann_index_resource_uri=create_ann_index_op.outputs['ann_index_resource_uri'],\n",
" )\n",
Expand All @@ -3223,7 +3226,7 @@
" version=model_version,\n",
" location=location,\n",
" vpc_network_name=vpc_network_name,\n",
" brute_index_endpoint_display_name=f'bf-index-endpoint_{model_version}'.replace('-', '_'),\n",
" brute_index_endpoint_display_name=f'bf-index-endpoint_{pipeline_version}'.replace('-', '_'),\n",
" brute_index_endpoint_description='endpoint for brute force index',\n",
" brute_force_index_resource_uri=create_brute_force_index_op.outputs['brute_force_index_resource_uri'],\n",
" )\n",
Expand Down Expand Up @@ -3348,6 +3351,7 @@
"text": [
"gs://ndr-v1-hybrid-vertex-bucket/tfrs-pipe-v1/run-20230922-202528/pipeline_root/Dockerfile_tfrs\n",
"gs://ndr-v1-hybrid-vertex-bucket/tfrs-pipe-v1/run-20230922-202528/pipeline_root/pipeline_spec.json\n",
"gs://ndr-v1-hybrid-vertex-bucket/tfrs-pipe-v1/run-20230922-202528/pipeline_root/934903580331/\n",
"gs://ndr-v1-hybrid-vertex-bucket/tfrs-pipe-v1/run-20230922-202528/pipeline_root/trainer/\n"
]
}
Expand Down
Loading

0 comments on commit 0eb2e67

Please sign in to comment.