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

[gym/rllib] Add option to forward keyword arguments to 'ray.init'. #436

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions core/src/engine/EngineMultiRobot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3789,7 +3789,7 @@ namespace jiminy
// Update lagrangian multipliers associated with the constraint
constraintIdx = 0U;
systemData.constraintsHolder.foreach(
[&lambda_c = const_cast<vectorN_t &>(data.lambda_c), // std::as_const is not supported by gcc<7.3
[&lambda_c = const_cast<vectorN_t const &>(data.lambda_c), // std::as_const is not supported by gcc<7.3
&constraintIdx](
std::shared_ptr<AbstractConstraintBase> const & constraint,
constraintsHolderType_t const & /* holderType */)
Expand All @@ -3808,7 +3808,7 @@ namespace jiminy
constraintsHolderType_t::BOUNDS_JOINTS,
[&u = systemData.state.u,
&uInternal = systemData.state.uInternal,
&joints = const_cast<pinocchio::Model::JointModelVector &>(model.joints)](
&joints = const_cast<pinocchio::Model::JointModelVector const &>(model.joints)](
std::shared_ptr<AbstractConstraintBase> & constraint,
constraintsHolderType_t const & /* holderType */)
{
Expand Down
16 changes: 8 additions & 8 deletions python/gym_jiminy/rllib/gym_jiminy/rllib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def initialize(num_cpus: int,
logger_cls: type = TBXLogger,
launch_tensorboard: bool = True,
debug: bool = False,
verbose: bool = True) -> Callable[[Dict[str, Any]], Logger]:
verbose: bool = True,
**ray_init_kwargs: Any) -> Callable[[Dict[str, Any]], Logger]:
"""Initialize Ray and Tensorboard daemons.

It will be used later for almost everything from dashboard, remote/client
Expand Down Expand Up @@ -153,18 +154,17 @@ def initialize(num_cpus: int,
num_cpus=num_cpus,
# Number of GPUs assigned to each raylet
num_gpus=num_gpus,
# Enable object eviction in LRU order under memory pressure
_lru_evict=False,
# Whether or not to execute the code serially (for debugging)
local_mode=debug,
# Logging level
logging_level=logging.DEBUG if debug else logging.ERROR,
# Whether to redirect outputs from every worker to the driver
log_to_driver=debug,
# Whether to start Ray dashboard, to monitor cluster's status
include_dashboard=True,
# The host to bind the dashboard server to
dashboard_host="0.0.0.0")
log_to_driver=debug, **{**dict(
# Whether to start Ray dashboard to monitor cluster status
include_dashboard=debug,
# The host to bind the dashboard server to
dashboard_host="0.0.0.0"
), **ray_init_kwargs})
else:
# Connect to existing Ray cluster
ray.init(
Expand Down