Skip to content

Commit

Permalink
fix: set env in runner (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs authored Aug 2, 2024
1 parent 30a9b2e commit 2e218b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,24 @@ jobs:
e2e-test:
runs-on: self-hosted

env:
HF_TOKEN : ${{ secrets.HF_TOKEN }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
source $HOME/venv/bin/activate
echo "$HOME/venv/bin" >> $GITHUB_PATH
pip cache purge
pip install --upgrade pip
pip install -e "python[all]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/ --force-reinstall
pip install --upgrade transformers
pip install python-multipart
- name: Benchmark Serving Throughput
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 &
echo "Waiting for server to start..."
Expand All @@ -56,7 +54,7 @@ jobs:
sleep 1
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..."
kill -9 $(ps aux | grep sglang | grep Meta-Llama-3.1-8B-Instruct | grep -v grep | awk '{print $2}')
15 changes: 2 additions & 13 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ jobs:
unit-test:
runs-on: self-hosted

env:
HF_TOKEN : ${{ secrets.HF_TOKEN }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
source $HOME/venv/bin/activate
echo "$HOME/venv/bin" >> $GITHUB_PATH
pip cache purge
pip install --upgrade pip
Expand All @@ -40,29 +38,20 @@ jobs:
- name: Test Frontend Language with OpenAI Backend
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
cd test/lang
python3 test_openai_backend.py
- name: Test Frontend Language with SRT Backend
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/lang
python3 test_srt_backend.py
- name: Test OpenAI API Server
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/srt
python3 test_openai_server.py
- name: Test Accuracy
run: |
cd /data/zhyncs/venv && source ./bin/activate && cd -
cd test/srt
python3 test_eval_accuracy.py
3 changes: 2 additions & 1 deletion test/lang/test_bind_cache.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import unittest

import sglang as sgl
from sglang.test.test_utils import MODEL_NAME_FOR_TEST


class TestBind(unittest.TestCase):
backend = None

@classmethod
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)

@classmethod
Expand Down

0 comments on commit 2e218b9

Please sign in to comment.