zhaochenyang20 / Tsing-Answer

为清华大学答疑坊所写的数据分析脚本
9 stars 1 forks source link

st #3

Open zhaochenyang20 opened 2 years ago

zhaochenyang20 commented 2 years ago

alias sqm='squeue --Format=jobid,partition,username,quotatype,numnodes,reasonlist:200 | egrep 'Model' | grep -v 'UCG_BigModel' | grep -v 'TCG_BigModel'' alias sqs="squeue | egrep 'Model|LM|sku_model|STCShare_A100|TCG_BigModel|UCG_BigModel|pat_op|pat_rd|vc_research_5|Zoetrope|ToolChain|pat|basemodel|phx-test' | grep spot" alias sqa="squeue | egrep 'Model|LM|sku_model|STCShare_A100|TCG_BigModel|UCG_BigModel|pat_op|pat_rd|vc_research_5|Zoetrope|ToolChain|pat|basemodel|phx-test'" alias sqai="squeue --Format=jobid,partition,username,quotatype,numnodes,reasonlist:200 | egrep 'Model|LM|sku_model|STCShare_A100|TCG_BigModel|UCG_BigModel|pat_op|pat_rd|vc_research_5|Zoetrope|ToolChain|pat|bas$ alias rmo="rm -rf *.out" alias nyt=New_York_Times alias gcb="git checkout -b" alias gb="git branch" alias gc="git checkout" alias gpso="git push --set-upstream origin" alias gpl="git pull" alias ope="nano ~/.bashrc" alias gcm="git commit -m" alias ga="git add ." alias gl="git log --graph --pretty=oneline --abbrev-commit" export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles alias ipy="ipython" alias op="open '$(pwd)'" alias duh="du -hs" alias ca="conda activate" alias gpu="python3 ~/.GPU.py" alias sa="source activate" alias cie="conda info -e"alias ciy="conda install -y" alias pi="pip install" alias le="less" alias ju="jupyter notebook" alias his="history" alias clr="conda list -e > requirements.txt" alias sz="source ~/.bashrc" alias 成都="cd" alias sgpu4="sbatch --preempt --gres=gpu:4 --ntasks-per-node=1 --cpus-per-task 16 -p LM --quotatype=spot " alias sgpu8="sbatch --preempt --gres=gpu:8 --ntasks-per-node=1 --cpus-per-task 16 -p LM --quotatype=spot " alias scpu="sbatch --preempt --gres=gpu:0 --ntasks-per-node=1 --cpus-per-task 16 -p cpu --quotatype=spot " alias squ="squeue -u zhaochenyang" alias sca="scancel -u zhaochenyang" alias wd="watch -n 0.1 du -hs" alias pi="pip install" alias le="less" alias ju="jupyter notebook" alias his="history" alias clr="conda list -e > requirements.txt" alias sz="source ~/.bashrc" alias 成都="cd" alias sgpu4="sbatch --preempt --gres=gpu:4 --ntasks-per-node=1 --cpus-per-task 16 -p LM --quotatype=spot " alias sgpu8="sbatch --preempt --gres=gpu:8 --ntasks-per-node=1 --cpus-per-task 16 -p LM --quotatype=spot " alias scpu="sbatch --preempt --gres=gpu:0 --ntasks-per-node=1 --cpus-per-task 16 -p cpu --quotatype=spot " alias squ="squeue -u zhaochenyang" alias sca="scancel -u zhaochenyang" alias wd="watch -n 0.1 du -hs" conda activate /mnt/cache/zhaochenyang/envs/pt1.12.1_cuda11.6 clear

zhaochenyang20 commented 2 years ago

import os from time import sleep

jobs = []

try: while True:

squeue | egrep 'Model|LM|sku_model|STCShare_A100|TCG_BigModel|UCG_BigModel|pat_op|pat_rd|vc_research_5|Zoetrope|ToolChain

    #x = os.popen('sinfo -a | grep \'LM\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
    x0 = os.popen('sinfo -a | grep \'LM\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
    x1 = os.popen('sinfo -a | grep \'Model\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
    x2 = os.popen('sinfo -a | egrep \'LM|idle\'').read()
    #z = os.popen('svp list | egrep \'Model|LM\' | grep -v \'UCG_BigModel\' | grep -v \'TCG_BigModel\'').read()
    z0 = os.popen('svp list | grep \'LM\'').read()
    z1 = os.popen('svp list | grep \'Model\'').read()
    z2 = os.popen('svp list | grep \'basemodel\'').read()
    y0 = os.popen('squeue | grep zhanming').read()
    y1 = os.popen('squeue -p Model').read()
    y2 = os.popen('squeue -p LM').read()
    hasout = False
    for line in y0.split('\n'):
        if 'out' in line:
            hasout = True
    print(x0)
    print(x1)
    #print(x2)
    print(z0)
    print(z1)
    print(z2)
    print(y0)
    print(y1)
    print(y2)
    #print(x)
    sleep(1)

except KeyboardInterrupt: print('Recycling...') for x in jobs: os.system(f'scancel {x}')

zhaochenyang20 commented 2 years ago
import os
from time import sleep

jobs = []

try:
    while True:
       # squeue | egrep 'Model|LM|sku_model|STCShare_A100|TCG_BigModel|UCG_BigModel|pat_op|pat_rd|vc_research_5|Zoetrope|ToolChain
        #x = os.popen('sinfo -a | grep \'LM\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
        x0 = os.popen('sinfo -a | grep \'LM\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
        x1 = os.popen('sinfo -a | grep \'Model\' | grep \'idle\' | grep -v \'UCG_BigModel\' | grep -v \'UCG_BigModel\'').read()
        x2 = os.popen('sinfo -a | egrep \'LM|idle\'').read()
        #z = os.popen('svp list | egrep \'Model|LM\' | grep -v \'UCG_BigModel\' | grep -v \'TCG_BigModel\'').read()
        z0 = os.popen('svp list | grep \'LM\'').read()
        z1 = os.popen('svp list | grep \'Model\'').read()
        z2 = os.popen('svp list | grep \'basemodel\'').read()
        y0 = os.popen('squeue | grep zhanming').read()
        y1 = os.popen('squeue -p Model').read()
        y2 = os.popen('squeue -p LM').read()
        hasout = False
        for line in y0.split('\n'):
            if 'out' in line:
                hasout = True
        print(x0)
        print(x1)
        #print(x2)
        print(z0)
        print(z1)
        print(z2)
        print(y0)
        print(y1)
        print(y2)
        #print(x)
        sleep(1)
except KeyboardInterrupt:
    print('Recycling...')
    for x in jobs:
        os.system(f'scancel {x}')