From 131645f05919e0351798a49342de970535732de2 Mon Sep 17 00:00:00 2001 From: bohanjason Date: Fri, 22 May 2020 03:05:23 -0400 Subject: [PATCH] more info in result --- server/website/website/tasks/async_tasks.py | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/server/website/website/tasks/async_tasks.py b/server/website/website/tasks/async_tasks.py index e63d377..4bac757 100644 --- a/server/website/website/tasks/async_tasks.py +++ b/server/website/website/tasks/async_tasks.py @@ -272,11 +272,17 @@ def preprocessing(result_id, algorithm): if not has_pipeline_data and session.tuning_session == 'tuning_session': LOG.info("%s: Background tasks haven't ran for this workload yet, " "picking data with lhs.", task_name) + target_data['debug'] = ("Background tasks haven't ran for this workload yet. " + "If this keeps happening, please make sure Celery periodic " + "tasks are running on the server.") if results_cnt == 0 and session.tuning_session == 'tuning_session': LOG.info("%s: Not enough data in this session, picking data with lhs.", task_name) + target_data['debug'] = "Not enough data in this session, picking data with lhs." if skip_ddpg: LOG.info("%s: The most recent result cannot be used by DDPG, picking data with lhs.", task_name) + target_data['debug'] = ("The most recent result cannot be used by DDPG," + "picking data with lhs.") all_samples = JSONUtil.loads(session.lhs_samples) if len(all_samples) == 0: @@ -575,13 +581,14 @@ def check_early_return(target_data, algorithm): newest_result = Result.objects.get(pk=result_id) if target_data.get('status', 'good') != 'good': # No status or status is not 'good' if target_data['status'] == 'random': - info = 'The config is generated by Random' + info = 'The config is generated by Random.' elif target_data['status'] == 'lhs': - info = 'The config is generated by LHS' + info = 'The config is generated by LHS.' elif target_data['status'] == 'range_test': - info = 'Searching for valid knob ranges' + info = 'Searching for valid knob ranges.' else: - info = 'Unknown' + info = 'Unknown.' + info += ' ' + target_data.get('debug', '') target_data_res = create_and_save_recommendation( recommended_knobs=target_data['config_recommend'], result=newest_result, status=target_data['status'], info=info, pipeline_run=None) @@ -877,8 +884,9 @@ def configuration_recommendation(recommendation_input): break res = None - + info_msg = 'INFO: training data size is {}. '.format(X_scaled.shape[0]) if algorithm == AlgorithmType.DNN: + info_msg += 'Recommended by DNN.' # neural network model model_nn = NeuralNet(n_input=X_samples.shape[1], batch_size=X_samples.shape[0], @@ -897,6 +905,7 @@ def configuration_recommendation(recommendation_input): session.save() elif algorithm == AlgorithmType.GPR: + info_msg += 'Recommended by GPR.' # default gpr model if params['GPR_USE_GPFLOW']: LOG.debug("%s: Running GPR with GPFLOW.", task_name) @@ -957,8 +966,7 @@ def configuration_recommendation(recommendation_input): conf_map_res = create_and_save_recommendation( recommended_knobs=conf_map, result=newest_result, - status='good', info='INFO: training data size is {}'.format(X_scaled.shape[0]), - pipeline_run=target_data['pipeline_run']) + status='good', info=info_msg, pipeline_run=target_data['pipeline_run']) exec_time = save_execution_time(start_ts, "configuration_recommendation", newest_result) LOG.debug("\n%s: Result = %s\n", task_name, _task_result_tostring(conf_map_res))