fix: set env in runner (#891)

This commit is contained in:
Yineng Zhang
2024-08-02 18:48:56 +08:00
committed by GitHub
parent 30a9b2ef20
commit 2e218b9e04
3 changed files with 8 additions and 20 deletions

View File

@@ -21,26 +21,24 @@ jobs:
e2e-test: e2e-test:
runs-on: self-hosted runs-on: self-hosted
env:
HF_TOKEN : ${{ secrets.HF_TOKEN }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd - source $HOME/venv/bin/activate
echo "$HOME/venv/bin" >> $GITHUB_PATH
pip cache purge pip cache purge
pip install --upgrade pip pip install --upgrade pip
pip install -e "python[all]" pip install -e "python[all]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/ --force-reinstall pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/ --force-reinstall
pip install --upgrade transformers pip install --upgrade transformers
pip install python-multipart
- name: Benchmark Serving Throughput - name: Benchmark Serving Throughput
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
python3 -m sglang.launch_server --model meta-llama/Meta-Llama-3.1-8B-Instruct --port 8413 --disable-radix-cache & python3 -m sglang.launch_server --model meta-llama/Meta-Llama-3.1-8B-Instruct --port 8413 --disable-radix-cache &
echo "Waiting for server to start..." echo "Waiting for server to start..."
@@ -56,7 +54,7 @@ jobs:
sleep 1 sleep 1
done done
cd /data/zhyncs && python3 -m sglang.bench_serving --backend sglang --port 8413 --dataset-name random --num-prompts 3000 --random-input 256 --random-output 512 cd $HOME && python3 -m sglang.bench_serving --backend sglang --port 8413 --dataset-name random --num-prompts 3000 --random-input 256 --random-output 512
echo "Stopping server..." echo "Stopping server..."
kill -9 $(ps aux | grep sglang | grep Meta-Llama-3.1-8B-Instruct | grep -v grep | awk '{print $2}') kill -9 $(ps aux | grep sglang | grep Meta-Llama-3.1-8B-Instruct | grep -v grep | awk '{print $2}')

View File

@@ -21,16 +21,14 @@ jobs:
unit-test: unit-test:
runs-on: self-hosted runs-on: self-hosted
env:
HF_TOKEN : ${{ secrets.HF_TOKEN }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd - source $HOME/venv/bin/activate
echo "$HOME/venv/bin" >> $GITHUB_PATH
pip cache purge pip cache purge
pip install --upgrade pip pip install --upgrade pip
@@ -40,29 +38,20 @@ jobs:
- name: Test Frontend Language with OpenAI Backend - name: Test Frontend Language with OpenAI Backend
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
cd test/lang cd test/lang
python3 test_openai_backend.py python3 test_openai_backend.py
- name: Test Frontend Language with SRT Backend - name: Test Frontend Language with SRT Backend
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/lang cd test/lang
python3 test_srt_backend.py python3 test_srt_backend.py
- name: Test OpenAI API Server - name: Test OpenAI API Server
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/srt cd test/srt
python3 test_openai_server.py python3 test_openai_server.py
- name: Test Accuracy - name: Test Accuracy
run: | run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/srt cd test/srt
python3 test_eval_accuracy.py python3 test_eval_accuracy.py

View File

@@ -1,6 +1,7 @@
import unittest import unittest
import sglang as sgl import sglang as sgl
from sglang.test.test_utils import MODEL_NAME_FOR_TEST
class TestBind(unittest.TestCase): class TestBind(unittest.TestCase):
@@ -8,7 +9,7 @@ class TestBind(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
cls.backend = sgl.Runtime(model_path="meta-llama/Meta-Llama-3-8B-Instruct") cls.backend = sgl.Runtime(model_path=MODEL_NAME_FOR_TEST)
sgl.set_default_backend(cls.backend) sgl.set_default_backend(cls.backend)
@classmethod @classmethod