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

Make action unwritable #24218

Closed

Conversation

simonsays1980
Copy link
Collaborator

@simonsays1980 simonsays1980 commented Apr 26, 2022

Why are these changes needed?

As actions could be mutated by users in the environment step() function and produces hardly traecable errors a better solution is to warn users not to mutat the actions (directly). This PR gives a solution by setting the numpy flag WRITEABLE to False in the _env_runner() function whn calling the sampler.

Related issue number

#23890

Checks

  • 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 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 :(

Copy link
Member

@gjoliver gjoliver left a comment

Choose a reason for hiding this comment

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

wow, numpy can do that?!?! we should do this everywhere.
thanks for the tip!

@gjoliver
Copy link
Member

I feel like this change may have exposed a lot of problems with our codebase.
any chance you can take a look at the test failures and see if they are real?
thanks.

@simonsays1980
Copy link
Collaborator Author

@gjoliver This came originally from @sven1977 :)

The errors are due to the fact that actions can be of different type than np.ndarray. I created a new PR that accounts for this. Due to again many problems with git on the branch, I deleted the branch and created a new one. Please find all new changes here.

@stale
Copy link

stale bot commented May 30, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

  • If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@stale stale bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale The issue is stale. It will be closed within 7 days unless there are further conversation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants