Commit Graph

220 Commits

Author SHA1 Message Date
you-n-g 09be71d586 feat: parallel loop running based on asyncio (#932)
* refactor: split workflow into pkg, add WorkflowTracker & wait_retry

* feat: add async LoopBase with parallel workers and step semaphores

* fix: replace pickle with dill and run blocking tasks via joblib wrapper

* feat: add log format settings, dynamic parallelism & pickle-based snapshot

* fix: default step semaphore to 1 and avoid subprocess when single worker

* merge bowen's changes

* merge tim's changes

* refactor: extract component task mapping, add conditional logger setup

* lint

* refactor: add type hints and safer remain_time metric logging in workflow

* lint

* fix: allow BadRequestError to be pickled via custom copyreg reducer

* fix: stop loop when LoopTerminationError is raised in LoopBase

* lint

* refactor: make log tag context-local using ContextVar for thread safety

* feat: add subproc_step flag and helper to decide subprocess execution

* fix: use ./cache path and normalize relative volume bind paths

* fix: reset loop_idx to 0 on loop restart/resume to ensure correct flow

* fix: avoid chmod on cache and input dirs in Env timeout wrapper

* fix: skip chmod on 'cache' and 'input' dirs using find -prune

* fix: restrict chmod to immediate mount dirs excluding cache/input

* fix: chmod cache and input dirs alongside their contents after entry run

* fix: guard chmod with directory checks for cache and input

* fix: prefix mount_path in chmod command for cache/input dirs

* fix: drop quotes from find exclude patterns to ensure chmod executes

* fix: skip chmod on cache/input directories to avoid warning spam

* feat: support string volume mappings and poll subprocess stdout/stderr

* support remove symbolic link

* test: use dynamic home path and code volume in LocalEnv local_simple

* fix: skip trace and progress update when loop step is withdrawn

* refactor: add clean_workspace util and non-destructive workspace backup

* fix: preserve symlinks when backing up workspace with copytree

* fix: prevent AttributeError when _pbar not yet initialized in LoopBase

* perf: replace shutil.copytree with rsync for faster workspace backup

* fix: cast log directory Path to str in tar command of data science loop

* fix: use portable 'cp -r -P' instead of rsync for workspace backup

* fix: add retry and logging to workspace backup for robustness

* refactor: extract backup_folder helper and reuse in DataScienceRDLoop

* fix: propagate backup errors & default _pbar getattr to avoid error

* fix the division by zero bug

* refactor: execute RD loops via asyncio.run and add necessary imports

* lint

* lint

* lint

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-06-12 11:44:14 +08:00
Haoran Pan 3490719259 feat: update prompt to improve json respond format of some LLM models (#928)
* update prompt to improve json respond format of some LLM models

* fix

* fix

---------

Co-authored-by: WinstonLiyte <1957922024@qq.com>
2025-06-06 11:49:40 +08:00
you-n-g 4aae5b6854 feat: log reaching max time limit before breaking CoSTEER evolution (#921) 2025-06-03 12:51:56 +08:00
Yuante Li d1019cb568 feat: add RD-Agent-Quant scenario (#838)
* fix model input shape bug and costeer_model bug

* fix a bug

* fix a bug in docker result extraction

* a system-level optimization

* add a filter of stdout

* update

* add stdout to model

* model training_hyperparameters update

* quant scenario

* update some quant settings

* llm choose action

* Thompson Sampling Bandit for action choosing

* refine both scens

* add trace messages for quant scen

* fix some bugs

* fix some bugs

* update

* update

* update

* fix

* fix

* fix

* update for merge

* fix ci

* fix some bugs

* fix ci

* fix ci

* fix ci

* fix ci

* refactor

* default qlib4rdagent local env downloading

* fix ci

* fix ci

* fix a bug

* fix ci

* fix: align all prompts on template (#908)

* use template to render all prompts

* fix CI

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>

* add fin_quant in cli

* fix a bug

* fix ci

* fix some bugs

* refactor

* remove the columns in hypothesis if no value generated in this column

* fix a bug

* fix ci

* fix conda env

* add qlib gitignore

* remove existed qlib folder & install torch in qlib conda

* fix workspace ui in feedback

* align model config in coder and runner in docker or conda

* fix CI

* fix CI

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-05-29 16:16:51 +08:00
Yuge Zhang 74fe166687 feat: new proposal (structured outputs) prompts (#887)
* some initial modifications

* first prompt

* refine prompts

* isolate to v3 exp gen

* Revert prompts

* Add hypothesis

* task gen prompt

* minor updates

* minor updates

* update proposal

* Move the pydantic schema upfront to avoid loading error

* Update first prompts

* New prompt

* Update prompt

* Update data folder

* .

* Revert changes

* support v3 in pipeline and feedback

* sort imports

* black format

* Update rdagent/scenarios/data_science/dev/prompts.yaml

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-05-22 15:08:33 +08:00
you-n-g db8eec7394 fix: use fallback messages for missing submission and scores files (#882) 2025-05-16 14:39:47 +08:00
you-n-g 60ec58f5df fix: update DS env setup with competition volume and timeout (#878)
* refactor: update DS env setup with competition volume and timeout

* refactor: update volume mapping and timeout based on run type
2025-05-16 02:05:15 +08:00
Roland Minrui b8fb9cf3b4 fix coder bug (#868)
Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-05-12 17:20:26 +08:00
Tim eb5f69024a chore: custom data refine (#864)
* chore: print up to 100 columns in simple mode

* fix: check content for model dump

* chore: add show_nan_columns config
2025-05-10 17:02:12 +08:00
xuangu-fang bb96fc84f6 feat: advanced checkpoint selectors (#790)
* rebase selection code

* bug-free run: checkpoint selection and dynamic EDA loading

* add prototypes of various selectors, to imp. and test later

* fix EDA write bug

* imp SOTA-Jump policy

* fix small bug

* allow to set different selector by .env

* add always-win selector

* add init length for AlwaysWinCKPSelector

* add back_jump selector

* auto lint

* add sota_exp_to_submit attribute; change the name of ckp_selector and sota-selector

* fix bug

* auto lint

* working on auto sota selector

* add subtrace counter

* fix bug, remove unuse selector

* add auto sota selector

* auto lint

* fix bug

* fix small logic bug

* add logging

* add inject_diverse feat

* auto lint

* capable to None-select

* feat: add hypothesis_gen config and ExpGen2TraceAndMerge functionality

* refactor: use dynamic import for experiment generator instantiation

* feat: add BestValidSelector for improved SOTA experiment selection

* runnable twin-trace version

* fix logic error of trace-merge

* auto lint

* use import_class to set selector,

* auto-lint

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-05-09 15:38:25 +08:00
Tim 3b7bafae12 chore: dump test data (#850)
* debug path for model dump
* update prompt
2025-05-07 17:24:50 +08:00
Tim 46dec7b624 feat: custom data (#810)
* custom data

* fix: simplify competition check and log local description file

* no sample data

* feat: add test evaluation module with error handling support

* fix: update eval path to use eval_sub_dir and add valid_check TODO

* refactor: add MLETestEval check to conditionally run grading steps

* avoid blank stdout

* valid in testeval

* rename test.csv to avoid conflict

* Support Disabling sample submission

* refactoring

* fix: remove DS_KAGGLE_DATA and update prompt instructions

* add try for grade

* ignore submission

* fix: remove tee from eval command and warn about pipeline exit code detection

* optional to use raw description

* support old data

* add execution result to stdout

* add metric to raw description

* custom data explain

* add debug_path

* rst update

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-05-06 16:00:13 +08:00
Haoran Pan acc15caf7b feat: reanalyze competition info & pipeline coding evaluator prompt (#837)
* update coding evaluator prompt similar to feedback

* reanaylyzing competition description when three sonsecutive coding failures

* update reanalyzing competition implementation

* fix bug

* update prompts and reanalyze

* fix bugs

* ci issue

* improve some code

* fix CI

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-04-30 17:36:35 +08:00
Yuante Li 44ccee864d fix: fix model input shape bug and costeer_model bug (#821)
* fix model input shape bug and costeer_model bug

* fix a bug
2025-04-24 12:48:25 +08:00
Yuante Li 18a115b4e0 fix: fix some minor bugs in qlib scenario (#817)
* fix some bugs

* fix a bug

* fix a bug in qlib frontend

* fix ci

* fic ci

* fix qlib Dockerfile
2025-04-23 18:48:02 +08:00
Roland Minrui 6fe9be19cd feat: idea pool integrated to exp_gen & add timer to RD-Agent & pause-resume to RD-loops (#795)
* update all code

* update all code

* dump knowledge base

* rename the tag

* add timer to RD-Agent

* fix CI

* fix CI

* use batch embedding

* fix a small bug

* fix prompt bug

* feat: add pause resume to handle K8S cluster pause (#804)

* add resume to cluster running

* fix non-pickle problem

* fix a small bug

* fix a small bug

* avoid shutil move error

* refine the logic

* move knowledge base out of session

* avoid mistake information to pipeline coding

* avoid load and dump in steps

* archive the right folder

* small improvement

* avoid restart when timer is already started

* fix CI

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-04-18 14:01:03 +08:00
you-n-g d46d27375d refactor: use remove_eda_part for EDA cleanup, fix diff eval (#800) 2025-04-17 16:19:26 +08:00
you-n-g a974dd9ba3 refactor: use dynamic input path and update template loader (#792)
* refactor: use dynamic input path and update template loader

* fix: update include syntax for data source in prompts.yaml

* add customization path

* docs: update prompts for ensemble scoring and metric direction

* chore: remove obsolete data_science/share.yaml file
2025-04-16 18:11:46 +08:00
you-n-g e05a645ad4 feat: refine prompt (#760)
* style: Simplify language and improve clarity in prompts and share.yaml

* style: Update prompt wording for clarity in raw_data_loader

* style: Simplify conditional logic in task_gen system prompt

* refactor: Update prompts and proposal for component output format handling

* fix: Correct grammar and add clarification in prompts.yaml

* feat: Include coding guidelines in data science component prompts

* lint
2025-04-16 09:35:30 +08:00
you-n-g f0d9919d93 fix: import path of T (#787)
* feat: add DocDev for auto-generating workspace documentation

* fix: update markdown instructions in tpl.yaml

* feat: add enable_doc_dev flag and conditionally call DocDev

* refactor: update T import and prompt keys for DocDev

* fix: update include path for MarkdownOut template

* fix: update file search, README injection, and brief prompt text

* docs: update prompt to only introduce models

* lint
2025-04-13 10:21:24 +08:00
you-n-g 453265705e feat: add DocDev for auto-generating workspace documentation (#781)
* feat: add DocDev for auto-generating workspace documentation

* fix: update markdown instructions in tpl.yaml

* feat: add enable_doc_dev flag and conditionally call DocDev
2025-04-10 20:12:21 +08:00
Tim a6ae88fb42 chore: fit more competition (#723)
1. Remove potential <code> tags from the generated code.
2. Use return codes in data_loader, feature, and model.
3. Configure the debug timeout.
2025-04-10 17:56:57 +08:00
you-n-g bbc591b401 feat: dump model (#776)
* feat: add model dump flag and multi-evaluator support

* tmp code

* refactor: update evaluator feedback and FBWorkspace types

* feat: add get_clear_ws_cmd and CPU count in Docker environment

* feat: Add model dump check level and enhance evaluator functionality

fix data type bug

* fix: Ensure required files exist before model dump evaluation

* refactor: streamline prompt and file checks in model dump evaluation

* fix: add assertions and reorder file reads in model dump evaluator

* feat: remove EDA part from evaluation output

* docs: update dump_model guidelines and eval prompt to include template

* style: reformat multiline dicts and lists in conf and eval files

* fix: add DOTALL flag to EDA removal regex
2025-04-09 23:24:12 +08:00
xuangu-fang fd155d1fa8 feat: checkpoint selection (#744)
* rebase selection code

* bug-free run: checkpoint selection and dynamic EDA loading

* add prototypes of various selectors, to imp. and test later

* fix EDA write bug

* move selector to from proposal.py tp seletc.py

* auto lint

* fix line-too-long typos

* aligh the design of "selection", rm extra instance check

* make auto-lint

* add non-trival selector: SOTAjump
2025-04-09 09:42:30 +08:00
Xu Yang f092739ab5 add rule-based eval to speed up the whole process (#768) 2025-04-08 17:27:21 +08:00
XianBW e7f3cf97ec fix: duplicate model names test in pipeline coder & runner (#763)
* add model name duplicate test in pipeline costeer

* fix ci
2025-04-07 19:06:42 +08:00
you-n-g 6be6b8408f feat: add naive experiment generator and update proposal configurations (#759)
* feat: Add naive experiment generator and update proposal configurations

* lint

* lint
2025-04-07 13:01:29 +08:00
Yuante Li ebff475f14 fix: fix some minor bugs (#758) 2025-04-04 23:54:54 +08:00
Yuante Li 0a75a4d987 feat: add a check for whether values in score_df are NaN (#756)
* add a check for whether values in score_df are NaN

* fix ci

* change raise to assert
2025-04-04 22:44:55 +08:00
Tim 43c8ed2aaf feat: joblib cache (#749)
* cache function

* fix test

* bin cache

* fix test

* fix test

* fix test

* cache for different source

* cache for localenv

* remove unnecessary log

* reformat

* remove unrelated modify
2025-04-04 12:08:18 +08:00
Tim 7f82894fc2 workflow entrypoint check (#748) 2025-04-04 12:07:46 +08:00
you-n-g d82442f2ed refactor: Improve data handling and representation in eval tests and prompts (#740) 2025-04-03 13:53:25 +08:00
Roland Minrui 6cc1e5da3c feat: add pipeline coder (#742)
* init commit

* limit problem numbers

* ensemble lower case

* add runtime and spec to coder

* submission check notice

* sub EDA in sample execution

* avoid lightgbm

* add time limit to scenario

* rephrase the submission check

* give positive feedback when facing warning in check

* ENABLE FEEDBACK

* fix feedback bug

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-04-03 13:00:11 +08:00
Haoran Pan f752cf5a48 fix: replace func "len()" in ensemble test code to support various data type (#739)
* replace len with def get_length

* update get_length implementation
2025-04-02 19:52:54 +08:00
Xu Yang f18c1828c8 costeer max loop as hyperp & skip workflow in eval (#737) 2025-04-02 14:18:42 +08:00
you-n-g 3d6ae62ad5 feat: loader prompt & simplify YAML loading and update data loader specifications (#736)
* refactor: Simplify YAML loading and update data loader specifications

* docs: Add comment explaining FunctionLoader usage in tpl.py

* lint

* lint
2025-04-01 22:36:25 +08:00
you-n-g cc063dd646 feat: update prompts and descriptions for data science components (#731)
* docs: Update prompts and descriptions for data science components

* chore: Remove outdated comments from conf.py

* feat: Add metric_name attribute to DataScienceScen class

* style: Update description in prompts.yaml and reorder metric_name init

* docs: Update prompts.yaml with feature engineering guidelines
2025-04-01 20:54:42 +08:00
XianBW b13575dc69 fix: add metric name check for valid scores (#724)
* update metric_name

* fix some bugs

* add an evaluation in workflow

* add an evalution in runner

* fix ci

* test change

* fix CI

---------

Co-authored-by: TPLin22 <tplin2@163.com>
Co-authored-by: yuanteli <1957922024@qq.com>
2025-03-27 19:36:57 +08:00
XianBW 7733841f1c feat: make spec optional (#719)
* feat: Add spec_enabled configuration for data science settings

* make spec alternative

* change spec logic in exp_gen

* remove some general texts

* align

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: yuanteli <1957922024@qq.com>
2025-03-27 17:17:41 +08:00
Linlang 78757aeed7 refactor: remove unused code and update documentation in CoSTEER module (#720)
* refactor: Remove unused code and update documentation in CoSTEER module

* fix mypy error

* fix black error

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-03-26 22:48:01 +08:00
Yuante Li 0624ed180f fix: fix a bug in ensemble test script (#713)
* fix a bug in ensemble test script

* fix

* add a comment
2025-03-20 17:35:39 +08:00
XianBW 8c4d6b9686 change only model codes in model coder (#707) 2025-03-19 19:37:26 +08:00
Yuante Li 8133e4dcde feat: add cross validation to workflow (#700) 2025-03-19 17:56:42 +08:00
XianBW e21b334741 feat: out spec change for o1-preview (#666)
* add not_json batcheditout

* ensemble out_spec change

* feature out_spec change

* model out_spec change

* workflow out_spec change

* runner debugger out_spec change

* filter_progress_bar return format fix

* data_loader and spec out_spec change

* show finish_reason in llm log

* json_mode fix

* remove hardcode

* fix CI

* fix grammer

* complete PythonBatchEditOut logic

---------

Co-authored-by: yuanteli <1957922024@qq.com>
2025-03-18 17:43:44 +08:00
Ikko Eltociear Ashimine 32dda6ea63 refactor: update evolving_strategy.py (#686)
implmentation -> implementation
2025-03-18 16:15:08 +08:00
XianBW 0fe901d8cd fix: add check when retrying gen model codes (#699)
* add check when retrying gen model codes

* fix CI
2025-03-18 15:59:34 +08:00
Yuante Li 3e9ba73c2f feat: add model removal and adjust some framework logic (#681)
* prune model task

* add component_description

* add model removal logic to component, hypo, and task gen

* fix ci

* adjust coder to meet the requirement of model removal

* fix and refine the logic of model removal

* add model removal logic in model_eval

* fix ci

* fix ci

* prune some unnecessary codes
2025-03-18 14:42:53 +08:00
XianBW 229866123b fix preds_dict's keys (#695) 2025-03-17 23:33:17 +08:00
XianBW 4c9c29d244 fix: runner COSTEER evaluator (#693)
* fix scores.csv and submission.csv check in runner eval

* add coverage check info in running COSTEER feedback

* feedback value fix
2025-03-17 23:12:59 +08:00
Yuante Li 6a6c9832f4 fix: fix a minor bug (#694) 2025-03-17 21:43:26 +08:00