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][RLModule] Disabled RLModule in Two trainer workflow example #33727

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions rllib/examples/two_trainer_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,20 @@ def training_step(self) -> ResultDict:
# Provide entire AlgorithmConfig object, not just an override.
PPOConfig()
.training(num_sgd_iter=10, sgd_minibatch_size=128)
.framework("torch" if args.torch or args.mixed_torch_tf else "tf"),
.framework("torch" if args.torch or args.mixed_torch_tf else "tf")
.training(_enable_learner_api=False)
.rl_module(_enable_rl_module_api=False),
),
"dqn_policy": (
DQNTorchPolicy if args.torch else DQNTFPolicy,
None,
None,
# Provide entire AlgorithmConfig object, not just an override.
DQNConfig().training(target_network_update_freq=500).framework("tf"),
DQNConfig()
.training(target_network_update_freq=500)
.framework("tf")
.training(_enable_learner_api=False)
.rl_module(_enable_rl_module_api=False),
),
}

Expand All @@ -199,6 +205,9 @@ def policy_mapping_fn(agent_id, episode, worker, **kwargs):
# Use GPUs iff `RLLIB_NUM_GPUS` env var set to > 0.
.resources(num_gpus=int(os.environ.get("RLLIB_NUM_GPUS", "0")))
.reporting(metrics_num_episodes_for_smoothing=30)
# TODO (Kourosh): Migrate this to the new RLModule / Learner API.
.training(_enable_learner_api=False)
.rl_module(_enable_rl_module_api=False)
)

stop = {
Expand Down