-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Dpatel enable tests on spyre #77
base: main
Are you sure you want to change the base?
Conversation
…ss values for spyre
bug fix: variable number of max decode tokens within batch (IBM#73)
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
tests/spyre/test_spyre_basic.py
Outdated
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this line be removed?
tests/spyre/test_spyre_embeddings.py
Outdated
# 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" |
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.
# get model names from env, if not set then default to "llama-194m" | |
# get model names from env, if not set then default to "all-roberta-large-v1" |
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" | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: you named it SPYRE_TEST_MODEL_LIST
because multiple models can be tested, but you named SPYRE_TEST_BACKEND_TYPE
and not SPYRE_TEST_BACKEND_TYPE_LIST
. Same for the other files.
# ) # (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 comment
The reason will be displayed to describe this comment to others. Learn more.
same as before: should it be removed?
tests/spyre/test_spyre_basic.py
Outdated
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | |
# For multiple values, export SPYRE_TEST_MODEL_LIST="llama-194m,all-roberta-large-v1" |
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | |
# For multiple values, export SPYRE_TEST_BACKEND_TYPE="eager,inductor" |
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | |
# For multiple values, export SPYRE_TEST_MODEL_LIST="llama-194m,all-roberta-large-v1" |
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# For multiple values, export SPYRE_TEST_MODEL_DIR="eager,inductor" | |
# For multiple values, export SPYRE_TEST_BACKEND_TYPE="eager,inductor" |
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# For multiple values, export SPYRE_TEST_MODEL_DIR="llama-194m,all-roberta-large-v1" | |
# For multiple values, export SPYRE_TEST_MODEL_LIST="llama-194m,all-roberta-large-v1" |
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
open question: should we still keep the #, "inductor", "sendnn_decoder"])
part if we use a list of backends? Maybe we can put that in the header part?
- fix comments
Thank you @sducouedic for all the inputs. I have made few changes. Please let me know if anything is missed. |
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.
LGTM
# 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_BACKEND_LIST="eager,inductor,sendnn_decoder" | ||
backend_list = os.environ.get("SPYRE_TEST_BACKEND_LIST", "eager") | ||
# get model names from env, if not set then default to "llama-194m" | ||
# For multiple values, export SPYRE_TEST_MODEL_LIST="llama-194m,all-roberta-large-v1" | ||
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_list.split(','): | ||
test_backend_list.append(backend.strip()) | ||
|
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.
Since these environment variables (and the code to parse them) are used in multiple files, I think it would make sense to move them into a common place (spyre_util.py
perhaps) and then have each test import them from there.
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.
Please also ensure the changes are adhering to the formatting guidelines of vLLM (you can run bash format.sh
to run through all the checks).
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.
@dpatel-007, you can move common helper functions to conftest.py
as fixtures that can be used the tests. For example instead of redefining this in every file:
model_dir_path = os.environ.get("SPYRE_TEST_MODEL_DIR", "/models")
You could have
@pytest.fixture(scope="session")
def model_dir_path():
return os.environ.get("SPYRE_TEST_MODEL_DIR", "/models")
(I'm not saying that this is the ideal solution for model_dir_path
, it's just to illustrate the idea)
- fixed E501 erros - created functions in utils and removed repeated code
Fix embeddings tests failure
- fixed spyre_utils and embeddings
This PR is to enable tests for spyre execution:
It allows users to achieve the following via environment variables:
Note:
Expected behavior: