Skip to content

Commit f00f31b

Browse files
committed
Updated p2b1 workflows to use tensor flow
1 parent 25371cd commit f00f31b

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

workflows/p2b1_mlrMBO/scripts/run_model.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ framework=$4
4242
exp_id=$5
4343
run_id=$6
4444

45-
export KERAS_BACKEND=theano
45+
#export KERAS_BACKEND=theano
4646
BENCHMARK_DIR=$emews_root/../../../Benchmarks/common:$emews_root/../../../Benchmarks/Pilot2/P2B1
4747
COMMON_DIR=$emews_root/../common/python
4848
export PYTHONPATH="$BENCHMARK_DIR:$COMMON_DIR"

workflows/p2b1_mlrMBO/scripts/theta_run_model.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,16 @@ framework=$4
4040
exp_id=$5
4141
run_id=$6
4242

43-
export KERAS_BACKEND=theano
44-
# Theta / Tensorflow env vars
45-
#export KMP_BLOCKTIME=30
46-
#export KMP_SETTINGS=1
47-
#export KMP_AFFINITY=granularity=fine,verbose,compact,1,0
48-
#export OMP_NUM_THREADS=144
49-
43+
# export KERAS_BACKEND=theano
5044
#export THEANO_FLAGS="config.base_compiledir=$instance_directory"
51-
export THEANO_FLAGS="base_compiledir=$instance_directory"
45+
#export THEANO_FLAGS="base_compiledir=$instance_directory"
5246

5347

48+
# Theta / Tensorflow env vars
49+
export KMP_BLOCKTIME=30
50+
export KMP_SETTINGS=1
51+
export KMP_AFFINITY=granularity=fine,verbose,compact,1,0
52+
export OMP_NUM_THREADS=144
5453

5554
export PYTHONHOME="/lus/theta-fs0/projects/Candle_ECP/ncollier/py2_tf_gcc6.3_eigen3_native"
5655
PYTHON="$PYTHONHOME/bin/python"

workflows/p2b1_mlrMBO/swift/cori_workflow3.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ CMD_LINE_ARGS+="-param_set_file=$PARAM_SET_FILE "
8888
CMD_LINE_ARGS+="-exp_id=$EXPID "
8989

9090
# P2B1 requires theano -- doesn't work with tensor flow
91-
KERAS_BACKEND=theano
92-
91+
# KERAS_BACKEND=theano
9392

9493
# set machine to your scheduler type (e.g. pbs, slurm, cobalt etc.),
9594
# or empty for an immediate non-queued unscheduled run

workflows/p2b1_mlrMBO/swift/workflow.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export EMEWS_PROJECT_ROOT=$( cd $( dirname $0 )/.. ; /bin/pwd )
1414
# See README.md for more information
1515

1616
# The directory in the Benchmarks repo containing P2B1
17-
BENCHMARK_DIR=$EMEWS_PROJECT_ROOT/../../../Benchmarks/Pilot2/P2B1
17+
BENCHMARK_DIR="$EMEWS_PROJECT_ROOT/../../../Benchmarks/common:"
18+
BENCHMARK_DIR+="$EMEWS_PROJECT_ROOT/../../../Benchmarks/Pilot2/P2B1"
1819

1920
# The number of MPI processes
2021
# Note that 2 processes are reserved for Swift/EMEMS
@@ -78,7 +79,7 @@ export RESIDENT_WORK_RANKS=$(( PROCS - 2 ))
7879
# EQ/R location
7980
EQR=$EMEWS_PROJECT_ROOT/ext/EQ-R
8081

81-
export KERAS_BACKEND=theano
82+
#export KERAS_BACKEND=theano
8283

8384
CMD_LINE_ARGS="$* -pp=$PROPOSE_POINTS -mi=$MAX_ITERATIONS -mb=$MAX_BUDGET -ds=$DESIGN_SIZE "
8485
CMD_LINE_ARGS+="-exp_id=$EXPID -param_set_file=$PARAM_SET_FILE "

workflows/p2b1_mlrMBO/swift/workflow3.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ string code_template =
2323
"""
2424
import os
2525
outdir = '%s'
26-
os.environ['THEANO_FLAGS']="base_compiledir={}".format(outdir)
2726
2827
import p2b1_runner
2928
import json
30-
import theano
3129
3230
if not os.path.exists(outdir):
3331
os.makedirs(outdir)
@@ -132,9 +130,16 @@ max.budget = %d, max.iterations = %d, design.size=%d, propose.points=%d, param.s
132130

133131
(void o) log_start(string algorithm) {
134132
string ps = join(file_lines(input(param_set)), " ");
135-
string sys_env = join(file_lines(input("%s/turbine.log" % turbine_output)), ", ");
136-
string code = code_log_start % (propose_points, max_iterations, ps, algorithm, exp_id, sys_env);
137-
python_persist(code);
133+
string t_log = "%s/turbine.log" % turbine_output;
134+
if (file_exists(t_log)) {
135+
string sys_env = join(file_lines(input(t_log)), ", ");
136+
string code = code_log_start % (propose_points, max_iterations, ps, algorithm, exp_id, sys_env);
137+
python_persist(code);
138+
} else {
139+
string code = code_log_start % (propose_points, max_iterations, ps, algorithm, exp_id, "");
140+
python_persist(code);
141+
}
142+
138143
o = propagate();
139144
}
140145

0 commit comments

Comments
 (0)