[Swift-commit] r6114 - in SwiftApps/SciColSim: . params

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Jan 1 16:42:53 CST 2013


Author: wilde
Date: 2013-01-01 16:42:52 -0600 (Tue, 01 Jan 2013)
New Revision: 6114

Modified:
   SwiftApps/SciColSim/Makefile
   SwiftApps/SciColSim/TODO
   SwiftApps/SciColSim/annealing.swift
   SwiftApps/SciColSim/optimizer.cpp
   SwiftApps/SciColSim/params/ARtest03
   SwiftApps/SciColSim/testopt.py
Log:
annealing.swift: do indivudual target_innovation annealing loops iteratively instead of in parallel. Will make parallel an option in a future rev (code is still there). Removed unused unmapped file which was causing a spurious warning '(input) no files'; Makefile: addded targets for non-OpenMP optimizer. optimizer.cpp: return 3*max_loss when ration exceeds max_loss; added some debug traces.

Modified: SwiftApps/SciColSim/Makefile
===================================================================
--- SwiftApps/SciColSim/Makefile	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/Makefile	2013-01-01 22:42:52 UTC (rev 6114)
@@ -2,14 +2,13 @@
 
 ifeq ($(UNAME), Linux)
 
-all:	openmp-optimizer graphsim openmptest
+all:	optimizer openmp-optimizer graphsim openmptest
 
 openmp-optimizer: optimizer.cpp
-	g++ -DP_OPENMP -static -O -fopenmp -I boost_1_47_0 -o openmp-optimizer optimizer.cpp
-#	g++ -static -O -I boost_1_47_0 -o openmp-optimizer optimizer.cpp
+	g++ -DP_OPENMP -static -O2 -fopenmp -I boost_1_47_0 -o openmp-optimizer optimizer.cpp
 
-#t: t.cpp
-#	g++ -DP_OPENMP -static -O -fopenmp -I boost_1_47_0 -o t t.cpp
+optimizer: optimizer.cpp
+	g++ -static -O2 -I boost_1_47_0 -o optimizer optimizer.cpp
 
 graphsim: graphsim.cpp
 	g++ -DP_OPENMP -static -pg -O2 -fopenmp -I boost_1_47_0 -o graphsim graphsim.cpp
@@ -24,11 +23,14 @@
 
 ifeq ($(UNAME), Darwin)
 
-all:	openmp-optimizer dispatch-optimizer orig-optimizer graphsim openmptest
+all:	optimizer openmp-optimizer dispatch-optimizer orig-optimizer graphsim openmptest
 
 openmp-optimizer: optimizer.cpp
 	g++ -DP_OPENMP -fopenmp -I boost_1_47_0 -o openmp-optimizer optimizer.cpp
 
+optimizer: optimizer.cpp
+	g++ -I boost_1_47_0 -o optimizer optimizer.cpp
+
 graphsim: graphsim.cpp
 	g++ -DP_OPENMP -fopenmp -I boost_1_47_0 -g -o graphsim graphsim.cpp
 

Modified: SwiftApps/SciColSim/TODO
===================================================================
--- SwiftApps/SciColSim/TODO	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/TODO	2013-01-01 22:42:52 UTC (rev 6114)
@@ -1,5 +1,49 @@
+--- 2012.1231
 
+Check running times under actual OPENMP & Node settings.  Running 24X?
 
+Reduce mem to 24X
+
+Why large neg expos?  Eg:
+
+---
+multi_annealing: AR: 3487.405033 +- 23.971373
+multi_loss: returning: ci=1 cj=0 r.loss=3487.405033 r.sdev=23.971373
+Progress:  time: Mon, 31 Dec 2012 06:14:55 +0000  Checking status:1  Finished successfully:841
+multi_loss: returning: ci=0 cj=0 r.loss=3427.572341 r.sdev=24.738546
+multi_annealing: AR: initial: 3427.572341 +- 24.738546
+multi_annealing: AR: 0.9889519936665272 vs 1.0174100270514812E-13
+math/min: result=1.0174100270514812E-13
+multi_annealing: AR: 1,0 1 Did not accept: 1.8783001222853395 (0)
+multi_annealing: AR: 1.8783001222853395 0.0 0.0 0.0 0.0
+multi_loss appCalls=420
+multi_annealing: AR: -0.15939764554651975 1
+[0.0,-0.15939764554651975,0.0,0.0,0.0]
+---
+
+Why 2X jobs in first wave????
+
+Run 1000X x 5 TIs first? (parallel run)
+
+Add select: ser or par
+
+Need 100 Ann cycles?
+
+Check calcs in sumloss.sh
+
+get more resource telemetry (MEM, etc)
+
+Debug 0.94
+
+Try Swift/T
+
+Improve/reduce staging?
+
+---
+
+
+
+
 --- Questions and Open Issues ---
 
 When sampling the graph, we compress the node ids. Is this OK?

