Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test triton CI #893

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/test_triton_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test(port=33337):
all_pass = True
for cases in test_cases:
quest = cases['prompts']
keywords = cases['keywords']
keywords = [k.lower() for k in cases['keywords']]
inputs = quest + end
print(f'Test Input prompts: {quest}\nKey words: {keywords}')
time.sleep(5)
Expand All @@ -58,7 +58,7 @@ def test(port=33337):
out, err = proc.communicate(input=inputs)
print(f'Output: {out}')
if proc.returncode == 0:
out = parse_dialogue(out)[0]
out = parse_dialogue(out)[0].lower()
success = any([k in out for k in keywords])
if not success:
print(f'>>> Failed to output keywords: {out} {keywords}')
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ jobs:
run: |
export CONTAINER_ID=$(docker create \
--rm \
--gpus='"device=0,1"' \
--gpus='"device=4,5"' \
--shm-size 16g \
--cap-add=SYS_PTRACE \
--cap-add=SYS_ADMIN \
--security-opt seccomp=unconfined \
--name lmdeploy-ci-triton \
--name "lmdeploy-ci-triton-$GITHUB_RUN_ID" \
--workdir /__w/lmdeploy/lmdeploy \
--env PIP_CACHE_DIR=/root/.cache/pip \
--env NCCL_LAUNCH_MODE=GROUP \
-v $(pwd)/../../:/__w \
-v ${HF_MODEL}:/root/workspace/hf_model \
Expand All @@ -151,12 +150,14 @@ jobs:
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
- name: Build lmdeploy from source
run: |
docker exec $CONTAINER_ID cp -r ../../build build
docker exec $CONTAINER_ID mkdir build
docker exec --workdir /__w/lmdeploy/lmdeploy/build \
--env http_proxy=${{secrets.PROXY}} \
--env https_proxy=${{secrets.PROXY}} \
--env HTTP_PROXY=${{secrets.PROXY}} \
--env HTTPS_PROXY=${{secrets.PROXY}} \
--env no_proxy="localhost,127.0.0.1" \
--env NO_PROXY="localhost,127.0.0.1" \
$CONTAINER_ID cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
Expand Down Expand Up @@ -198,21 +199,27 @@ jobs:
--dst-path /root/workspace/workdir/${TB_MODEL}
- name: Start triton server service
run: |
docker exec --detach $CONTAINER_ID \
tritonserver \
docker exec --detach $CONTAINER_ID bash -c \
"tritonserver \
--model-repository=/root/workspace/workdir/${TB_MODEL}/model_repository \
--allow-http=0 \
--allow-grpc=1 \
--grpc-port=${GRPC_PORT} \
--log-verbose=0 \
--allow-metrics=1
--allow-metrics=1 > run.log 2>&1 ; touch finish.txt"
# wait for triton server to fully start up
sleep 180s
# print triton server log file
cat run.log
python3 -c 'import os; assert not os.path.exists("finish.txt"), "Failed to start tritonserver"'
- name: Test triton server
run: |
docker exec \
--env no_proxy="localhost,127.0.0.1" \
--env NO_PROXY="localhost,127.0.0.1" \
$CONTAINER_ID python3 .github/scripts/test_triton_server.py --port ${GRPC_PORT}
# print triton server log file
cat run.log
- name: Clear workfile
if: always()
run: |
Expand Down
Loading