Skip to content

Conversation

@yingchenlin
Copy link
Contributor

Description

Draft PR of Brax envs

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 1, 2022
@vmoens vmoens added the enhancement New feature or request label Dec 8, 2022
@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #722 (d04cc38) into main (bb3c271) will increase coverage by 0.06%.
The diff coverage is 94.23%.

@@            Coverage Diff             @@
##             main     #722      +/-   ##
==========================================
+ Coverage   88.72%   88.79%   +0.06%     
==========================================
  Files         120      122       +2     
  Lines       20241    20492     +251     
==========================================
+ Hits        17958    18195     +237     
- Misses       2283     2297      +14     
Flag Coverage Δ
habitat-gpu 25.14% <25.40%> (+0.08%) ⬆️
linux-brax 29.57% <86.85%> (?)
linux-cpu 85.14% <26.20%> (-0.52%) ⬇️
linux-gpu 86.08% <26.20%> (-0.53%) ⬇️
linux-jumanji 30.31% <43.91%> (+0.03%) ⬆️
linux-outdeps-gpu 71.71% <25.40%> (-0.40%) ⬇️
linux-stable-cpu 85.00% <26.20%> (-0.52%) ⬇️
linux-stable-gpu 85.72% <26.20%> (-0.52%) ⬇️
linux_examples-gpu 43.00% <0.00%> (-0.01%) ⬇️
macos-cpu 84.82% <26.20%> (-0.53%) ⬇️
olddeps-gpu 75.67% <26.20%> (-0.43%) ⬇️

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

Impacted Files Coverage Δ
torchrl/envs/libs/jax_utils.py 90.62% <90.62%> (ø)
torchrl/envs/libs/brax.py 92.20% <92.20%> (ø)
test/test_libs.py 97.00% <100.00%> (+0.80%) ⬆️
torchrl/envs/libs/jumanji.py 90.58% <100.00%> (+0.15%) ⬆️
torchrl/envs/utils.py 95.83% <100.00%> (+0.05%) ⬆️
test/test_trainer.py 98.23% <0.00%> (-0.33%) ⬇️
torchrl/envs/common.py 84.18% <0.00%> (+0.53%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

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

Let's set up the test pipeline, I'll give it a second look once it's done

>>> env = brax.envs.get_environment("ant")
>>> env = BraxWrapper(env)
>>> td = env.rand_step()
>>> print(td)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should put what the print output is here below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

NdUnboundedContinuousTensorSpec,
)
from torchrl.envs.common import _EnvWrapper
from torchrl.envs.libs.jumanji import _torchrl_data_to_spec_transform
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should definitely not import stuff from lib to lib.
Here I would put _torchrl_data_to_spec_transform in a utils file, jax_utils (and rename it to a less generic name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@vmoens
Copy link
Collaborator

vmoens commented Dec 9, 2022

The tests are passing! Just a few edits and we're good to go!

Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

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

LGTM
Let's wait for the tests to pass and merge this!

@vmoens vmoens merged commit efa2cf5 into pytorch:main Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants