Commit Graph

229 Commits

Author SHA1 Message Date
Tim 0dae88e2cd chore: add inference mode for model dump (#1182)
* chore: add inference mode for model dump
* check runtime environment
* update opened_trace_lines
---------

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-08-15 15:34:49 +08:00
amstrongzyf 5b785346f7 fix: refine prompts and add additional package info (#1179)
* refine prompts and add additional package info

* refine prompts to be specific for GBDT models

* minor refine prompts

* use include to replace duplicate info

* refine prompts

* refactor: import DSTrace from base and remove exp_gen __init__

* lint

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-08-13 23:00:23 +08:00
Xu Yang 2764da68a3 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
2025-08-07 15:52:55 +08:00
Roland Minrui 16aadb7a0d fix: refine DSCoSTEER_eval prompts (#1157)
* change DSCoSTEER_eval prompts

* fallback to better exp only

* fix fallback

* fix and reformat

* fix bug when base_fb is None

* add reasoning to hyperparameter evaluation

* feat: add acceptable assessment in exp_feedback (#1159)

* add time

* refine eval prompt and make the logic of tuning check more clear

* some refinement

* fix CI

* fix a small bug, only consider score in runner

* refine comment

* simplify compare function

---------

Co-authored-by: jingyuanlm <842442862@qq.com>
Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: Jensen Lee <91518020+Jensen246@users.noreply.github.com>
Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-08-06 22:55:25 +08:00
Jensen Lee acfbd1b097 fix: ignore case when checking metric name (#1160)
* fix: ignore case when checking metric name

* add case-sensitive to prompts

---------

Co-authored-by: amstrongzyf <amstrongzyf@126.com>
2025-08-06 20:54:08 +08:00
Tim f5d17a1508 feat: enable finetune llm (#1055)
* feat: start with previous workspace

* feat: finetune llm

* add PrevModelLoadEvaluator

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: v-jianwan <v-jianwan@microsoft.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-08-06 12:24:44 +08:00
Xu Yang 0284b73596 feat: refactor CoSTEER classes to use DSCoSTEER and update max seconds handling (#1156)
* feat: refactor CoSTEER classes to use DSCoSTEER and update max seconds handling

* remove useless line

* enable time_ratio_limit_to_enable_hyperparameter_tuning
2025-08-05 18:16:10 +08:00
Paul 50916fa6c9 feat: create Jupyter notebook pipeline file based on main.py file (#1134)
* First commit

* isort

* black

* tweak prompt

* fix for argparse

* fix typo

* add e2e

* Add test files, clean

* fix black settings

* revert

* fix trailing

* remove extra

* comment

* small fix, updated prompt

* Fix argparse

* small improvements

* fix for merge

* fix for merge
2025-08-05 18:06:57 +08:00
Jensen Lee fcfea1943c feat: add mask inference in debug mode (#1154) 2025-08-05 14:09:12 +08:00
amstrongzyf 84b7c30a90 fix: add metric in scores.csv and avoid reading sample_submission.csv (#1152)
* add scores.csv metric name in both task_gen and coder

* a little fix to column names

* small fix

* avoid sample submission read in task_gen

* avoid sample_submission reading in coding

* code change summary bug fix

* little update

* little refinement to eval

* refine coder and runner eval prompts

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-08-04 19:53:08 +08:00
Xu Yang 5b541841cf feat: enhance timeout handling in CoSTEER and DataScience scenarios (#1150)
* add prev loops to runner history

* fix evolving history

* fix bug on initializing feedback without final decision

* reformat

* refine

* add comments

* feat: enhance timeout handling in CoSTEER and DataScience scenarios

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-08-04 17:44:51 +08:00
Roland Minrui f3cb3f8870 feat: add previous runner loops to runner history (#1142)
* add prev loops to runner history

* fix evolving history

* fix bug on initializing feedback without final decision

* reformat

* refine

* add comments

* fix ci

* a little refinement

* fix CI

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-08-04 17:38:27 +08:00
you-n-g 684e41f43a feat: fallback to acceptable results (#1129)
* refactor: add is_acceptable, fallback logic and generify evolving agent

* refine lint

* small

* lint

* lint

* lint

* feat: add is_acceptable to CoSTEERMultiFeedback

* feat: add in-memory workspace checkpoint and recovery

* feat: preserve symbolic links in workspace checkpoints and recovery

* lint

* lint

* feat: limit workspace checkpoint to files under 100KB

* feat: add workspace checkpoint size limit setting

* prompt

* lint
2025-07-31 17:53:18 +08:00
Xu Yang 1aa5cc2535 feat: enhance timeout management and knowledge base handling in CoSTEER components (#1130)
* feat: enhance timeout management and knowledge base handling in CoSTEER components

* fix a little bug

* fix small bug

* fix a small bug

* Update rdagent/scenarios/data_science/loop.py

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

* add scale check

* fix a small bug

* fix CI

* use dynamic chat_token_limit & remove repeated lines

* fix CI

* remove useless comment

* fix small bug

* update draft appendix

* fix prompt

* add code correctness as top priority

---------

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-07-31 13:06:28 +08:00
Xu Yang dd2e06ade6 feat: add coder check and give more time (#1127)
* feat: introduce max_seconds_multiplier for timeout management across components

* avoid using assert in test

* hot fix a very small bug

* runner multiply twice

* revert feedback change

* add a switch to longer timeout
2025-07-29 14:59:38 +08:00
Linlang 99a3cad9c9 chore: implement runtime_env func (#1104)
* implement runtime_env func for quant

* add runtime_info code

* add runtime env information to the prompt

* format with black

* optimize get_runtime_env code

* delete unnecessary files

* some refinement

* fix fin_quant bugs

---------

Co-authored-by: Xu Yang <peteryang@vip.qq.com>
2025-07-28 14:19:41 +08:00
you-n-g f603f2b20f feat: add extra_eval config and import_class for custom evaluators (#1097)
* feat: add extra_eval config and import_class for custom evaluators

* lint

* build: update litellm requirement to >=1.73 for get_valid_models

* refactor: remove *args/**kwargs from _create_embedding_inner_function signature
2025-07-20 16:31:43 +08:00
Tim 34c0848b6c chore: extend eda output (#1086) 2025-07-18 21:07:43 +08:00
Xu Yang 4de0a85114 fix: package and timer bug (#1092)
* fix package bug & timer bug

* fix typo
2025-07-18 16:22:57 +08:00
Xu Yang f99ceb4158 fix: minor fix to runtime_environment (#1089)
* minor fix to funtime_environment

* add python runtime info header
2025-07-17 19:58:06 +08:00
Xu Yang e8c62ab46b feat: query & cache package_info (#1083)
* feat: add package query in draft.py (not yet enabled)

* feat: integrate package query into task_gen and cache runtime environment

- Remove pkg_query modifications from draft components
- Add package declaration requirement in task_gen prompts
- Add optional packages field to CodingSketch model
- Cache runtime_environment in scenario object for loop-wide reuse
- Parse packages from LLM response and generate runtime environment dynamically

* some refinement

* feat: merge default packages with CLI args in package_info.py

* fix: code style

---------

Co-authored-by: Qizheng Li <jenssenlee@163.com>
2025-07-17 18:35:36 +08:00
Xu Yang 9897739ad3 fix: align scenario descriptions and include debug timeout (#1079)
* Align scenario descriptions and include debug timeout

- Updated config.py to support debug timeout configuration
- Synchronized prompts in exp_gen and scen modules
- Refactored proposal.py for consistency with new scenario descriptions
- Improved __init__.py for better scenario management

* remove running time in stdout

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-07-16 14:30:17 +08:00
you-n-g ac55b8bfa1 fix: refine prompt, equal lightgbm, discourage over hypertuning (#1072)
* feat: add mount_path parameter to run command

* feat: add runtime environment info and dynamic timeouts to DS runners
2025-07-15 21:58:19 +08:00
you-n-g 3e6bb27dd1 feat: add ws CLI and support optional timeout/cache (#1066)
* feat: add ws CLI and support optional timeout/cache

* lint

* fix bugs

* convert extra_volumes to dict for multiprocess

* lint
2025-07-12 18:26:45 +08:00
Tim 4c78a601a5 fix: error in prompt template (#1065)
* fix prompt error

* fix prompt error
2025-07-12 09:32:46 +08:00
Yuante Li fa3846df31 refactor: try to convert the DS coder prompt into automaton logic (#1052)
* try to convert the DS coder prompt into automaton logic

* refine

* refine coder

* refine eval

* polish eval

* changes to pipeline_coder_system

* refine eval.py

* merge eval guidelines and steps

* fix a small bug

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: amstrongzyf <amstrongzyf@126.com>
2025-07-11 21:42:52 +08:00
Xu Yang f0f5c221bd feat: add sample submission file check (#1053)
* check sample submission & add  package constraint

* add trace.log into clear

* change default

* simplify

* clear CI workspace before running

* move to CI

* use sudo to clean workspace

* move prepare out of global var

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-07-10 18:10:32 +08:00
Xu Yang 21809f2a9d fix: split then sample & remove simple model guide in ds proposal (#1034)
* fix code timeout & split_then_sample

* change- code

* change-prompts_v2

* remove more simple guidance in proposal

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
Co-authored-by: jingyuanlm <842442862@qq.com>
2025-07-09 15:47:37 +08:00
Xu Yang f1d38d5750 fix: stop evolve if global timer is timeout (#1039) 2025-07-09 15:45:25 +08:00
you-n-g 061554ef87 refactor: add string validation for feedback attrs and remove unused var (#1035) 2025-07-08 20:24:31 +08:00
Roland Minrui 717f9b9e53 fix: add spec for hyperparameters in task design and coder (#995)
* init commit

* remove the 5-fold spec from prompts

* refine the hyperparameter specification

* do not sample data

* a small spelling issue

* refine prompt to avoid submission cheating

* do not sample data

* simplify code

* refine the coder evaluator prompt

* refine wording

* remove runtime from proposal

* refine wording

* refine prompt

* add gpu info in runtime_info.py

* modify the spec

* add router and add refinement exp gen

* fix prompt bug

* use rule-based logic for router

* complete the prompt

* fix circular import bug

* fix bug

* make refine_decision optional

* update pipeline prompts: (1) add scenary: in an iterative cooding loop and use sample datasets (2)add some generation tops in coding (3)add evaluation guidelines in evaluation (4)polish the json schema and description

* fix a small bug

* fix a small bug

* rdagent/scenarios/data_science/loop.py back to the original version

* refactor: replace _get_exp_gen with default_exp_gen for exp generation

* import

* refactor: make the __init__ back to main

* fix small bugs

* fix bugs for proposal_version

* move refine into runner

* check early stop

* EDA improvement & coder classes number

* fix CI

* slightly refine the prompt

* remove rule_base_eval and remove useless prompt

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: TPLin22 <tplin2@163.com>
Co-authored-by: amstrongzyf <amstrongzyf@126.com>
Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
Co-authored-by: Young <afe.young@gmail.com>
2025-07-08 15:22:39 +08:00
amstrongzyf ea86b537eb fix: support experimental support for Deepseek models and update docs about configuration (#1024)
* fix qlib running bug for deepseek and add configuration docs about deepseek
2025-07-07 14:18:56 +08:00
Xu Yang 4608a0c63e feat: try coder on whole data (#1017)
* commit all code

* fix feedback bug

* add debug mode in ds

* update prompt

* prioritize performance than time lit

* use run instead

* store running time

* move all data running into running phase

* fix a bug

* use sample data as default

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-07-04 14:30:40 +08:00
XianBW 6e57d0adc4 chore: ui server updates (#951)
* ui server update

* update

* fix bugs

* updates

* use randomname

* fix

* fix bugs

* change time interval in debug server

* some change

* fix CI

* time interval change

* updates

* some changes

* fix

* fix curves

* one IP, one pointers to show msgs return progress

* enable /control

* fix bugs

* fix CI

* fix isort
2025-07-04 12:32:14 +08:00
Yuante Li 92bb49fc8f fix: fix a minor bug in DS eval (#1012) 2025-07-02 23:31:29 +08:00
Yuante Li 3d227787e8 feat: added running time statistics for the DS scenario experiment (#1007)
* added running time statistics for the DS scenario experiment

* update execute_ret_code to return running_time

* fix

* fix

* update describe

* add EnvResult

* update corresponding calls

* add RunningInfo class

* fix

* fix

* fix

* fix ci

* rename function name

* fix ci

* fix

* refine running_time logic

* fix ci
2025-07-02 15:11:18 +08:00
you-n-g 55f7ccc93d feat: add hide_base_name option and update data folder prompts (#1004)
* feat: add hide_base_name option and update data folder prompts

* rename folder
2025-06-29 21:22:16 +08:00
you-n-g 46367e15f5 fix: refine details (#979)
* feat: add parquet preview and extract common DataFrame preview logic

* refactor: improve error messages, prompts, regex, and session loading

* lint
2025-06-23 10:38:27 +08:00
Xu Yang 977136f1f3 fix: merge datascience v3 and v2 (#974)
* add coder version

* merge cooder and feedback prompts

* align v2 and v3 proposal prompts

* fix a small bug

* fix a bug

* fix another bug

* support both function calling and json mode in v2 proposal

* fix minor bug

* reformat

* remove proposal v3

* fix a small bug in json mode

* fix CI

* remove tmp file

* remove v3 check

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-06-19 13:25:10 +08:00
Linlang dd10ddf9fd fix: main bug (#938)
* feat: parameterize cache paths with USER to avoid conflicts

* guide for missing training_hyperparameters

* guidance for  KeyError: 'concise_reason'

* fixed three bugs in the test

* fix general_model task bug

* fixed some bugs in the med_model scenario

* delete comments

* format with black

* fix mypy error

* fix ruff error

* fix isort error

* sync code

* revert cache_path code

* revert cache_path code

* delete data mining scenario

* fix factor report loop

* fix LiteLLMAPIBackend log_llm_chat_content setting

* refine fin factor report scenario

* remove unused LogColors

* fix UI

* remove medical scenario docs

* change **kaggle** to **data_science**

* remove default dataset_path in create_debug_data

* remove KAGGLE_SETTINGS in kaggle_crawler

* limit litellm versions

* reformat with black

* change README

* fix_data_science_docs

* make hypothesis observations string

* Hiding old versions of kaggle docs

* hidding kaggle agent docs

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: Bowen Xian <xianbowen@outlook.com>
Co-authored-by: yuanteli <1957922024@qq.com>
2025-06-18 14:35:45 +08:00
Yuante Li af5898211b refactor: add custom data setting for data science scene (#967)
* add custom data setting for the data science scene

* fix ci?

* fix ci

* add custom data as an example

* fix ci

* add package

* fix test_import ci error
2025-06-17 14:55:11 +08:00
you-n-g 2187081905 feat: replace hard-coded cache paths with dynamic cache_path config (#952)
* feat: replace hard-coded cache paths with dynamic cache_path config

* style: reorder wait_retry import and format chmod list

* refactor: pass workspace_path to chmod command and use DockerConf check
2025-06-12 17:44:31 +08:00
you-n-g 304d3fad2e 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 de6b7f7648 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 a1843a9c4e feat: log reaching max time limit before breaking CoSTEER evolution (#921) 2025-06-03 12:51:56 +08:00
Yuante Li d6ce70b551 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 9ea44be5f8 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 7aea9a27dc fix: use fallback messages for missing submission and scores files (#882) 2025-05-16 14:39:47 +08:00
you-n-g 586349af36 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 90f6c94d3e fix coder bug (#868)
Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-05-12 17:20:26 +08:00