Skip to content

Commit

Permalink
Initialize distributed runs if JAX_WORLD_SIZE > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Jul 11, 2024
1 parent 828355d commit 2db38e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions skrl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ def __init__(self) -> None:
# device
self._device = f"cuda:{self._local_rank}"

# TODO: find a better place for it
# set up distributed runs
if self._is_distributed and "jax" in sys.modules:
if self._is_distributed:
import jax
logger.info(f"Distributed (rank: {self._rank}, local rank: {self._local_rank}, world size: {self._world_size})")
jax.distributed.initialize(coordinator_address=self._coordinator_address,
Expand Down

0 comments on commit 2db38e9

Please sign in to comment.