main
sh 66 lines 2.45 KB
Raw
1 #!/bin/bash
2 set -euox pipefail
3
4 export VLLM_CPU_KVCACHE_SPACE=1
5 export VLLM_CPU_CI_ENV=1
6 # Skip torch.compile via vLLM's --enforce-eager flag (passed below) instead of
7 # TORCH_COMPILE_DISABLE=1, which torch 2.12 no longer treats as a silent no-op
8 # when callers specify fullgraph=True.
9 export VLLM_ENABLE_V1_MULTIPROCESSING=0
10
11 SDE_ARCHIVE="sde-external-10.7.0-2026-02-18-lin.tar.xz"
12 SDE_CHECKSUM="CA3D4086DE4ACB3FAEDF9F57B541C6936B7D5E19AE2BF763B6EA933573A0A217"
13 wget "https://downloadmirror.intel.com/913594/${SDE_ARCHIVE}"
14 echo "${SDE_CHECKSUM} ${SDE_ARCHIVE}" | sha256sum --check
15 mkdir -p sde
16 tar -xvf "./${SDE_ARCHIVE}" --strip-components=1 -C ./sde/
17
18 wait_for_pid_and_check_log() {
19 local pid="$1"
20 local log_file="$2"
21 local exit_status
22
23 if [ -z "$pid" ] || [ -z "$log_file" ]; then
24 echo "Usage: wait_for_pid_and_check_log <PID> <LOG_FILE>"
25 return 1
26 fi
27
28 echo "Waiting for process $pid to finish..."
29
30 # Use the 'wait' command to pause the script until the specific PID exits.
31 # The 'wait' command's own exit status will be that of the waited-for process.
32 if wait "$pid"; then
33 exit_status=$?
34 echo "Process $pid finished with exit status $exit_status (Success)."
35 else
36 exit_status=$?
37 echo "Process $pid finished with exit status $exit_status (Failure)."
38 fi
39
40 if [ "$exit_status" -ne 0 ]; then
41 echo "Process exited with a non-zero status."
42 echo "--- Last few lines of log file: $log_file ---"
43 tail -n 50 "$log_file"
44 echo "---------------------------------------------"
45 return 1 # Indicate failure based on exit status
46 fi
47
48 echo "No errors detected in log file and process exited successfully."
49 return 0
50 }
51
52 # Test Sky Lake (AVX512F)
53 ./sde/sde64 -skl -- python3 examples/basic/offline_inference/generate.py --model facebook/opt-125m --dtype bfloat16 --enforce-eager > test_0.log 2>&1 &
54 PID_TEST_0=$!
55
56 # Test Cascade Lake (AVX512F + VNNI)
57 ./sde/sde64 -clx -- python3 examples/basic/offline_inference/generate.py --model facebook/opt-125m --dtype bfloat16 --enforce-eager > test_1.log 2>&1 &
58 PID_TEST_1=$!
59
60 # Test Cooper Lake (AVX512F + VNNI + BF16)
61 ./sde/sde64 -cpx -- python3 examples/basic/offline_inference/generate.py --model facebook/opt-125m --dtype bfloat16 --enforce-eager > test_2.log 2>&1 &
62 PID_TEST_2=$!
63
64 wait_for_pid_and_check_log $PID_TEST_0 test_0.log
65 wait_for_pid_and_check_log $PID_TEST_1 test_1.log
66 wait_for_pid_and_check_log $PID_TEST_2 test_2.log