Skip to content

feat: added running time statistics for the DS scenario experiment#1007

Merged
WinstonLiyt merged 17 commits intomainfrom
ytli_running_time
Jul 2, 2025
Merged

feat: added running time statistics for the DS scenario experiment#1007
WinstonLiyt merged 17 commits intomainfrom
ytli_running_time

Conversation

@WinstonLiyt
Copy link
Contributor

@WinstonLiyt WinstonLiyt commented Jun 30, 2025

Description

Added running time statistics for the DS scenario experiment.

Motivation and Context

How Has This Been Tested?

  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--1007.org.readthedocs.build/en/1007/

# execute workflow
stdout, execute_ret_code = implementation.execute_ret_code(env=env, entry="python -m coverage run main.py")
running_time = re.search(r"Total running time: (\d+\.\d+) seconds.", stdout).group(1)
implementation.inject_files(**{"running_time.txt": running_time})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have already attrribute in feedback, we don't need a extra file in the worksapce


# execute workflow
stdout, execute_ret_code = implementation.execute_ret_code(env=env, entry="python -m coverage run main.py")
running_time = re.search(r"Total running time: (\d+\.\d+) seconds.", stdout).group(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe be we can create a result class to make it more reasonable and extensible.

class Resuult:
     stdout:
     ret_code:
     execute_time: 

@WinstonLiyt WinstonLiyt marked this pull request as ready for review July 1, 2025 07:32
raise RunnerError(f"Metrics file (scores.csv) is not generated")
exp.result = pd.read_csv(score_fp, index_col=0)

running_time_fp = exp.experiment_workspace.workspace_path / "running_time.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to create and maintain a new file.

)
except docker.errors.APIError as e:
raise RuntimeError(f"Error while pulling the image: {e}")
finally:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

le.prepare()
res, code = le.run_ret_code(local_path=str(code_path))
print(res, code)
res, code, time = le.run_ret_code(local_path=str(code_path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align with the code

@WinstonLiyt WinstonLiyt merged commit 030abd8 into main Jul 2, 2025
9 checks passed
@WinstonLiyt WinstonLiyt deleted the ytli_running_time branch July 2, 2025 07:11
licong01-cloud pushed a commit to licong01-cloud/RD-Agent that referenced this pull request Dec 13, 2025
…icrosoft#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants