forked from FlagAI-Open/FlagAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FlagAI-Open#450 from ftgreat/master
add tools script
- Loading branch information
Showing
9 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
|
||
for ((i=1;i<=$NODES_NUM;i++ )); do | ||
ip=`sed -n $i,1p $hostfile|cut -f 1 -d" "` | ||
echo "ip": $ip | ||
ssh $ip "killall python" | ||
#sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
killall python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile configfile model_name exp_name" | ||
set -u | ||
hostfile=$1 | ||
configfile=$2 | ||
model_name=$3 | ||
exp_name=$4 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
exp_YYYYMMDDHH=$(date +"%Y%m%d%H") | ||
echo "exp_YYYYMMDDHH": $exp_YYYYMMDDHH | ||
|
||
SAVE_DIR=$PROJ_HOME/checkpoints_out/${exp_name}/$exp_YYYYMMDDHH | ||
LOGFILE=$SAVE_DIR/$configfile.log.txt | ||
echo "LOGFILE": $LOGFILE | ||
|
||
cd $PROJ_HOME; | ||
mkdir -p $SAVE_DIR; | ||
bash bmtrain_mgpu.sh $hostfile $configfile $model_name $exp_name $exp_YYYYMMDDHH 1>$LOGFILE 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
|
||
for ((i=1;i<=$NODES_NUM;i++ )); do | ||
ip=`sed -n $i,1p $hostfile|cut -f 1 -d" "` | ||
echo "ip": $ip | ||
ssh $ip "killall python" | ||
#sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
killall python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile configfile model_name exp_name" | ||
set -u | ||
hostfile=$1 | ||
configfile=$2 | ||
model_name=$3 | ||
exp_name=$4 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
exp_YYYYMMDDHH=$(date +"%Y%m%d%H") | ||
echo "exp_YYYYMMDDHH": $exp_YYYYMMDDHH | ||
|
||
SAVE_DIR=$PROJ_HOME/checkpoints_out/${exp_name}/$exp_YYYYMMDDHH | ||
LOGFILE=$SAVE_DIR/$configfile.log.txt | ||
echo "LOGFILE": $LOGFILE | ||
|
||
cd $PROJ_HOME; | ||
mkdir -p $SAVE_DIR; | ||
bash bmtrain_mgpu.sh $hostfile $configfile $model_name $exp_name $exp_YYYYMMDDHH 1>$LOGFILE 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
|
||
for ((i=1;i<=$NODES_NUM;i++ )); do | ||
ip=`sed -n $i,1p $hostfile|cut -f 1 -d" "` | ||
echo "ip": $ip | ||
ssh $ip "killall python" | ||
#sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile" | ||
set -u | ||
hostfile=$1 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
killall python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# | ||
# Defined by user | ||
export PROJ_HOME=$PWD | ||
|
||
echo "[INFO] $0: hostfile configfile model_name exp_name" | ||
set -u | ||
hostfile=$1 | ||
configfile=$2 | ||
model_name=$3 | ||
exp_name=$4 | ||
set +u | ||
NODES_NUM=`cat $hostfile |wc -l` | ||
echo "NODES_NUM": $NODES_NUM | ||
if [ $NODES_NUM -ne 1 ];then | ||
echo "Make Sure One Node in hostfile" | ||
exit 0 | ||
fi | ||
|
||
exp_YYYYMMDDHH=$(date +"%Y%m%d%H") | ||
echo "exp_YYYYMMDDHH": $exp_YYYYMMDDHH | ||
|
||
SAVE_DIR=$PROJ_HOME/checkpoints_out/${exp_name}/$exp_YYYYMMDDHH | ||
LOGFILE=$SAVE_DIR/$configfile.log.txt | ||
echo "LOGFILE": $LOGFILE | ||
|
||
cd $PROJ_HOME; | ||
mkdir -p $SAVE_DIR; | ||
bash bmtrain_mgpu.sh $hostfile $configfile $model_name $exp_name $exp_YYYYMMDDHH 1>$LOGFILE 2>&1 & |