Skip to content

Commit 73541af

Browse files
authored
[Tests]: Adding dummy causal models for testing in regular CI run (#427)
### Purpose of this PR: This update aims to reduce test execution time for causal language model inference. Previously, tests were run using full-scale models with one or two layers, which was inefficient and time-consuming. Refactoring CLI api testing for independent testing and redundant conftest code. ### What’s Changed: Introduced dummy models with significantly smaller configurations by adjusting parameters such as `max_position_embeddings, num_hidden_layers, num_attention_heads, hidden_size, intermediate_size, vocab_size and additional_params`. These lightweight models are used exclusively for testing purposes to ensure faster execution without compromising test coverage. And CLI testing has two test scripts one is for export, compile, and execute, another is for infer cli api. **Note:** This optimization is applied only to causal language models. --------- Signed-off-by: Abukhoyer Shaik <[email protected]>
1 parent dee5a5a commit 73541af

12 files changed

+755
-584
lines changed

QEfficient/utils/test_utils.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,24 @@ def __call__(
150150
image_tokens = IMG_START_TOKEN + IMG_CONTEXT_TOKEN * self.num_image_token * num_patches + IMG_END_TOKEN
151151
query = query.replace("<image>", image_tokens, 1)
152152
return query
153+
154+
155+
class ModelConfig:
156+
"""
157+
Contains all the model types which are not default model like quantized models, external models, swiftkv models etc,.
158+
"""
159+
160+
QUANTIZED_MODELS = {
161+
"neuralmagic/Qwen2-0.5B-Instruct-FP8",
162+
"neuralmagic/Llama-3.2-3B-Instruct-FP8",
163+
"TheBloke/Llama-2-7B-GPTQ",
164+
"TheBloke/TinyLlama-1.1B-Chat-v0.3-AWQ",
165+
}
166+
167+
EXTERNAL_MODELS = {
168+
"hpcai-tech/grok-1",
169+
}
170+
171+
SWIFTKV_MODELS = {
172+
"Snowflake/Llama-3.1-SwiftKV-8B-Instruct",
173+
}

scripts/Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pipeline {
5959
mkdir -p $PWD/Non_qaic &&
6060
export TOKENIZERS_PARALLELISM=false &&
6161
export QEFF_HOME=$PWD/Non_qaic &&
62-
pytest tests -m '(not cli) and (on_qaic) and (not multimodal) and (not qnn) and (not finetune)' --ignore tests/vllm -n 4 --junitxml=tests/tests_log2.xml &&
62+
pytest tests -m '(not cli) and (on_qaic) and (not nightly) and (not multimodal) and (not qnn) and (not finetune)' --ignore tests/vllm -n 4 --junitxml=tests/tests_log2.xml &&
6363
junitparser merge tests/tests_log2.xml tests/tests_log.xml &&
6464
deactivate"
6565
'''
@@ -97,7 +97,7 @@ pipeline {
9797
mkdir -p $PWD/cli &&
9898
export TOKENIZERS_PARALLELISM=false &&
9999
export QEFF_HOME=$PWD/cli &&
100-
pytest tests -m '(cli and not qnn) and (not finetune)' --ignore tests/vllm --junitxml=tests/tests_log3.xml &&
100+
pytest tests -m '(cli and not qnn) and (not finetune)' --ignore tests/vllm -n 4 --junitxml=tests/tests_log3.xml &&
101101
junitparser merge tests/tests_log3.xml tests/tests_log.xml &&
102102
deactivate"
103103
'''
@@ -126,7 +126,7 @@ pipeline {
126126
mkdir -p $PWD/Qnn_cli &&
127127
export TOKENIZERS_PARALLELISM=false &&
128128
export QEFF_HOME=$PWD/Qnn_cli &&
129-
pytest tests -m '(cli and qnn) and (not finetune)' --ignore tests/vllm --junitxml=tests/tests_log4.xml &&
129+
pytest tests -m '(cli and qnn) and (not finetune)' --ignore tests/vllm -n 4 --junitxml=tests/tests_log4.xml &&
130130
junitparser merge tests/tests_log4.xml tests/tests_log.xml &&
131131
deactivate"
132132
'''
@@ -145,7 +145,7 @@ pipeline {
145145
mkdir -p $PWD/Qnn_non_cli &&
146146
export TOKENIZERS_PARALLELISM=false &&
147147
export QEFF_HOME=$PWD/Qnn_non_cli &&
148-
pytest tests -m '(not cli) and (qnn) and (on_qaic) and (not multimodal) and (not finetune)' --ignore tests/vllm --junitxml=tests/tests_log5.xml &&
148+
pytest tests -m '(not cli) and (qnn) and (not nightly) and (on_qaic) and (not multimodal) and (not finetune)' --ignore tests/vllm -n 4 --junitxml=tests/tests_log5.xml &&
149149
junitparser merge tests/tests_log5.xml tests/tests_log.xml &&
150150
deactivate"
151151
'''

tests/cloud/conftest.py

Lines changed: 0 additions & 328 deletions
This file was deleted.

0 commit comments

Comments
 (0)