diff --git a/rdagent/components/coder/CoSTEER/__init__.py b/rdagent/components/coder/CoSTEER/__init__.py index 7b790c649..b7da40a54 100644 --- a/rdagent/components/coder/CoSTEER/__init__.py +++ b/rdagent/components/coder/CoSTEER/__init__.py @@ -133,17 +133,16 @@ def develop(self, exp: Experiment) -> Experiment: logger.info("Global timer is timeout, stop evolving") break - # if the final feedback is not finished(therefore acceptable), we will use the fallback solution. try: - evo_exp = self._exp_postprocess_by_feedback(evo_exp, self._get_last_fb()) - except CoderError as e: + # Fallback is required because we might not choose the last acceptable evo to submit. if fallback_evo_exp is not None: logger.info("Fallback to the fallback solution.") evo_exp = fallback_evo_exp - evo_exp.recover_ws_ckp() # NOTE: recovering checkpoints for restoring files in the workspace to prevent inplace mutation. - else: - e.caused_by_timeout = reached_max_seconds - raise e + evo_exp.recover_ws_ckp() + evo_exp = self._exp_postprocess_by_feedback(evo_exp, self._get_last_fb()) + except CoderError as e: + e.caused_by_timeout = reached_max_seconds + raise e exp.sub_workspace_list = evo_exp.sub_workspace_list exp.experiment_workspace = evo_exp.experiment_workspace diff --git a/rdagent/scenarios/data_science/share.yaml b/rdagent/scenarios/data_science/share.yaml index 52f74caae..26fe56e1f 100644 --- a/rdagent/scenarios/data_science/share.yaml +++ b/rdagent/scenarios/data_science/share.yaml @@ -352,6 +352,7 @@ component_spec: - You can choose the most proper packages to achieve the task. - When facing a choice between two packages which both can achieve the same goal, you should choose the one which is more commonly used and less likely to cause bugs in coding. Especially those you are not familiar with. - For GBDT models, prefer XGBoost or RandomForest over LightGBM unless the SOTA or hypothesis dictates otherwise. + - To use GPU in training, always implement a check to ensure that the GPU is available and use it if possible. Fallback to CPU if GPU is not available. Especially in GBDT models, you might get error when you call `fit` method without checking the GPU availability. Add a try except block to handle this case. - For neural networks, prefer PyTorch or PyTorch based library (over TensorFlow) unless the SOTA or hypothesis dictates otherwise. - For neural networks, prefer fine-tuning pre-trained models over training from scratch.