-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·72 lines (64 loc) · 2.33 KB
/
Copy pathrun_tests.sh
File metadata and controls
executable file
·72 lines (64 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# Copyright 2026 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
WORKSPACE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
# Point to the directory containing the compiled extension libraries and source files
# We also include the workspace parent dir to map absolute 'google3.third_party...' python imports!
export PYTHONPATH="${WORKSPACE_DIR}:${WORKSPACE_DIR}/bazel-bin:${PYTHONPATH}"
RUN_JAX=true
RUN_TORCH=true
if [ "$#" -gt 0 ]; then
case "$1" in
jax)
RUN_JAX=true
RUN_TORCH=false
shift
;;
torch)
RUN_JAX=false
RUN_TORCH=true
shift
;;
both)
RUN_JAX=true
RUN_TORCH=true
shift
;;
-*)
;;
*)
echo "Usage: $0 [jax|torch|both]"
exit 1
;;
esac
fi
if [ "$RUN_JAX" = true ]; then
echo "=== Running JAX Python Unit Tests ==="
python "${WORKSPACE_DIR}/tpu_sync/frameworks/jax/kv_cache_manager_test.py"
python "${WORKSPACE_DIR}/tpu_sync/frameworks/jax/resharding_planner_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/jax/kv_cache_manager_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/jax/kv_cache_store_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/jax/kv_cache_manager_transfer_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/jax/weight_synchronizer_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/jax/kv_cache_manager_mpmd_test.py"
fi
if [ "$RUN_TORCH" = true ]; then
echo "=== Running Torch Python Unit Tests ==="
python "${WORKSPACE_DIR}/tpu_sync/frameworks/torch/kv_cache_manager_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/torch/kv_cache_manager_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/torch/kv_cache_manager_transfer_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/torch/weight_synchronizer_test.py"
python "${WORKSPACE_DIR}/tpu_sync/api/torch/kv_cache_manager_mpmd_test.py"
fi