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

[WIP] RL multinode #152

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

[WIP] RL multinode #152

wants to merge 15 commits into from

Conversation

rafapi
Copy link
Collaborator

@rafapi rafapi commented Dec 18, 2024

No description provided.

@rafapi rafapi changed the base branch from main to multinode_deepspeed December 18, 2024 19:42
@rafapi rafapi changed the base branch from multinode_deepspeed to main December 19, 2024 18:34
Copy link
Collaborator

@rizar rizar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Please see my comments below.

examples/rl_gsm8k/orchestrate_rl.py Show resolved Hide resolved
@@ -69,6 +69,11 @@ def __init__(
self.stderr_file: Optional[TextIO] = None
self.stats = {}

# Add node rank awareness
self.node_rank = int(os.environ.get("RANK", 0))
self.port_offset = self.node_rank * 1000 # Ensure different port ranges for each node
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why different port ranges for each node?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically we should be able to update the sync port if the one selected by the toolkit environment is being used. But that's not true and I found out that the reason for those clashes is the subprocess subshell instead.

Copy link
Collaborator

@rizar rizar Dec 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. These vllms are running on different nodes, aren't they?

# Check GPU availability
num_gpus = torch.cuda.device_count()
print('###############################')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use logger.info, and maybe smth like messages, "I'm rank X, training on Y GPU"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just sanity checking, it will be deleted soon. It was there to check that that number is the same as Num processes, but things are clear now.

"--deepspeed_multinode_launcher",
"standard",
"--same_network",
])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would training multi-node training without accelerate work without DeepSpeed? If not, should add an exception.

run = None

def safe_wandb_log(metrics, step):
if run is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just check the rank there and nothing unless it is 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants