| 238 | elif strategy == "sok": |
| 239 | |
| 240 | def func_horovod_command(rank_size_str): |
| 241 | horovod_command = ["horovodrun", "-np", rank_size_str] |
| 242 | subprocess_command = [] |
| 243 | # shape like -H python main.py |
| 244 | if isinstance(command, list): |
| 245 | for cmd in command: |
| 246 | subprocess_command.extend(cmd.split(" ")) |
| 247 | elif isinstance(command, str): |
| 248 | subprocess_command.append(command) |
| 249 | horovod_command.extend(subprocess_command) |
| 250 | return horovod_command |
| 251 | |
| 252 | port = int(os.getenv("HB_RUN_BASE_PORT", "20001")) |
| 253 | device_to_ports = [] |