Skip to content

Commit cec4240

Browse files
authored
feat: improve fallback handling in CoSTEER and add GPU usage guidelin… (#1165)
* feat: improve fallback handling in CoSTEER and add GPU usage guideline in share.yaml * update prompt * update
1 parent 280e3b7 commit cec4240

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

rdagent/components/coder/CoSTEER/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,16 @@ def develop(self, exp: Experiment) -> Experiment:
133133
logger.info("Global timer is timeout, stop evolving")
134134
break
135135

136-
# if the final feedback is not finished(therefore acceptable), we will use the fallback solution.
137136
try:
138-
evo_exp = self._exp_postprocess_by_feedback(evo_exp, self._get_last_fb())
139-
except CoderError as e:
137+
# Fallback is required because we might not choose the last acceptable evo to submit.
140138
if fallback_evo_exp is not None:
141139
logger.info("Fallback to the fallback solution.")
142140
evo_exp = fallback_evo_exp
143-
evo_exp.recover_ws_ckp() # NOTE: recovering checkpoints for restoring files in the workspace to prevent inplace mutation.
144-
else:
145-
e.caused_by_timeout = reached_max_seconds
146-
raise e
141+
evo_exp.recover_ws_ckp()
142+
evo_exp = self._exp_postprocess_by_feedback(evo_exp, self._get_last_fb())
143+
except CoderError as e:
144+
e.caused_by_timeout = reached_max_seconds
145+
raise e
147146

148147
exp.sub_workspace_list = evo_exp.sub_workspace_list
149148
exp.experiment_workspace = evo_exp.experiment_workspace

rdagent/scenarios/data_science/share.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ component_spec:
352352
- You can choose the most proper packages to achieve the task.
353353
- 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.
354354
- For GBDT models, prefer XGBoost or RandomForest over LightGBM unless the SOTA or hypothesis dictates otherwise.
355+
- 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.
355356
- For neural networks, prefer PyTorch or PyTorch based library (over TensorFlow) unless the SOTA or hypothesis dictates otherwise.
356357
- For neural networks, prefer fine-tuning pre-trained models over training from scratch.
357358

0 commit comments

Comments
 (0)