mirror of https://github.com/percyliang/sempre
resume changes and perf improvements
This commit is contained in:
parent
a9ab6c8f7a
commit
fe4e034b90
|
|
@ -1,5 +1,25 @@
|
|||
# README
|
||||
|
||||
|
||||
## Running an experiment
|
||||
|
||||
1) Start the server
|
||||
|
||||
./interactive/run @mode=voxelurn -server
|
||||
|
||||
2) Query the server with existing data
|
||||
|
||||
./interactive/run @mode=simulator @server=local @sandbox=none @task=freebigdef
|
||||
|
||||
2) Run analysis script to get results
|
||||
|
||||
./interactive/run @mode=analyze
|
||||
|
||||
0) (Optional) clean up
|
||||
|
||||
./interactive/run @mode=backup # save previous data logs
|
||||
./interactive/run @mode=trash # deletes previous data logs
|
||||
|
||||
## Running the server for voxelurn
|
||||
|
||||
1) Start the sempre server
|
||||
|
|
@ -14,24 +34,6 @@
|
|||
|
||||
./interactive/run @mode=simulator @server=local @sandbox=none @task=freebig
|
||||
|
||||
## Running an experiment
|
||||
|
||||
1) Start the server
|
||||
|
||||
./interactive/run @mode=voxelurn -Server.port 8410
|
||||
|
||||
2) Blast the server with previous logs to get the server into state
|
||||
|
||||
./interactive/run @mode=simulator @server=local @sandbox=none @task=freebig
|
||||
|
||||
2) Run analysis script to get results
|
||||
|
||||
./interactive/run @mode=analyze -execNumber 1
|
||||
|
||||
0) (Optional) clean up
|
||||
|
||||
./interactive/run @mode=backup # save previous data logs
|
||||
./interactive/run @mode=trash # deletes previous data logs
|
||||
|
||||
## Tests
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"execution_count": 44,
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"scrolled": false
|
||||
|
|
@ -26,15 +26,15 @@
|
|||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"887\n",
|
||||
"log.file\tstate/execs/887.exec/log\n",
|
||||
"897\n",
|
||||
"log.file\tstate/execs/897.exec/log\n",
|
||||
"Simulator.reqParams\tgrammar=1&cite=1&learn=1&logging=0\n",
|
||||
"Simulator.logFiles\t./interactive/queries/freebuildbig-0206.def.json.gz\n",
|
||||
"500 lines in plotInfo\n",
|
||||
"[]\n",
|
||||
"errors:20, stats.uncaught_error:0\n",
|
||||
"{'total_rules': 608, 'total_failed': 151, 'total_def_queries': 480, 'total_body': 1812}\n",
|
||||
"failpercent: 0.0833\n"
|
||||
"2495 lines in plotInfo\n",
|
||||
"[u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException', u'java.util.concurrent.TimeoutException']\n",
|
||||
"errors:80, stats.uncaught_error:17\n",
|
||||
"{'total_rules': 2880, 'total_failed': 580, 'total_def_queries': 2398, 'total_body': 15468}\n",
|
||||
"failpercent: 0.0375\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -216,7 +216,6 @@ addMode('voxelurn', 'interactive semantic parsing in a VoxelWorld', lambda { |e|
|
|||
|
||||
o('NumberFn.allowedRange', 0, 100),
|
||||
o('SimpleLexicon.inPaths', "./#{$path}/csscolors.lexicon"),
|
||||
#o('Grammar.tags', 'morenumbers', 'morecolors'),
|
||||
o('Grammar.tags', 'morecolors', 'morenumbers'),
|
||||
|
||||
lambda { |e| system 'mkdir -p ./int-output/'; nil},
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
(rule $Number ($TOKEN) (NumberFn) (anchored 1)))
|
||||
|
||||
(when morecolors
|
||||
(rule $Color ($TOKEN) (SimpleLexiconFn) (anchored 1)))
|
||||
(rule $Color ($TOKEN) (SimpleLexiconFn (type color)) (anchored 1)))
|
||||
|
||||
(when (not morenumbers)
|
||||
(for @num (0 1 2 3 4 5 6 7 8 9 10)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ public class InteractiveServer {
|
|||
private static Object queryLogLock = new Object();
|
||||
private static Object responseLogLock = new Object();
|
||||
private static AtomicLong queryCounter = new AtomicLong();
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
Master master;
|
||||
|
||||
class Handler implements HttpHandler {
|
||||
|
|
@ -210,6 +209,7 @@ public class InteractiveServer {
|
|||
Master.Response processQuery(Session session, String query) {
|
||||
String message = null;
|
||||
Master.Response response = master.new Response();
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
Future<Master.Response> future = executor.submit(() -> master.processQuery(session, query));
|
||||
long startTime = System.nanoTime();
|
||||
try {
|
||||
|
|
@ -332,7 +332,8 @@ public class InteractiveServer {
|
|||
try {
|
||||
String hostname = fig.basic.SysInfoUtils.getHostName();
|
||||
HttpServer server = HttpServer.create(new InetSocketAddress(opts.port), 10);
|
||||
ExecutorService pool = new ThreadPoolExecutor(opts.numThreads, opts.numThreads, 5000, TimeUnit.MILLISECONDS,
|
||||
// generous timeout here
|
||||
ExecutorService pool = new ThreadPoolExecutor(opts.numThreads, opts.numThreads, 120, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<Runnable>());
|
||||
// Executors.newFixedThreadPool(opts.numThreads);
|
||||
server.createContext("/", new Handler());
|
||||
|
|
|
|||
|
|
@ -264,4 +264,4 @@ public class DALExecutorTest {
|
|||
LogInfo.end_track();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue