File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
vendor/ngc-tensorflow/runner-scripts Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ BAI_MULTINODE_CONFIG_TF=$( /opt/backend.ai/bin/python /opt/container/setup_multinode.py)
3
+ if [ -z " $BAI_MULTINODE_CONFIG_TF " ];
4
+ then
5
+ echo " " ;
6
+ else
7
+ echo ${BAI_MULTINODE_CONFIG_TF}
8
+ export TF_CONFIG=" ${BAI_MULTINODE_CONFIG_TF} "
9
+ fi
Original file line number Diff line number Diff line change
1
+ import os
2
+ import json
3
+
4
+ if 'BACKENDAI_CLUSTER_HOST' in os .environ : # Start mutli-instance setup.
5
+ env = {}
6
+ env ['cluster' ] = {}
7
+ env ['cluster' ]['worker' ] = []
8
+ for container in os .environ ['BACKENDAI_CLUSTER_HOSTS' ].split ("," ):
9
+ env ['cluster' ]['worker' ].append (container + ":2220" )
10
+ env ['task' ] = {}
11
+ if os .environ ['BACKENDAI_CLUSTER_ROLE' ] == 'main' :
12
+ env ['task' ]['type' ] = "worker" # Was chief. but recent TF choose first worker as chief.
13
+ env ['task' ]["index" ] = str (int (os .environ ['BACKENDAI_CLUSTER_IDX' ]) - 1 ) # Index starts from 0
14
+ else :
15
+ env ['task' ]['type' ] = "worker"
16
+ env ['task' ]["index" ] = os .environ ['BACKENDAI_CLUSTER_IDX' ]
17
+ print (json .dumps (env ))
18
+ else :
19
+ print ("" )
You can’t perform that action at this time.
0 commit comments