Skip to content

Commit

Permalink
[gym/rllib] Add option to forward keyword arguments to 'ray.init'. (#436
Browse files Browse the repository at this point in the history
)

Co-authored-by: Alexis Duburcq <alexis.duburcq@wandercraft.eu>
  • Loading branch information
duburcqa and Alexis Duburcq authored Nov 4, 2021
1 parent 1cb3cc5 commit 63d5589
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 63d5589

Please sign in to comment.