Modified: SwiftApps/SciColSim/annealing.swift
===================================================================
--- SwiftApps/SciColSim/annealing.swift	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/annealing.swift	2013-01-01 22:42:52 UTC (rev 6114)
@@ -68,7 +68,7 @@
                                                int annealing_cycles)
 {
   int cycle      = 10;     // const
-  int NEVOPARAMS = 5;      // const - 5 params, alpha 1,m through delta, does not include target_innovation
+  int NEVOPARAMS = 5;      // const - 5 params: alpha_i, alpha_m, beta, gamma, delta
 
   float rejection[][];  // [i][j] where i is cycle and j is evolve-parameter (alpha_i, alpha_m, beta, gamma, delta)
   float trejection[][];
@@ -229,7 +229,7 @@
 {
   tracef("%q\n", x);
   file rfile[];
-  file ofile[]; // FIXME: to obtain timings and otehr stats
+  //file ofile[]; // FIXME: to obtain timings and otehr stats
 
   tracef( "multi_loss: entered: ci=%i cj=%i target_innov=%f evolve_reruns=%i x=%q\n",ci, cj, target_innov,evolve_reruns,x );
 
@@ -268,6 +268,47 @@
   // s = readStat(statsfile);          FIXME: to obtain timings and other stats
 }
 
+optimizer_serial_sweep() // Implements logic of python driver script
+{
+
+  int minrange = @toint(@arg("minrange", "58"));
+  int maxrange = @toint(@arg("maxrange", "59"));
+  int rangeinc = @toint(@arg("rangeinc", "50"));
+
+  // FIXME: add provision for random priming and random param values when x[i] == -100 (see optimizer.cpp main())
+
+  int nreps = @toint(@arg("nreps", "1"));
+
+//file bestfile <single_file_mapper; file=@strcat("output/T",target,".R",rep,".best_opt_some")>;
+//file maxfile <single_file_mapper; file=@strcat("output/T",target,".R",rep,".max_dist")>;
+
+#  foreach target_innov in [minrange:maxrange:rangeinc] {
+  iterate i {
+    int target_innov = minrange + (i*rangeinc);
+    foreach rep in [1:nreps] {
+
+      string some_out_filename = @strcat( "best.T", @strcat(target_innov), ".R", @strcat(rep), ".txt" );
+      file outfile;  // <single_file_mapper; file=@strcat("output/T",target_innov,".R",rep,".out")>;
+      file lossfile; // <single_file_mapper; file=@strcat("output/T",target_innov,".R",rep,".loss_data")>;
+
+      (outfile,lossfile) = multi_annealing(some_out_filename,
+		                           @tofloat(@arg("tstart", "2.0")),
+                                           @tofloat(@arg("tend", "0.01")),
+                                           @tofloat(@arg("trejection", "0.3")),
+                                           @toint(@arg("evoreruns", "100")),
+                                           @tofloat(@arg("startingjump", "2.3")),
+                                           [ @tofloat(@arg("alphai", "0.0")),
+                                             @tofloat(@arg("alpham", "0.0")),
+                                             @tofloat(@arg("beta", "4.0")),
+                                             @tofloat(@arg("gamma", "50.0")),
+                                             @tofloat(@arg("delta", "-1.0"))
+                                           ],
+                                           @tofloat(target_innov),
+                                           @toint(@arg("annealingcycles", "50")) );
+    }
+  } until(target_innov >= (maxrange-rangeinc));
+}
+
 optimizer_sweep() // Implements logic of python driver script
 {
 
@@ -309,7 +350,7 @@
 
 main()
 {
-  optimizer_sweep();
+  optimizer_serial_sweep();
 }
 
 main();

Modified: SwiftApps/SciColSim/optimizer.cpp
===================================================================
--- SwiftApps/SciColSim/optimizer.cpp	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/optimizer.cpp	2013-01-01 22:42:52 UTC (rev 6114)
@@ -694,8 +694,8 @@
 		std::vector<int> d(num_edges(Full_g));
 		edge_descriptor s;
 		boost::graph_traits<graph_t>::vertex_descriptor u, v;
+		cout << "reset_world: start id=" << id << endl;
 
-
 		for (int i=0; i<N_nodes-1; i++){
 			for (int j=i+1; j<N_nodes; j++){
 				if (Final[i][j] > 0. && Tried[i][j] > 0){
@@ -723,6 +723,7 @@
 				Tried[i][j]=0.;
 			}
 		}
+		cout << "reset_world: end id=" << id << endl;
 	}
 
 
@@ -1004,7 +1005,8 @@
     //==================================================================================
     void evolve_to_target_and_save(int istart, int iend, double* storage, int* counters){
 
-        double ALOT=100000000000.;
+      //double ALOT=100000000000.;
+        double ALOT= 3.0 * max_loss; // Per Andrey, 2012.12.29
 
         double ratio = 0.0;
         int check = 0;
@@ -1012,6 +1014,7 @@
         reset_world();
 
         for (int k = istart; k < iend; k++){
+	  cout << "evolve_ttas: k=" << k << endl; 
 
             for(int i=0; i< N_epochs &&  current_novelty < TargetNovelty; i++){
 

Modified: SwiftApps/SciColSim/params/ARtest03
===================================================================
--- SwiftApps/SciColSim/params/ARtest03	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/params/ARtest03	2013-01-01 22:42:52 UTC (rev 6114)
@@ -4,11 +4,11 @@
 target_innovation_increment  50     # increment target innovation by this amount 
 
 annealing_repeats            1      # times to repeate the entire optimization process for each target_innovation
-annealing_cycles             10     # times to perform the simulated annealing loop for all non-fixed parameters
+annealing_cycles             30     # times to perform the simulated annealing loop for all non-fixed parameters
 
-evolve_reruns                32   # times to perform evolve_to_target_and_save() (objective function - is batched)
-nworkers                     16    # number of parallel threads (cores) to use per invocation of C++ optimizer
-reruns_per_opt_invocation    16     # reruns_per_opt_invocation mod nworkers must == 0 !!! <=== NOTE WELL !!!
+evolve_reruns                48     # times to perform evolve_to_target_and_save() (objective function - is batched)
+nworkers                     24     # number of parallel threads (cores) to use per invocation of C++ optimizer
+reruns_per_opt_invocation    24     # reruns_per_opt_invocation mod nworkers must == 0 !!! <=== NOTE WELL !!!
 
 alpha_i                      0.0     # 5 evolve() parameters: must be decimal values !!!
 alpha_m                      0.0     # alpha_i and alpha_m are fixed for now

Modified: SwiftApps/SciColSim/testopt.py
===================================================================
--- SwiftApps/SciColSim/testopt.py	2012-12-30 19:55:18 UTC (rev 6113)
+++ SwiftApps/SciColSim/testopt.py	2013-01-01 22:42:52 UTC (rev 6114)
@@ -10,7 +10,7 @@
 app              = "./openmp-optimizer";   # For Mac or Linux: Using OpenMP (Default)
 
 #paramset="default"
-paramset="mw2"
+paramset="mw3"
 verboseLevel = "1"
 
 print("Running with parameter set " + paramset + "\n\n");
@@ -131,6 +131,26 @@
   app              = "./openmp-optimizer"
   verboseLevel     = "1"
 
+elif paramset == "mw3":  # Timing TEST PARAMETERS by Mike
+  
+  startTarget      = 135
+  endTarget        = 136
+  incrTarget       = 135
+  optimizerRepeats = 1
+  evolveReruns     = 1
+  evolveReruns     = 2
+  annealingSteps   = 1
+  NWorkers         = "1"
+  openmp           = "OMP_NUM_THREADS=" + NWorkers
+  openmp           = ""
+
+  operation        = "m"  # n=normal, m=manual (runs 1 multi_loss call)
+  seed             = "123456"
+  app              = "./graphsim"
+  app              = "./openmp-optimizer"
+  app              = "./optimizer"
+  verboseLevel     = "99"
+
 # Ensure we dont pass new parameters to original optimizer versions
 # (but they would be ignored)
 
@@ -144,9 +164,9 @@
 for target in range(startTarget,endTarget,incrTarget):
   for i in range(optimizerRepeats):
     args = "rm -f bestdb.txt; " + \
-           openmp + " " + app + " 0 0 0 0 0 " + str(target) + " 40000 20 " + str(evolveReruns) + \
-           " 2 " + verboseLevel + " 2. 0.01 " + str(annealingSteps) + " 0.3 2.3 0 0 0 0 0 " + operation + " " + NWorkers + " " + seed + \
-           " >& out.T"+str(target)+".i"+str(i) + "; #mv bestdb.txt best.T" + str(target) + ".i" + str(i) 
+           openmp + " " + "/usr/bin/time -v " + app + " 0 -0.673572334121749 -2.0320313590203978 0 0 " + str(target) + " 40000 20 " + str(evolveReruns) + \
+           " 2 " + verboseLevel + " 2. 0.01 " + str(annealingSteps) + " 0.3 2.3 0 0 0 0 0 " + operation + " " + NWorkers + " " + seed \
+           # + " >& out.T"+str(target)+".i"+str(i) + "; #mv bestdb.txt best.T" + str(target) + ".i" + str(i) 
     print("\n**** Calling optimizer: "+args+"\n")
     os.system(args);
 




More information about the Swift-commit mailing list