Commit Graph

624 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
xuangu-fang 235fcd308a feat: enable to set different version of idea-proposal for multi traces (#895)
* fix the logic of kb-inject, allow different verion

* set more flexiable proposal-version change for multi-tarce

* auto-lint

* fix the divede-zero-bug in a trival way

* keep the dump imp. first, update in next version

* use get_sub_trace_count() to get trace_num_count

* fix the conern case bug of divide-zero

* update corner case

* fix the bug

* auto-lint

* fis the bug

* fix the logic bug in max_sota_filter

* fix bug of old version of self.exp_gen.gen

* update the reset_exp_gen_version

* use get_parent_exps to replace all  collect_all_ancestors

* auto lint

* fix the bug of reset_exp_gen_version

* fix bug: update V3's old hypothesis_rank

* trival patch on gap of V3 & V2

* make dump patch to unify proposal_V3's dentify_problems

* auto-lint

* fix the bug of sub_trace_count
2025-06-11 23:13:30 +08:00
Tim a2e434448a fix: 'DSProposalV2ExpGen' object has no attribute 'COMPONENT_TASK_MAP… (#950)
* fix: 'DSProposalV2ExpGen' object has no attribute 'COMPONENT_TASK_MAPPING'
* chore: add get_component function
2025-06-09 21:49:46 +08:00
Jensen Lee eca0d88e0a fix: filter system metadata dirs and init missing DSTrace attribute (#946)
* fix: filter system metadata dirs and init missing DSTrace attribute

* style:pre-commit
2025-06-07 19:44:23 +08:00
Tim 60f3c99556 chore: continue to read output (#945) 2025-06-07 13:22:56 +08:00
Linlang c8f1c5364a chore: add a rdagent server with UI & logger storage refinement(#553)
* change_log_object

* lint code

* delete comments

* change_log_object

* change_log_object

* fix import test error

* update code

* update code

* fix bugs

* skip mypy error

* skip mypy error

* skip mypy error

* Start the flask server before running the demo.

* achieve front and back interaction

* fix github-advanced-security comments

* fix github-advanced-security comments

* tmp ignore

* fix CI

* move some logic

* change format

* adjust logic

* log2json changes

* tmp

* fix

* fix bug

* refine log2json between 5 scenarios

* fix

* refine codes

* fix logic

* use localhost

* add loop & all_duration param for old scenario startup

* merge control logic

* add README for server ui api

* update README

* reuse code in logger

* add loop_n and all_duration param

* fix upload

* ui server now use port in setting

* fix port setting

* fix port setting

* fix mypy check

* refine logger and log storage

* fix ruff error

* fix CI

* refine logger, loop, storage

* bind one FileStorage with one logger

* not truncate log storage

* refine LoopBase.load(), use `checkout` instead of `output_path` and `do_truncate`

* clear session folder when loading loop to run

* move component info init step to ExpGen Class

* Update rdagent/utils/workflow.py

* move truncate_session function to LoopBase class

* add checkout param for other scenarios

* fix bug

* move WebStorage to UI

* change web_storage name

* add randomname to requirements

* add typer

* fix requirements

---------

Co-authored-by: WinstonLiyte <1957922024@qq.com>
Co-authored-by: Bowen Xian <xianbowen@outlook.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-06-06 18:52:19 +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
Tim 6ce765f05d fix: conda error information (#941)
* test with conda error

* reformat
2025-06-06 11:45:48 +08:00
XianBW 83dd0de98a change qlib install method (#937) 2025-06-05 11:40:46 +08:00
XianBW 3e5c587e13 refine debug window logic (#936) 2025-06-05 11:29:37 +08:00
XianBW d0d050eee4 fix detect scenario logic (#935) 2025-06-05 11:19:09 +08:00
XianBW 2ffeb9e3e2 some update (#934) 2025-06-05 10:56:54 +08:00
Tim 7518ab66fa fix: ds trace (#929)
* fix: remove_ansi_codes
* chore: rename function
2025-06-04 18:30:29 +08:00
Tim bb71c18080 feat: merge selectively (#888)
* chore: avoid incorporate changes
best as sota
merge hypothesis
fix: max_retrieve_num after decision
chore: select last experiments and feedbacks
* add the set_current_selection before the exp_gen when merging
add trace.NEW_ROOT
fix: no scen_prob_multiplier
fix: use regex with timeout
chore: hypothesis_rank with selected_idx
chore: define is_parent in proposal
chore: rename collect_all_ancestors to get_parent_exps
---------

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-06-04 14:46:47 +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
you-n-g fca945c77f fix: default cost to NaN when calculation fails in LiteLLM backend (#912)
* fix: default cost to NaN when calculation fails in LiteLLM backend

* lint

* lint
2025-05-29 22:58:29 +08:00
you-n-g 9e854a1346 feat: add last_exp_fb to DSTrace and update feedback retrieval usage (#910)
* feat: add last_exp_fb to DSTrace and update feedback retrieval usage

* fix: use trace.last_exp_fb for previous trial feedback description
2025-05-29 20:32:06 +08:00
Tim a9e223951f chore: withdraw for policy error (#907)
* chore: withdraw for policy error

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

* Apply suggestions from code review
2025-05-29 17:23:06 +08:00
Tim 15e8785f6c fix: use trace count as index (#909) 2025-05-29 16:52:37 +08:00
XianBW 249d6f9810 fix loop_num calc logic (#911) 2025-05-29 16:40:57 +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
Haoran Pan b0e88c7375 feat: enhance compatibility with more LLM models (#905)
* add try-except to avoid retry when using completion_cost

* feat: add JSON prompt injection and think tag removal handling

* refactor: simplify cost handling in LiteLLM backend and clean up style

* docs: clarify purpose of reasoning_think_rm in LLMSettings

* refactor: remove unused *args and redundant cost assignment

---------

Co-authored-by: Young <afe.young@gmail.com>
2025-05-29 15:21:34 +08:00
Roland Minrui 4ba28aa15f fix: fix the problems weights bug (#898)
* fix the problems weights bug

* refactor: remove DSExpGen

* update problems weights calculation

* update problems weights calculation

* remove the selection parameter from exp_gen

* v2 support draft

* v3 also support decomposition

* make the identify_problems an independent function

* fix minor bug

* reformat

* rename exp_num to weighted_exp_num

* add the set_current_selection before the exp_gen when merging

* reformat

* fix wrong selection

* refactor: drop selection arg from ExpGen.gen and DS merge generators

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-05-28 11:14:37 +08:00
amstrongzyf 14989d74f0 docs: add docstring for confusing columns in logs dir (#902)
* Docs updated

docs: add docstring for confusing columns in ds-summary

* update

* update black format
2025-05-27 20:54:32 +08:00
Roland Minrui 8da398f27a fix: refine feedback prompt (#901)
* feedback observation must base on evidence

* avoid too strong constrain

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
2025-05-27 19:41:23 +08:00
Tim 903403a90c chore: add kill after for timeout (#899) 2025-05-27 12:02:22 +08:00
XianBW 41095a0829 add select_best param for log.ui.utils.compare tool function (#897) 2025-05-23 18:32:31 +08:00
Yuante Li fdbffae4d7 fix: fix the bug in the regular expression matching for stdout (#890) 2025-05-23 14:13:31 +08:00
Tim b59d05b1f7 feat: raise policy violation (#894) 2025-05-22 16:54:34 +08:00
xuangu-fang 90400c666c fix: fix the bug of Exceed-LLM-Context in online merge of multi-tarce (#892)
* set constrains on max_sota_retrieved, fix logis on identical problem

* fix: only Auto SOTA selector use max_sota_retrieved_num

* set max_sota_retrieved_num=10 by default

* minor update

* auto lint
2025-05-22 16:10:00 +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
XianBW a12b2fe9ee chore: organize the tool functions related to trace and summary (#889)
* provide get metric direction in kaggle_crawler.py

* move utils function

* move statistics logic

* fix CI

* fix CI

* fix CI

* fix CI

* move some tool functions

* fix CI

* move curves win

* add compare tool

* change function name

* fix CI
2025-05-21 17:20:31 +08:00
xuangu-fang 6f29e4e3bc feat: multi-trace online merge (#886)
* prompt: highlight overfitting rist in AutoSOTAexpSelector

* set online merge time in conf

* online multi-trace merge with time-limit policy

* fix typo

* feat: allow soft-knowledge-base + multi_trace

* fix: improve file tree and _walk symlink handling (#877)

* refactor: improve file tree and _walk symlink handling

* remove unused code

* lint

* prompt: highlight overfitting rist in AutoSOTAexpSelector

* set online merge time in conf

* online multi-trace merge with time-limit policy

* fix typo

* feat: allow soft-knowledge-base + multi_trace

* auto-lint

* put the multi-trace related config together

---------

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
2025-05-19 17:59:42 +08:00
XianBW 89deb019e9 chore: ui bug fix (#884)
* bug fix

* bug fix

* test ci

* bug fix

* ci fix

* ci fix
2025-05-18 11:08:41 +08:00
XianBW db1656bb4c chore: log storage refine (#883)
* log storage change

* fix bug

* fix ci
2025-05-16 18:29:59 +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
you-n-g da6f662dda fix: improve file tree and _walk symlink handling (#877)
* refactor: improve file tree and _walk symlink handling

* remove unused code

* lint
2025-05-16 00:11:25 +08:00
XianBW 5e1292974b fix debug_tpl and debug_llm saving method(#874) 2025-05-15 18:37:51 +08:00
you-n-g d0b9ad8c12 feat: add competition level filter and extract constants to utils (#869)
* feat: add competition level filter and extract constants to utils

* lint
2025-05-12 21:56:57 +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
you-n-g e2bc29152d feat: truncate by time (#863)
* refactor: move session file lookup logic to folder utils module

* print more info

* lint
2025-05-10 00:42:59 +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
Xu Yang fa53473b6c fix: typo in workflow (#861) 2025-05-09 13:29:36 +08:00
Xu Yang 1fd8abce0f feat: log api status to mlflow (#860)
* log api status to mlflow to frontend tracking

* fix CI

---------

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-05-09 12:20:49 +08:00
Xu Yang 5fecefb802 make timeout fail a hyper parameter (#859)
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-05-08 21:30:44 +08:00
XianBW 6fbe213f3d change method of cut log trace (#858) 2025-05-08 21:07:33 +08:00
Roland Minrui 24c4eb7225 fix: refine the time/memory constraints prompt in hypothesis proposal (#856)
* refine prompt

* refine the wording

* add ratelimit retry to align with the suggested wait seconds

* add max retry to 0

* don't delete hist

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
2025-05-08 21:05:07 +08:00
XianBW 9df59eb7f0 add cache for summary, remove workspace dependency when generate summary (#854) 2025-05-08 12:24:48 +08:00