Skip to content

Commit

Permalink
verify
Browse files Browse the repository at this point in the history
Signed-off-by: Jiafu Zhang <[email protected]>
  • Loading branch information
jiafuzha committed Dec 18, 2023
1 parent 83cb052 commit fd3f761
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 281 deletions.
144 changes: 0 additions & 144 deletions .github/workflows/workflow_finetune.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/workflow_finetune_gpu.yml

This file was deleted.

100 changes: 11 additions & 89 deletions .github/workflows/workflow_inference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,98 +32,20 @@ jobs:
model: mpt-7b

runs-on: self-hosted
container:
image: node:18
env:
NODE_ENV: development
volumns:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set Name Prefix
id: "prefix"
run: |
prefix="inference"
if [[ ${{ matrix.model }} == "mpt-7b-bigdl" ]]; then
prefix="${prefix}_bigdl_cpu"
fi
echo "prefix is ${prefix}"
echo "prefix=$prefix" >> $GITHUB_OUTPUT
- name: Build Docker Image
run: |
if [[ ${{ matrix.model }} == "mpt-7b-bigdl" ]]; then
DF_SUFFIX=".bigdl-cpu"
else
DF_SUFFIX=".cpu_and_deepspeed"
fi
PREFIX=${{steps.prefix.outputs.prefix}}
docker build ./ --build-arg CACHEBUST=1 --build-arg http_proxy=${{ vars.HTTP_PROXY_IMAGE_BUILD }} --build-arg https_proxy=${{ vars.HTTPS_PROXY_IMAGE_BUILD }} -f dev/docker/Dockerfile${DF_SUFFIX} -t ${PREFIX}:latest && yes | docker container prune && yes | docker image prune
- name: Start Docker Container
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
cid=$(docker ps -q --filter "name=${PREFIX}")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid; fi
docker run -tid -v /mnt/DP_disk1/huggingface/cache/:/root/.cache/huggingface/hub -v .:/root/llm-ray -e http_proxy=${{ vars.HTTP_PROXY_CONTAINER_RUN }} -e https_proxy=${{ vars.HTTPS_PROXY_CONTAINER_RUN }} --name="${PREFIX}" --hostname="${PREFIX}-container" ${PREFIX}:latest
- name: Start Ray Cluster
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
docker exec "${PREFIX}" bash -c "./inference/deep/start-ray-cluster.sh"
- name: Run Inference Test
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
if [[ ${{ matrix.model }} == "mpt-7b-bigdl" ]]; then
docker exec "${PREFIX}" bash -c "KEEP_SERVE_TERMINAL='false' python inference/run_model_serve.py --config_file inference/models/bigdl/mpt-7b-bigdl.yaml"
else
docker exec "${PREFIX}" bash -c "KEEP_SERVE_TERMINAL='false' MODEL_TO_SERVE=\"${{ matrix.model }}\" python inference/run_model_serve.py"
fi
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }}"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }} --streaming_response"
- name: Run Inference Test with Deltatuner
if: ${{ matrix.dtuner_model }}
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
docker exec "${PREFIX}" bash -c "KEEP_SERVE_TERMINAL='false' python inference/run_model_serve.py --config_file .github/workflows/config/mpt_deltatuner.yaml"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }}"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }} --streaming_response"
- name: Run Inference Test with DeepSpeed
- name: Show env
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
if [[ ${{ matrix.model }} =~ ^(gpt2|mpt-7b.*)$ ]]; then
echo ${{ matrix.model }} is not supported!
else
docker exec "${PREFIX}" bash -c "KEEP_SERVE_TERMINAL='false' MODEL_TO_SERVE=\"${{ matrix.model }}\" python inference/run_model_serve.py --deepspeed"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }}"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }} --streaming_response"
fi
(ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
echo "code dir is $GITHUB_WORKSPACE"
docker image ls
- name: Run Inference Test with DeepSpeed and Deltatuner
if: ${{ matrix.dtuner_model }}
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
if [[ ${{ matrix.model }} =~ ^(gpt2|mpt-7b.*)$ ]]; then
echo ${{ matrix.model }} is not supported!
else
docker exec "${PREFIX}" bash -c "KEEP_SERVE_TERMINAL='false' python inference/run_model_serve.py --config_file .github/workflows/config/mpt_deltatuner_deepspeed.yaml"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }}"
docker exec "${PREFIX}" bash -c "python inference/run_model_infer.py --num_iter 1 --model_endpoint http://127.0.0.1:8000/${{ matrix.model }} --streaming_response"
fi
- name: Stop Ray
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
cid=$(docker ps -q --filter "name=${PREFIX}")
if [[ ! -z "$cid" ]]; then
docker exec "${PREFIX}" bash -c "ray stop"
fi
- name: Stop Container
if: success() || failure()
run: |
PREFIX=${{steps.prefix.outputs.prefix}}
cid=$(docker ps -q --filter "name=${PREFIX}")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid; fi
- name: Test Summary
run: echo "to be continued"
3 changes: 0 additions & 3 deletions .github/workflows/workflow_orders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ jobs:

call-inference:
uses: ./.github/workflows/workflow_inference.yml

call-finetune:
uses: ./.github/workflows/workflow_finetune.yml
20 changes: 0 additions & 20 deletions .github/workflows/workflow_orders_nightly.yml

This file was deleted.

0 comments on commit fd3f761

Please sign in to comment.