2025-03-14 14:13:30 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2025-04-03 14:23:28 -07:00
|
|
|
set -xue
|
2025-03-14 14:13:30 -07:00
|
|
|
|
|
|
|
# Build the docker image.
|
2025-03-31 21:47:32 +01:00
|
|
|
docker build -f docker/Dockerfile.tpu -t vllm-tpu .
|
2025-03-14 14:13:30 -07:00
|
|
|
|
|
|
|
# Set up cleanup.
|
|
|
|
remove_docker_container() { docker rm -f tpu-test || true; }
|
|
|
|
trap remove_docker_container EXIT
|
|
|
|
# Remove the container that might not be cleaned up in the previous run.
|
|
|
|
remove_docker_container
|
|
|
|
|
|
|
|
# For HF_TOKEN.
|
|
|
|
source /etc/environment
|
|
|
|
# Run a simple end-to-end example.
|
|
|
|
docker run --privileged --net host --shm-size=16G -it \
|
2025-03-17 17:07:07 -04:00
|
|
|
-e "HF_TOKEN=$HF_TOKEN" --name tpu-test \
|
2025-03-14 14:13:30 -07:00
|
|
|
vllm-tpu /bin/bash -c "python3 -m pip install git+https://github.com/thuml/depyf.git \
|
|
|
|
&& python3 -m pip install pytest \
|
|
|
|
&& python3 -m pip install lm_eval[api]==0.4.4 \
|
2025-03-20 20:05:28 -07:00
|
|
|
&& export VLLM_USE_V1=1 \
|
|
|
|
&& export VLLM_XLA_CHECK_RECOMPILATION=1 \
|
2025-03-31 13:25:20 -04:00
|
|
|
&& echo TEST_0 \
|
|
|
|
&& pytest -v -s /workspace/vllm/tests/v1/tpu/test_perf.py \
|
2025-03-17 17:07:07 -04:00
|
|
|
&& echo TEST_1 \
|
2025-03-26 17:51:54 -04:00
|
|
|
&& pytest -v -s /workspace/vllm/tests/tpu/test_compilation.py \
|
2025-03-17 17:07:07 -04:00
|
|
|
&& echo TEST_2 \
|
2025-03-20 20:05:28 -07:00
|
|
|
&& pytest -v -s /workspace/vllm/tests/v1/tpu/test_basic.py \
|
2025-03-17 17:07:07 -04:00
|
|
|
&& echo TEST_3 \
|
2025-03-20 20:05:28 -07:00
|
|
|
&& pytest -v -s /workspace/vllm/tests/entrypoints/llm/test_accuracy.py::test_lm_eval_accuracy_v1_engine \
|
2025-03-17 17:07:07 -04:00
|
|
|
&& echo TEST_4 \
|
2025-03-29 05:13:06 +01:00
|
|
|
&& pytest -s -v /workspace/vllm/tests/tpu/test_quantization_accuracy.py \
|
2025-03-27 22:45:05 -04:00
|
|
|
&& echo TEST_5 \
|
2025-03-29 05:13:06 +01:00
|
|
|
&& python3 /workspace/vllm/examples/offline_inference/tpu.py \
|
2025-03-27 22:45:05 -04:00
|
|
|
&& echo TEST_6 \
|
2025-03-29 05:13:06 +01:00
|
|
|
&& pytest -s -v /workspace/vllm/tests/v1/tpu/worker/test_tpu_model_runner.py \
|
|
|
|
&& echo TEST_7 \
|
2025-04-02 17:18:08 -07:00
|
|
|
&& pytest -s -v /workspace/vllm/tests/v1/tpu/test_sampler.py \
|
|
|
|
&& echo TEST_8 \
|
2025-04-03 14:23:28 -07:00
|
|
|
&& pytest -s -v /workspace/vllm/tests/v1/tpu/test_topk_topp_sampler.py \
|
|
|
|
&& echo TEST_9 \
|
|
|
|
&& pytest -s -v /workspace/vllm/tests/v1/tpu/test_pallas.py" \
|
2025-03-20 20:05:28 -07:00
|
|
|
|
2025-03-17 17:07:07 -04:00
|
|
|
|
2025-03-18 17:39:21 -04:00
|
|
|
# TODO: This test fails because it uses RANDOM_SEED sampling
|
2025-03-17 17:07:07 -04:00
|
|
|
# && VLLM_USE_V1=1 pytest -v -s /workspace/vllm/tests/tpu/test_custom_dispatcher.py \
|