Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 88368d3

Browse files
DarkLight1337Robert Shaw
authored andcommitted
[CI/Build] Add inputs tests (vllm-project#5215)
1 parent 0e8a84d commit 88368d3

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ steps:
6262
mirror_hardwares: [amd]
6363

6464
commands:
65-
- pytest -v -s test_inputs.py
6665
- pytest -v -s entrypoints -m llm
6766
- pytest -v -s entrypoints -m openai
6867

@@ -79,6 +78,13 @@ steps:
7978
- python3 llava_example.py
8079
- python3 tensorize_vllm_model.py --model facebook/opt-125m serialize --serialized-directory /tmp/ --suffix v1 && python3 tensorize_vllm_model.py --model facebook/opt-125m deserialize --path-to-tensors /tmp/vllm/facebook/opt-125m/v1/model.tensors
8180

81+
- label: Inputs Test
82+
#mirror_hardwares: [amd]
83+
commands:
84+
- bash ../.buildkite/download-images.sh
85+
- pytest -v -s test_inputs.py
86+
- pytest -v -s multimodal
87+
8288
- label: Kernels Test %N
8389
#mirror_hardwares: [amd]
8490
command: pytest -v -s kernels --shard-id=$$BUILDKITE_PARALLEL_JOB --num-shards=$$BUILDKITE_PARALLEL_JOB_COUNT

tests/multimodal/test_processor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
from vllm.multimodal import MULTIMODAL_REGISTRY
77
from vllm.multimodal.image import ImagePixelData
88

9+
from ..conftest import _STR_DTYPE_TO_TORCH_DTYPE
910

10-
@pytest.mark.parametrize("dtype", ["half", "bfloat16", "float"])
11+
12+
@pytest.mark.parametrize("dtype", ["half", "float"])
1113
def test_clip_image_processor(hf_images, dtype):
1214
MODEL_NAME = "llava-hf/llava-1.5-7b-hf"
1315
IMAGE_HEIGHT = IMAGE_WIDTH = 33
@@ -36,16 +38,17 @@ def test_clip_image_processor(hf_images, dtype):
3638
for image in hf_images:
3739
hf_result = hf_processor.preprocess(
3840
image,
39-
return_tensors="np",
40-
)
41+
return_tensors="pt",
42+
).to(dtype=_STR_DTYPE_TO_TORCH_DTYPE[dtype])
4143
vllm_result = MULTIMODAL_REGISTRY.process_input(
4244
ImagePixelData(image),
4345
model_config=model_config,
4446
vlm_config=vlm_config,
4547
)
4648

4749
assert hf_result.keys() == vllm_result.keys()
48-
for key, hf_arr in hf_result.items():
50+
for key, hf_tensor in hf_result.items():
51+
hf_arr: np.ndarray = hf_tensor.numpy()
4952
vllm_arr: np.ndarray = vllm_result[key].numpy()
5053

5154
assert hf_arr.shape == vllm_arr.shape, f"Failed for key={key}"

0 commit comments

Comments
 (0)