Skip to content

Commit

Permalink
merge main and edit configs/bash script to interate inside subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
horheynm committed Dec 9, 2024
1 parent 7de0afb commit ff8e39d
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 25 deletions.
32 changes: 18 additions & 14 deletions tests/e2e/vLLM/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@ SUCCESS=0
# Parse list of configs.
MODEL_CONFIGS="$PWD/tests/e2e/vLLM/configs"

for MODEL_CONFIG in "$MODEL_CONFIGS"/*
do
# Function to process a file
process_model_config() {
local MODEL_CONFIG=$1
LOCAL_SUCCESS=0

echo "=== RUNNING MODEL: $MODEL_CONFIG ==="

export TEST_DATA_FILE="$MODEL_CONFIG"
pytest \
--capture=tee-sys \
--junitxml="test-results/e2e-$(date +%s).xml" \
"$PWD/tests/e2e/vLLM/test_vllm.py" || LOCAL_SUCCESS=$?

export TEST_DATA_FILE=${MODEL_CONFIG}
pytest -s $PWD/tests/e2e/vLLM/test_vllm.py || LOCAL_SUCCESS=$?
if [[ $LOCAL_SUCCESS == 0 ]]; then
echo "=== PASSED MODEL: $MODEL_CONFIG ==="
echo "=== PASSED MODEL: ${MODEL_CONFIG} ==="
else
echo "=== FAILED MODEL: $MODEL_CONFIG ==="
echo "=== FAILED MODEL: ${MODEL_CONFIG} ==="
fi

SUCCESS=$((SUCCESS + LOCAL_SUCCESS))
}

# Use find to locate all files in MODEL_CONFIGS and process them
find "$MODEL_CONFIGS" -type f | while read -r MODEL_CONFIG
do
process_model_config "$MODEL_CONFIG"
done

exit "$SUCCESS"
if [ "${SUCCESS}" -eq "0" ]; then
exit 0
else
exit 1
fi
12 changes: 1 addition & 11 deletions tests/e2e/vLLM/test_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,10 @@
vllm_installed = False
logger.warning("vllm is not installed. This test will be skipped")

# Defines the file paths to the directories containing the test configs
# for each of the quantization schemes
WNA16 = "tests/e2e/vLLM/configs/WNA16"
FP8 = "tests/e2e/vLLM/configs/FP8"
INT8 = "tests/e2e/vLLM/configs/INT8"
ACTORDER = "tests/e2e/vLLM/configs/actorder"
KV_CACHE = "tests/e2e/vLLM/configs/kv_cache"
WNA16_2of4 = "tests/e2e/vLLM/configs/WNA16_2of4"

CONFIGS = [WNA16, FP8, INT8, ACTORDER, WNA16_2of4, KV_CACHE]

HF_MODEL_HUB_NAME = "nm-testing"
TEST_DATA_FILE = os.environ.get("TEST_DATA_FILE", None)


# Will run each test case in its own process through run_tests.sh
# emulating vLLM CI testing
@requires_gpu_count(1)
Expand Down

0 comments on commit ff8e39d

Please sign in to comment.