Skip to content

Instantly share code, notes, and snippets.

@yitang
Created December 16, 2022 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yitang/7894b6b6c4cf15686c55e6f970e9a9ea to your computer and use it in GitHub Desktop.
Save yitang/7894b6b6c4cf15686c55e6f970e9a9ea to your computer and use it in GitHub Desktop.

HW4 Test Runners

group tests

wd="./test_results/"
ts=$(date +"%Y_%m_%d_%H_%M_%S")
git_hash=$(git rev-parse --verify --short HEAD)
echo "run id: " ${ts}__${git_hash}$

fast and cpu

fname_full=${wd}/${ts}__${git_hash}__${fname}
python3 -m pytest -l -v -k "not training and cpu" 2>&1 | tee ${fname_full}
tail -n 1 ${fname_full} | sed 's/=//g'

fast and cuda

fname_full=${wd}/${ts}__${git_hash}__${fname}
python3 -m pytest -l -v -k "not training and cuda" 2>&1 | tee ${fname_full}
tail ${fname_full}
tail -n 1 ${fname_full} | sed 's/=//g'

slow and cpu

fname_full=${wd}/${ts}__${git_hash}__${fname}
python3 -m pytest -l -v -k "training and cpu" 2>&1 | tee ${fname_full}
tail -n 1 ${fname_full} | sed 's/=//g'

slow and cuda

fname_full=${wd}/${ts}__${git_hash}__${fname}
python3 -m pytest -l -v -k "training and cuda" 2>&1 | tee ${fname_full}
tail -n 1 ${fname_full} | sed 's/=//g'

Tests logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment