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

Add github workflow to run Spyre tests #59

Merged
merged 4 commits into from
Jan 16, 2025
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
29 changes: 29 additions & 0 deletions .github/workflows/test-spyre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-sypre

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-spyre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Build docker image
run: docker build . -t vllm-spyre -f Dockerfile.spyre
- name: Run Spyre tests within docker container
run: |
docker run -i --rm --entrypoint /bin/bash vllm-spyre -c '''
python3.12 -c "from transformers import pipeline; pipeline(\"text-generation\", model=\"JackFram/llama-160m\")" && \
export VARIANT=$(ls /root/.cache/huggingface/hub/models--JackFram--llama-160m/snapshots/) && \
mkdir -p /models && \
ln -s /root/.cache/huggingface/hub/models--JackFram--llama-160m/snapshots/${VARIANT} /models/llama-194m && \
pip install pytest sentence-transformers && \
python3.12 -m pytest tests/spyre -v
'''
2 changes: 1 addition & 1 deletion tests/spyre/spyre_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def compare_results(model: str, prompts: List[str],
print()

assert DISABLE_ASSERTS or backend == 'sendnn_decoder' or\
hf_result['text'] == vllm_result['text']
hf_result['token_ids'] == vllm_result['token_ids']

if len(hf_result['tokens']) > 0:
print(" token id. token logprob "
Expand Down
Loading