Skip to content

Commit 70cbba5

Browse files
authored
fix distributed tf notebook (Azure#2509)
1 parent aee2192 commit 70cbba5

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

Diff for: sdk/python/jobs/single-step/tensorflow/mnist-distributed/tensorflow-mnist-distributed.ipynb

+19-9
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@
118118
"cell_type": "code",
119119
"execution_count": null,
120120
"metadata": {
121-
"name": "job",
122121
"gather": {
123122
"logged": 1634855420019
124-
}
123+
},
124+
"name": "job"
125125
},
126126
"outputs": [],
127127
"source": [
@@ -134,12 +134,12 @@
134134
" compute=\"cpu-cluster\",\n",
135135
" instance_count=2,\n",
136136
" # distribution = {\"type\": \"mpi\", \"process_count_per_instance\": 1},\n",
137-
" distribution={\n",
138-
" \"type\": \"tensorflow\",\n",
139-
" \"parameter_server_count\": 1,\n",
140-
" \"worker_count\": 2,\n",
141-
" \"added_property\": 7,\n",
142-
" },\n",
137+
" # distribution={\n",
138+
" # \"type\": \"tensorflow\",\n",
139+
" # \"parameter_server_count\": 1, # for legacy TensorFlow 1.x\n",
140+
" # \"worker_count\": 2,\n",
141+
" # \"added_property\": 7,\n",
142+
" # },\n",
143143
" # distribution = {\n",
144144
" # \"type\": \"pytorch\",\n",
145145
" # \"process_count_per_instance\": 4,\n",
@@ -151,7 +151,7 @@
151151
")\n",
152152
"\n",
153153
"# can also set the distribution in a separate step and using the typed objects instead of a dict\n",
154-
"job.distribution = TensorFlowDistribution(parameter_server_count=1, worker_count=2)"
154+
"job.distribution = TensorFlowDistribution(worker_count=2)"
155155
]
156156
},
157157
{
@@ -183,6 +183,16 @@
183183
"returned_job = ml_client.create_or_update(job)"
184184
]
185185
},
186+
{
187+
"cell_type": "code",
188+
"execution_count": null,
189+
"metadata": {},
190+
"outputs": [],
191+
"source": [
192+
"# Wait until the job completes\n",
193+
"ml_client.jobs.stream(returned_job.name)"
194+
]
195+
},
186196
{
187197
"cell_type": "markdown",
188198
"metadata": {},

0 commit comments

Comments
 (0)