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

[RLlib] APPO enhancements (new API stack) vol 03: Fix target network update setting and logic. #48802

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Nov 19, 2024

APPO enhancements (new API stack) vol 03: Fix target network update setting and logic.

  • the frequency setting should be against the NUM_ENV_STEPS_TRAINED_LIFETIME metrics, not SAMPLED(!)
  • the frequency unit should be n from the paper, where n=N [number of batches in buffer] * K [max iterations per batch] * [train batch size].
  • Change the default of target_network_update_freq from 1 to 2. The current setting of 1 makes it such that the network gets updated after each batch update, b/c the unit used (individual timesteps) is wrong.

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 added rllib RLlib related issues rllib-algorithms An RLlib algorithm/Trainer is not learning. rllib-newstack labels Nov 19, 2024
Copy link
Collaborator

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

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

LGTM.

and `train_batch_size_per_learner=500`, then the target net is updated
every 2*4*2*500=8000 trained env steps (every 16 batch updates on each
learner).
The authors in [1] suggests that this setting is robust to a range of
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome. These comments are so helpful!

…_freq

Signed-off-by: Sven Mika <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
…net_update_freq' into appo_enhancements_03_fix_target_net_update_freq
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
…ments_03_fix_target_net_update_freq

# Conflicts:
#	rllib/algorithms/appo/appo.py
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) November 20, 2024 17:09
@github-actions github-actions bot disabled auto-merge November 20, 2024 17:09
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Nov 20, 2024
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) November 21, 2024 12:08
@sven1977 sven1977 merged commit e51cec6 into ray-project:master Nov 21, 2024
6 checks passed
@sven1977 sven1977 deleted the appo_enhancements_03_fix_target_net_update_freq branch November 21, 2024 13:19
jecsand838 pushed a commit to jecsand838/ray that referenced this pull request Dec 4, 2024
…update setting and logic. (ray-project#48802)

Signed-off-by: Connor Sanders <connor@elastiflow.com>
dentiny pushed a commit to dentiny/ray that referenced this pull request Dec 7, 2024
…update setting and logic. (ray-project#48802)

Signed-off-by: hjiang <dentinyhao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-algorithms An RLlib algorithm/Trainer is not learning. rllib-newstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants