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

[Doc] Better doc for distributed RBs #2378

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
amend
  • Loading branch information
vmoens committed Aug 7, 2024
commit 2f41fbad6776c1fe048ca6246217065db3b081fe
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def main(rank):
str_init_method = "tcp://localhost:10000"

options = rpc.TensorPipeRpcBackendOptions(
num_worker_threads=16, init_method=str_init_method
num_worker_threads=16,
init_method=str_init_method
)

if rank == 0:
Expand All @@ -57,7 +58,6 @@ def main(rank):
torchrl_logger.info(f"Initialised Trainer Node {rank}")
trainer = TrainerNode(replay_buffer_node=REPLAY_BUFFER_NODE)
trainer.train(100)
breakpoint()
elif rank == 1:
# rank 1 is the replay buffer
# replay buffer waits passively for construction instructions from trainer node
Expand All @@ -69,7 +69,6 @@ def main(rank):
rpc_backend_options=options,
)
torchrl_logger.info(f"Initialised RB Node {rank}")
breakpoint()
else:
# rank 2+ is a new data collector node
# data collectors also wait passively for construction instructions from trainer node
Expand All @@ -81,7 +80,6 @@ def main(rank):
rpc_backend_options=options,
)
torchrl_logger.info(f"Initialised DC Node {rank}")
breakpoint()
rpc.shutdown()

if __name__ == "__main__":
Expand All @@ -91,5 +89,5 @@ def main(rank):
procs.append(ctx.Process(target=main, args=(i,)))
procs[-1].start()

for p in procs:
for p in reversed(procs):
p.join()