-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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] RLTrainer stand-alone unittests #31552
[RLlib] RLTrainer stand-alone unittests #31552
Conversation
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
2. multi-gpus tests pass now Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
@@ -23,6 +25,7 @@ def setUp(cls) -> None: | |||
def tearDown(cls) -> None: | |||
ray.shutdown() | |||
|
|||
@pytest.mark.skip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll reactivate this test as a trainer_runner test once we iterate through the interface of trainer_runner and algorithm to solidify its design.
2. Added the unittest to the BUILD file Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
2. Added the unittest to the BUILD file Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
…o rltrainer-unittests
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
|
||
with tf.GradientTape() as tape: | ||
params = trainer.module[DEFAULT_POLICY_ID].trainable_variables | ||
loss = {"total_loss": sum([tf.reduce_sum(param) for param in params])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice property that you've used here.
@@ -1146,7 +1146,7 @@ def get_cartpole_dataset_reader(batch_size: int = 1) -> "DatasetReader": | |||
get_dataset_and_shards, | |||
) | |||
|
|||
path = "tests/data/cartpole/large.json" | |||
path = "rllib/tests/data/cartpole/large.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to remove this prepend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep. just pushed a patch.
* moved rl_optimizer logic into rl_trainer * added in_test to RLTrainer to allow doing test-specific stuff * multi-gpus tests pass now Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
Why are these changes needed?
This PR implements the stand-alone unittests for RLTrainer. Right now it only includes tf stuff, later we will extend it to torch.
This follows up this #31511
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.