@@ -283,7 +283,8 @@ def is_priority_method(cls, method_name: str) -> bool:
283
283
def __init__ (self ,
284
284
clang_path : Optional [str ] = None ,
285
285
launcher_path : Optional [str ] = None ,
286
- moving_average_decay_rate : float = 1 ):
286
+ moving_average_decay_rate : float = 1 ,
287
+ compilation_timeout = None ):
287
288
"""Initialization of CompilationRunner class.
288
289
289
290
Args:
@@ -294,7 +295,9 @@ def __init__(self,
294
295
self ._clang_path = clang_path
295
296
self ._launcher_path = launcher_path
296
297
self ._moving_average_decay_rate = moving_average_decay_rate
297
- self ._compilation_timeout = _COMPILATION_TIMEOUT .value
298
+ # Avoid reading the flag during the first interpretation of this module.
299
+ self ._compilation_timeout = (
300
+ compilation_timeout or _COMPILATION_TIMEOUT .value )
298
301
self ._cancellation_manager = WorkerCancellationManager ()
299
302
300
303
# re-allow the cancellation manager accept work.
@@ -319,8 +322,6 @@ def collect_data(
319
322
module_spec: a ModuleSpec.
320
323
tf_policy_path: path to the tensorflow policy.
321
324
reward_stat: reward stat of this module, None if unknown.
322
- cancellation_token: a CancellationToken through which workers may be
323
- signaled early termination
324
325
325
326
Returns:
326
327
A CompilationResult. In particular:
0 commit comments