-
-
Notifications
You must be signed in to change notification settings - Fork 15
Dpatel enable tests on spyre #77
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
Changes from 4 commits
1e2a600
faa9ff4
421fb72
705669e
59a86da
6e3083b
df1261a
d40d69b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,19 +10,36 @@ | |||||
generate_spyre_vllm_output) | ||||||
|
||||||
from vllm import SamplingParams | ||||||
import os | ||||||
|
||||||
# get model directory path from env, if not set then default to "/models". | ||||||
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models") | ||||||
# get model backend from env, if not set then default to "eager" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | ||||||
backend_type = os.environ.get("SPYRE_TEST_BACKEND_TYPE", "eager") | ||||||
# get model names from env, if not set then default to "llama-194m" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
user_test_model_list = os.environ.get("SPYRE_TEST_MODEL_LIST","llama-194m") | ||||||
test_model_list, test_backend_list = [],[] | ||||||
|
||||||
@pytest.mark.parametrize("model", ["/models/llama-194m"]) | ||||||
for model in user_test_model_list.split(','): | ||||||
test_model_list.append(f"{model_dir_path}/{model.strip()}") | ||||||
|
||||||
for backend in backend_type.split(','): | ||||||
test_backend_list.append(backend.strip()) | ||||||
|
||||||
@pytest.mark.parametrize("model", test_model_list) | ||||||
@pytest.mark.parametrize("prompts", [[ | ||||||
"Provide a list of instructions for preparing" | ||||||
" chicken soup for a family of four.", "Hello", | ||||||
"What is the weather today like?", "Who are you?" | ||||||
]]) | ||||||
@pytest.mark.parametrize("warmup_shape", [(64, 20, 4), (64, 20, 8), | ||||||
(128, 20, 4), (128, 20, 8)] | ||||||
# @pytest.mark.parametrize("warmup_shape", [(64, 20, 1), (128, 20, 1)] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this line be removed? |
||||||
) # (prompt_length/new_tokens/batch_size) | ||||||
@pytest.mark.parametrize("backend", | ||||||
["eager"]) #, "inductor", "sendnn_decoder"]) | ||||||
test_backend_list) #, "inductor", "sendnn_decoder"]) | ||||||
def test_output( | ||||||
model: str, | ||||||
prompts: List[str], | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,9 +8,24 @@ | |||||
import pytest | ||||||
from spyre_util import (compare_embedding_results, spyre_vllm_embeddings, | ||||||
st_embeddings) | ||||||
import os | ||||||
# get model directory path from env, if not set then default to "/models". | ||||||
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models") | ||||||
# get model backend from env, if not set then default to "eager" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
backend_type = os.environ.get("SPYRE_TEST_BACKEND_TYPE", "eager") | ||||||
# get model names from env, if not set then default to "llama-194m" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
user_test_model_list = os.environ.get("SPYRE_TEST_EMBEDDING_MODEL_LIST","all-roberta-large-v1") | ||||||
test_model_list, test_backend_list = [],[] | ||||||
|
||||||
for model in user_test_model_list.split(','): | ||||||
test_model_list.append(f"{model_dir_path}/{model.strip()}") | ||||||
|
||||||
@pytest.mark.parametrize("model", ["/models/all-roberta-large-v1"]) | ||||||
for backend in backend_type.split(','): | ||||||
test_backend_list.append(backend.strip()) | ||||||
|
||||||
@pytest.mark.parametrize("model", test_model_list) | ||||||
@pytest.mark.parametrize("prompts", [[ | ||||||
"The capital of France is Paris." | ||||||
"Provide a list of instructions for preparing" | ||||||
|
@@ -21,7 +36,7 @@ | |||||
[(64, 4), (64, 8), (128, 4), | ||||||
(128, 8)]) # (prompt_length/new_tokens/batch_size) | ||||||
@pytest.mark.parametrize("backend", | ||||||
["eager"]) #, "inductor", "sendnn_decoder"]) | ||||||
test_backend_list) #, "inductor", "sendnn_decoder"]) | ||||||
def test_output( | ||||||
model: str, | ||||||
prompts: List[str], | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,9 +11,25 @@ | |||||
from transformers import AutoTokenizer | ||||||
|
||||||
from vllm import SamplingParams | ||||||
import os | ||||||
|
||||||
# get model directory path from env, if not set then default to "/models". | ||||||
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models") | ||||||
# get model backend from env, if not set then default to "eager" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
backend_type = os.environ.get("SPYRE_TEST_BACKEND_TYPE", "eager") | ||||||
# get model names from env, if not set then default to "llama-194m" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
user_test_model_list = os.environ.get("SPYRE_TEST_MODEL_LIST","llama-194m") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note: you named it |
||||||
test_model_list, test_backend_list = [],[] | ||||||
|
||||||
@pytest.mark.parametrize("model", ["/models/llama-194m"]) | ||||||
for model in user_test_model_list.split(','): | ||||||
test_model_list.append(f"{model_dir_path}/{model.strip()}") | ||||||
|
||||||
for backend in backend_type.split(','): | ||||||
test_backend_list.append(backend.strip()) | ||||||
|
||||||
@pytest.mark.parametrize("model", test_model_list) | ||||||
@pytest.mark.parametrize("prompts", [ | ||||||
7 * [ | ||||||
"Hello", | ||||||
|
@@ -27,9 +43,12 @@ | |||||
]) | ||||||
@pytest.mark.parametrize("warmup_shapes", | ||||||
[[(64, 20, 4)], [(64, 20, 4), (128, 20, 4)]] | ||||||
# ) # (prompt_length/new_tokens/batch_size) | ||||||
# @pytest.mark.parametrize("warmup_shapes", | ||||||
# [[(64, 20, 1)], [(128, 20, 1)]] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as before: should it be removed? |
||||||
) # (prompt_length/new_tokens/batch_size) | ||||||
@pytest.mark.parametrize("backend", | ||||||
["eager"]) #, "inductor", "sendnn_decoder"]) | ||||||
test_backend_list) #, "inductor", "sendnn_decoder"]) | ||||||
def test_output( | ||||||
model: str, | ||||||
prompts: List[str], | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,20 +10,36 @@ | |||||
generate_spyre_vllm_output) | ||||||
|
||||||
from vllm import SamplingParams | ||||||
import os | ||||||
|
||||||
# get model directory path from env, if not set then default to "/models". | ||||||
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models") | ||||||
# get model backend from env, if not set then default to "eager" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
backend_type = os.environ.get("SPYRE_TEST_BACKEND_TYPE", "eager") | ||||||
# get model names from env, if not set then default to "llama-194m" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
user_test_model_list = os.environ.get("SPYRE_TEST_MODEL_LIST","llama-194m") | ||||||
test_model_list, test_backend_list = [],[] | ||||||
|
||||||
@pytest.mark.parametrize("model", ["/models/llama-194m"]) | ||||||
for model in user_test_model_list.split(','): | ||||||
test_model_list.append(f"{model_dir_path.strip()}/{model.strip()}") | ||||||
|
||||||
for backend in backend_type.split(','): | ||||||
test_backend_list.append(backend.strip()) | ||||||
|
||||||
@pytest.mark.parametrize("model", test_model_list) | ||||||
@pytest.mark.parametrize("prompts", [[ | ||||||
"Provide a list of instructions for preparing" | ||||||
" chicken soup for a family of four.", "Hello", | ||||||
"What is the weather today like?", "Who are you?" | ||||||
]]) | ||||||
@pytest.mark.parametrize("warmup_shapes", [[(64, 20, 4)]] | ||||||
@pytest.mark.parametrize("warmup_shapes", [[(64, 20, 1)]] | ||||||
) #,[(64,20,8)],[(128,20,4)],[(128,20,8)]]) | ||||||
# (prompt_length/new_tokens/batch_size) | ||||||
@pytest.mark.parametrize("tp_size", [2]) | ||||||
@pytest.mark.parametrize("backend", | ||||||
["eager"]) #, "inductor", "sendnn_decoder"]) | ||||||
test_backend_list) #, "inductor", "sendnn_decoder"]) | ||||||
def test_output( | ||||||
model: str, | ||||||
prompts: List[str], | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,9 +10,25 @@ | |||||
generate_spyre_vllm_output) | ||||||
|
||||||
from vllm import SamplingParams | ||||||
import os | ||||||
|
||||||
# get model directory path from env, if not set then default to "/models". | ||||||
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models") | ||||||
# get model backend from env, if not set then default to "eager" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
backend_type = os.environ.get("SPYRE_TEST_BACKEND_TYPE", "eager") | ||||||
# get model names from env, if not set then default to "llama-194m" | ||||||
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
user_test_model_list = os.environ.get("SPYRE_TEST_MODEL_LIST","llama-194m") | ||||||
test_model_list, test_backend_list = [],[] | ||||||
|
||||||
@pytest.mark.parametrize("model", ["/models/llama-194m"]) | ||||||
for model in user_test_model_list.split(','): | ||||||
test_model_list.append(f"{model_dir_path.strip()}/{model.strip()}") | ||||||
|
||||||
for backend in backend_type.split(','): | ||||||
test_backend_list.append(backend.strip()) | ||||||
|
||||||
@pytest.mark.parametrize("model", test_model_list) | ||||||
@pytest.mark.parametrize("prompts", [ | ||||||
7 * [ | ||||||
"Hello", | ||||||
|
@@ -25,9 +41,9 @@ | |||||
] | ||||||
]) | ||||||
@pytest.mark.parametrize("warmup_shapes", [[(64, 20, 8), (128, 20, 4)]] | ||||||
) # (prompt_length/new_tokens/batch_size) | ||||||
) # (prompt_length/new_tokens/batch_size) | ||||||
@pytest.mark.parametrize("backend", | ||||||
["eager"]) #, "inductor", "sendnn_decoder"]) | ||||||
test_backend_list) #, "inductor", "sendnn_decoder"]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. open question: should we still keep the |
||||||
def test_output( | ||||||
model: str, | ||||||
prompts: List[str], | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.