Skip to content

Commit 843f6a0

Browse files
committed
Improve cfpq_eval timeouts
1 parent 0851fc5 commit 843f6a0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cfpq_eval/runners/all_pairs_cflr_tool_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def base_command(self) -> Optional[str]:
5050

5151
@property
5252
def timeout_command(self) -> str:
53-
return '' if self.timeout_sec is None else f'timeout {self.timeout_sec}s '
53+
return '' if self.timeout_sec is None else f'timeout --kill-after=3m {self.timeout_sec}s '
5454

5555
@property
5656
def measure_ram_command(self) -> str:

cfpq_eval/runners/kotgll_all_pairs_cflr_tool_runner.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@
1616
from cfpq_model.label_decomposed_graph import LabelDecomposedGraph
1717
from cfpq_model.model_utils import explode_indices
1818

19+
_WARM_UP_ROUNDS = 1
20+
1921

2022
class KotgllAllPairsCflrToolRunner(AbstractAllPairsCflrToolRunner):
23+
def __init__(self, *args, **kwargs):
24+
super().__init__(*args, **kwargs)
25+
if self.timeout_sec is not None:
26+
self.timeout_sec += _WARM_UP_ROUNDS * self.timeout_sec
27+
2128
@property
2229
def base_command(self) -> Optional[str]:
2330
grammar = CnfGrammarTemplate.read_from_pocr_cnf_file(self.grammar_path)
@@ -62,7 +69,7 @@ def base_command(self) -> Optional[str]:
6269
f'--grammar {grammar_path.suffix[1:]} --sppf off '
6370
f'--inputPath {graph_path.parent} --grammarPath {grammar_path} '
6471
f'--outputPath {out_folder} '
65-
'--warmUpRounds 1 --benchmarkRounds 1'
72+
f'--warmUpRounds {_WARM_UP_ROUNDS} --benchmarkRounds 1'
6673
)
6774

6875
@property

0 commit comments

Comments
 (0)