worker jupyter

master
ml server 2020-01-17 18:16:07 -07:00
parent 06a05f26c8
commit 6500ef335e
1 changed files with 92 additions and 0 deletions

View File

@ -10,6 +10,98 @@
"#\n",
"#"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Cluster\n",
"from __future__ import absolute_import, division, print_function, unicode_literals\n",
"import tensorflow as tf\n",
"import simplejson as json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# The script wut-worker launches this python script.\n",
"# It is better to do in the shell script, because the index has to be\n",
"# unique for each hostname.\n",
"#\n",
"# It has a line like:\n",
"# TF_CONFIG='{\"cluster\": {\"worker\": [\"ml1:2222\", \"ml2:2222\", \"ml3:2222\", \"ml4:2222\", \"ml5:2222\"]}, \"task\": {\"index\": 0, \"type\": \"worker\"}}' python3 wut-worker.py"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#os.environ[\"TF_CONFIG\"] = json.dumps({\n",
"# \"cluster\": {\n",
"# \"worker\": [ \"ml1:2222\", \"ml2:2222\", \"ml3:2222\", \"ml4:2222\", \"ml5:2222\" ]\n",
"# },\n",
"# \"task\": {\"type\": \"worker\", \"index\": 1},\n",
"# \"num_workers\": 5\n",
"#})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {