Skip to content

Commit

Permalink
add deepspeed_ssh_port option to connect ssh with port other than 22
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr0930 committed Jan 25, 2025
1 parent 675e35b commit b4e44fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/accelerate/commands/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ def launch_command_parser(subparsers=None):
type=str,
help="DeepSpeed hostfile for configuring multi-node compute resources.",
)
deepspeed_args.add_argument(
"--deepspeed_ssh_port",
default=None,
type=str,
help="SSH port to use for remote connections with DeepSpeed.",
)
deepspeed_args.add_argument(
"--deepspeed_exclusion_filter",
default=None,
Expand Down
2 changes: 2 additions & 0 deletions src/accelerate/utils/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def prepare_deepspeed_cmd_env(args: argparse.Namespace) -> Tuple[List[str], Dict
)
else:
cmd.extend(["--num_gpus", str(args.num_processes // args.num_machines)])
if args.deepspeed_ssh_port is not None:
cmd.extend(["--ssh_port", str(args.deepspeed_ssh_port)])
if main_process_ip:
cmd.extend(["--master_addr", str(main_process_ip)])
cmd.extend(["--master_port", str(main_process_port)])
Expand Down

0 comments on commit b4e44fa

Please sign in to comment.