Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine RL workflow & tune RL models under GYM #577

Merged
merged 49 commits into from
Feb 17, 2023
Merged

Conversation

lihuoran
Copy link
Contributor

@lihuoran lihuoran commented Feb 6, 2023

Description

  • Refine RL workflow
    • Refine rollout workflow. Now we can:
      • Run specific number of steps in rollout.
      • Use num_eval_episodes to control the number of episodes during evaluation.
    • Add AbsEnvSampler.metrics. Let env samplers use this attribute to manage metrics during rollout.
    • Add Callback, a generate interface to add customized operations in each phase of the workflow. Add two Callback instances: Checkpoint & MetricsRecorder.
    • Other miner code refinements.
  • Tune RL models under GYM
    • Add DDPG. Optimize the performance of PPO, SAC, and DDPG.
    • Fix several RL algorithm bugs.
    • Re-organize RL jobs' output paths.
    • Re-organize RL test's file structure.

Linked issue(s)/Pull request(s)

Type of Change

  • Non-breaking bug fix
  • Breaking bug fix
  • New feature
  • Test
  • Doc update
  • Docker update

Related Component

  • Simulation toolkit
  • RL toolkit
  • Distributed toolkit

Has Been Tested

  • OS:
    • Windows
    • Mac OS
    • Linux
  • Python version:
    • 3.7
    • 3.8
    • 3.9
  • Key information snapshot(s):

Needs Follow Up Actions

  • New release package
  • New docker image

Checklist

  • Add/update the related comments
  • Add/update the related tests
  • Add/update the related documentations
  • Update the dependent downstream modules usage

@lihuoran lihuoran requested a review from Jinyu-W February 6, 2023 05:58
@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Merging #577 (9371949) into v0.3 (214383f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             v0.3     #577   +/-   ##
=======================================
  Coverage   79.30%   79.30%           
=======================================
  Files          86       86           
  Lines        5464     5464           
=======================================
  Hits         4333     4333           
  Misses       1131     1131           
Flag Coverage Δ
unittests 79.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

lihuoran and others added 2 commits February 8, 2023 13:53
* remove useless files; add device mapping; update pdoc

* add default checkpoint path; fix distributed worker log path issue; update example log path

* update performance doc

* remove tests/rl/algorithms folder
@@ -10,7 +10,7 @@

job: cim_rl_workflow
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO: runtime error

maro/rl/workflows/callback.py Outdated Show resolved Hide resolved
maro/rl/workflows/callback.py Outdated Show resolved Hide resolved
maro/rl/workflows/callback.py Show resolved Hide resolved
maro/rl/workflows/callback.py Show resolved Hide resolved
maro/rl/rollout/env_sampler.py Outdated Show resolved Hide resolved
maro/rl/rollout/env_sampler.py Show resolved Hide resolved
lihuoran and others added 4 commits February 9, 2023 15:20
* [wip] compare PPO

* PPO matching

* Revert unnecessary changes

* Minor

* Minor
* fix sac to_device issue; update sac gym test parameters

* add rl test performance plot func

* update sac eval interval config

* update sac checkpoint interval config

* fix callback issue

* update plot func

* update plot func

* update plot func

* update performance doc; upload performance images

* Minor fix in callbacks; refine plot.py format.

* Add n_interactions. Use n_interactions to plot curves.

* pre-commit

---------

Co-authored-by: Huoran Li <huo53926@126.com>
Co-authored-by: Huoran Li <huoranli@microsoft.com>
* Add truncated logic

* (To be tested) early stop

* Early stop test passed

* Test passed

* Random action. To be tested.

* Warmup OK

* Pre-commit

* random seed

* Revert pre-commit config
@Jinyu-W Jinyu-W merged commit b8a955e into v0.3 Feb 17, 2023
@lihuoran lihuoran deleted the rl_workflow_refine branch February 22, 2023 04:53
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.

None yet

2 participants