|
| 1 | +name: Run parallel prefill |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test-cuda: |
| 12 | + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main |
| 13 | + with: |
| 14 | + runner: linux.g5.4xlarge.nvidia.gpu |
| 15 | + gpu-arch-type: cuda |
| 16 | + gpu-arch-version: "12.1" |
| 17 | + script: | |
| 18 | + echo "::group::Print machine info" |
| 19 | + uname -a |
| 20 | + echo "::endgroup::" |
| 21 | +
|
| 22 | + echo "::group::Install newer objcopy that supports --set-section-alignment" |
| 23 | + yum install -y devtoolset-10-binutils |
| 24 | + export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH |
| 25 | + echo "::endgroup::" |
| 26 | +
|
| 27 | +
|
| 28 | + echo "::group::Download checkpoints" |
| 29 | + # Install requirements |
| 30 | + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 |
| 31 | + pip3 install -r requirements.txt |
| 32 | + pip3 list |
| 33 | + python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")' |
| 34 | + echo "::endgroup::" |
| 35 | +
|
| 36 | + echo "::group::Download checkpoints" |
| 37 | + mkdir -p checkpoints/stories15M |
| 38 | + pushd checkpoints/stories15M |
| 39 | + wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.pt |
| 40 | + wget https://github.com/karpathy/llama2.c/raw/master/tokenizer.model |
| 41 | + popd |
| 42 | + echo "::endgroup::" |
| 43 | +
|
| 44 | + echo "::group::Run inference" |
| 45 | + export MODEL_PATH=checkpoints/stories15M/stories15M.pt |
| 46 | + export MODEL_NAME=stories15M |
| 47 | + export MODEL_DIR=/tmp |
| 48 | +
|
| 49 | + for DTYPE in bfloat16 float16 float32; do |
| 50 | + ################################################################### |
| 51 | + # group with different temperatures |
| 52 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 |
| 53 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 |
| 54 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 |
| 55 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 |
| 56 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 |
| 57 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 |
| 58 | + ################################################################### |
| 59 | + # group with different temperatures and prefill, and compile |
| 60 | + # and prefill compile |
| 61 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --compile --compile-prefill |
| 62 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --compile --compile-prefill |
| 63 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --compile --compile-prefill |
| 64 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --compile --compile-prefill |
| 65 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --compile --compile-prefill |
| 66 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --compile --compile-prefill |
| 67 | + ################################################################### |
| 68 | + # group with different temperatures and sequential prefill |
| 69 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill |
| 70 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill |
| 71 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill |
| 72 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill |
| 73 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill |
| 74 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill |
| 75 | + ################################################################### |
| 76 | + # group with different temperatures and prefill, and compile |
| 77 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill --compile |
| 78 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill --compile |
| 79 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill --compile |
| 80 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill --compile |
| 81 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill --compile |
| 82 | + python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill --compile |
| 83 | +
|
| 84 | + done |
| 85 | +
|
| 86 | + echo "tests complete" |
| 87 | + echo "******************************************" |
| 88 | + echo "::endgroup::" |
| 89 | +
|
0 commit comments