zanussbaum / nodelist-inflator

CLI tool to easily expand a list of hostnames (which include brackets) and write to a hosttile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nodelist-Inflator

This is a simple CLI tool to extract individual nodes (hostnames) from a nodelist and write them to a file to be used by DeepSpeed.

For example, if you have a nodelist containing the following:

ip-xxxxxx,ip-yyyyyy,ip-aaaaa-[b-c,f]

It will write the following to the file hostname

ip-xxxxxx slots=8
ip-yyyyyy slots=8
ip-aaaaab slots=8
ip-aaaaac slots=8
ip-aaaaaf slots=8

Usage

Write a hostfile on the fly (useful for DeepSpeed integreations)

foo@bar:~$ nodelist_inflate --nodelist=ip-xxxxxx,ip-yyyyyy,ip-aaaaa-[b-c,f] --write

Get the rank of the current host

foo@bar:~$ nodelist_inflate --nodelist=ip-xxxxxx,ip-yyyyyy,ip-aaaaa-[b-c,f] --hostname=ip-xxxxxx
0 # the index of the hostname in the nodelist

About

CLI tool to easily expand a list of hostnames (which include brackets) and write to a hosttile


Languages

Language:Python 100.0%