Skip to content

Commit 3c0ab4b

Browse files
committed
additional output
1 parent eab0ddb commit 3c0ab4b

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

autosklearn/automl.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ def fit(
736736
self._logger.exception(e)
737737
raise
738738

739+
self._logger.info("Starting shutdown...")
739740
# Wait until the ensemble process is finished to avoid shutting down
740741
# while the ensemble builder tries to access the data
741742
if proc_ensemble is not None:
@@ -750,13 +751,21 @@ def fit(
750751
future = proc_ensemble.futures.pop()
751752
# Now we need to wait for the future to return as it cannot be cancelled while it
752753
# is running: https://stackoverflow.com/a/49203129
754+
self._logger.info("Ensemble script still running, waiting for it to finish.")
753755
future.result()
756+
self._logger.info("Ensemble script finished, continue shutdown.")
754757

755758
if load_models:
759+
self._logger.info("Loading models...")
756760
self._load_models()
761+
self._logger.info("Finished loading models...")
762+
763+
self._logger.info("Closing the dask infrastructure")
757764
self._close_dask_client()
765+
self._logger.info("Finished closing the dask infrastructure")
758766

759767
# Clean up the logger
768+
self._logger.info("Starting to clean up the logger")
760769
self._clean_logger()
761770

762771
return self

autosklearn/ensemble_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from smac.callbacks import IncorporateRunResultCallback
2424
from smac.optimizer.smbo import SMBO
2525
from smac.runhistory.runhistory import RunInfo, RunValue
26+
from smac.tae.base import StatusType
2627

2728
from autosklearn.util.backend import Backend
2829
from autosklearn.constants import BINARY_CLASSIFICATION
@@ -147,6 +148,8 @@ def __call__(
147148
result: RunValue,
148149
time_left: float,
149150
):
151+
if result.status in (StatusType.STOP, StatusType.ABORT):
152+
return
150153
self.build_ensemble(smbo.tae_runner.client)
151154

152155
def build_ensemble(
@@ -582,6 +585,7 @@ def run(
582585
if time_left - time_buffer < 1:
583586
break
584587
context = multiprocessing.get_context(pynisher_context)
588+
585589
safe_ensemble_script = pynisher.enforce_limits(
586590
wall_time_in_s=int(time_left - time_buffer),
587591
mem_in_mb=self.memory_limit,

autosklearn/evaluation/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def __init__(self, backend, autosklearn_seed, resampling_strategy, metric,
176176
self._get_test_loss = False
177177

178178
self.pynisher_context = pynisher_context
179+
self.logger = autosklearn.util.logging_.get_logger("TAE")
179180

180181
def run_wrapper(
181182
self,
@@ -218,7 +219,12 @@ def run_wrapper(
218219
if remaining_time - 5 < run_info.cutoff:
219220
run_info = run_info._replace(cutoff=int(remaining_time - 5))
220221

222+
config_id = (
223+
run_info.config if isinstance(run_info.config, int) else run_info.config.config_id
224+
)
225+
221226
if run_info.cutoff < 1.0:
227+
self.logger.info("Not starting configuration %d because time is up" % config_id)
222228
return run_info, RunValue(
223229
status=StatusType.STOP,
224230
cost=self.worst_possible_result,
@@ -233,6 +239,7 @@ def run_wrapper(
233239
):
234240
run_info = run_info._replace(cutoff=int(np.ceil(run_info.cutoff)))
235241

242+
self.logger.info("Starting to evaluate configuration %d" % config_id)
236243
return super().run_wrapper(run_info=run_info)
237244

238245
def run(
@@ -432,11 +439,14 @@ def run(
432439

433440
if isinstance(config, int):
434441
origin = 'DUMMY'
442+
config_id = config
435443
else:
436444
origin = getattr(config, 'origin', 'UNKNOWN')
445+
config_id = config.config_id
437446
additional_run_info['configuration_origin'] = origin
438447

439448
runtime = float(obj.wall_clock_time)
440449

441450
autosklearn.evaluation.util.empty_queue(queue)
451+
self.logger.info("Finished evaluating configuration %d" % config_id)
442452
return status, cost, runtime, additional_run_info

0 commit comments

Comments
 (0)