-
Notifications
You must be signed in to change notification settings - Fork 239
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
Improve run_llama_train.sh args and add local-ranks-filter #51
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,26 @@ set -ex | |
|
||
TRAINER_DIR=${1:-/home/$USER/local/torchtrain} | ||
|
||
MODEL="debugmodel" | ||
NGPU=8 | ||
MP=4 | ||
# use envs as local overrides for convenience | ||
# e.g. | ||
# LOG_RANK=0,1 NGPU=4 SP=2 ./run_llama_train.sh | ||
|
||
MODEL=${MODEL:-"debugmodel"} | ||
NGPU=${NGPU:-"8"} | ||
PP=${PP:-"1"} | ||
SP=${SP:-"1"} | ||
DP=${DP:-"-1"} | ||
|
||
# by default log just rank 0 output, | ||
LOG_RANK=${LOG_RANK:-0} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think one issue for my solution is that you can't easily disable 'log_rank' unless you comment out the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gonna merge it this way, its probably easier to have rank0 by default and comment out than remember how to add the filter string in, but we can probably improve this. |
||
|
||
# Change this string to a meaningful one to enable checkpoint | ||
CHECKPOINT_FOLDER="" | ||
CHECKPOINT_FOLDER=${CHECKPOINT_FOLDER:-""} | ||
# Please adjust this to a longer interval period. The unit of measurement is in steps. | ||
CHECKPOINT_INTERVAL=5 | ||
CHECKPOINT_INTERVAL=${CHECKPOINT_INTERVAL:-5} | ||
|
||
torchrun --nproc_per_node=${NGPU} \ | ||
--local-ranks-filter ${LOG_RANK} --role rank --tee 3 \ | ||
train.py --steps 10 --compile \ | ||
--pp_degree ${PP} --sp_degree ${SP} --dp_degree ${DP} | ||
--checkpoint-folder=${CHECKPOINT_FOLDER} --checkpoint-interval=${CHECKPOINT_INTERVAL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder where these are picked up. Shall we also add to the
torchrun
cmd? e.g.--pp_degree=${PP}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yea, i forgot to copy that part over. will fix.