Skip to content

Commit b8caffb

Browse files
authored
fix: Fix L0_backend_python test (#8178)
1 parent 7866ef4 commit b8caffb

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

qa/L0_backend_python/common.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -85,7 +85,11 @@ create_conda_env_with_specified_path() {
8585
create_python_backend_stub() {
8686
rm -rf python_backend
8787
git clone ${TRITON_REPO_ORGANIZATION}/python_backend -b $PYTHON_BACKEND_REPO_TAG
88+
CUDA_PATH=$(readlink -f /usr/local/cuda)
8889
(cd python_backend/ && mkdir builddir && cd builddir && \
89-
cmake -DTRITON_ENABLE_GPU=ON -DTRITON_REPO_ORGANIZATION:STRING=${TRITON_REPO_ORGANIZATION} -DTRITON_BACKEND_REPO_TAG=$TRITON_BACKEND_REPO_TAG -DTRITON_COMMON_REPO_TAG=$TRITON_COMMON_REPO_TAG -DTRITON_CORE_REPO_TAG=$TRITON_CORE_REPO_TAG -DPYBIND11_PYTHON_VERSION=$PY_VERSION ../ && \
90+
cmake -DTRITON_ENABLE_GPU=ON -DCMAKE_CUDA_COMPILER=$CUDA_PATH/bin/nvcc \
91+
-DCUDAToolkit_ROOT=$CUDA_PATH -DTRITON_REPO_ORGANIZATION:STRING=${TRITON_REPO_ORGANIZATION} \
92+
-DTRITON_BACKEND_REPO_TAG=$TRITON_BACKEND_REPO_TAG -DTRITON_COMMON_REPO_TAG=$TRITON_COMMON_REPO_TAG \
93+
-DTRITON_CORE_REPO_TAG=$TRITON_CORE_REPO_TAG -DPYBIND11_PYTHON_VERSION=$PY_VERSION ../ && \
9094
make -j18 triton-python-backend-stub)
9195
}

qa/L0_backend_python/env/test.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ conda install numpy=1.26.4 -y
5353
if [ $TRITON_RHEL -eq 1 ]; then
5454
TORCH_VERISON="2.17.0"
5555
fi
56-
conda install torch=${TORCH_VERSION} -y
57-
PY312_VERSION_STRING="Python version is 3.12, NumPy version is 1.26.4, and PyTorch version is ${TORCH_VERISON}"
56+
conda install pytorch=${TORCH_VERSION} -y
57+
PY312_VERSION_STRING="Python version is 3.12, NumPy version is 1.26.4, and PyTorch version is ${TORCH_VERSION}"
5858
conda pack -o python3.12.tar.gz
5959
mkdir -p models/python_3_12/1/
6060
cp ../../python_models/python_version/config.pbtxt ./models/python_3_12
@@ -122,7 +122,7 @@ fi
122122
kill_server
123123

124124
set +e
125-
grep "Locale is ('en_US', 'UTF-8')" $SERVER_LOG
125+
grep "Locale is ('C', 'UTF-8')" $SERVER_LOG
126126
if [ $? -ne 0 ]; then
127127
cat $SERVER_LOG
128128
echo -e "\n***\n*** Locale UTF-8 was not found in Triton logs. \n***"
@@ -182,10 +182,6 @@ aws s3 mb "${BUCKET_URL}"
182182
BUCKET_URL=${BUCKET_URL%/}
183183
BUCKET_URL_SLASH="${BUCKET_URL}/"
184184

185-
# Remove Python 3.7 model because it contains absolute paths and cannot be used
186-
# with S3.
187-
rm -rf models/python_3_7
188-
189185
# Test with the bucket url as model repository
190186
aws s3 cp models/ "${BUCKET_URL_SLASH}" --recursive --include "*"
191187

@@ -205,10 +201,10 @@ fi
205201
kill_server
206202

207203
set +e
208-
grep "$PY36_VERSION_STRING" $SERVER_LOG
204+
grep "$PY312_VERSION_STRING" $SERVER_LOG
209205
if [ $? -ne 0 ]; then
210206
cat $SERVER_LOG
211-
echo -e "\n***\n*** $PY36_VERSION_STRING was not found in Triton logs. \n***"
207+
echo -e "\n***\n*** $PY312_VERSION_STRING was not found in Triton logs. \n***"
212208
RET=1
213209
fi
214210
set -e
@@ -217,8 +213,6 @@ set -e
217213
aws s3 rm "${BUCKET_URL_SLASH}" --recursive --include "*"
218214

219215
# Test with EXECUTION_ENV_PATH outside the model directory
220-
sed -i "s/TRITON_MODEL_DIRECTORY\/python_3_6_environment/TRITON_MODEL_DIRECTORY\/..\/python_3_6_environment/" models/python_3_6/config.pbtxt
221-
mv models/python_3_6/python_3_6_environment.tar.gz models
222216
sed -i "s/\$\$TRITON_MODEL_DIRECTORY\/python_3_12_environment/s3:\/\/triton-bucket-${CI_JOB_ID}\/python_3_12_environment/" models/python_3_12/config.pbtxt
223217
mv models/python_3_12/python_3_12_environment.tar.gz models
224218

@@ -238,7 +232,7 @@ fi
238232
kill_server
239233

240234
set +e
241-
for EXPECTED_VERSION_STRING in "$PY36_VERSION_STRING" "$PY312_VERSION_STRING"; do
235+
for EXPECTED_VERSION_STRING in "$PY312_VERSION_STRING"; do
242236
grep "$EXPECTED_VERSION_STRING" $SERVER_LOG
243237
if [ $? -ne 0 ]; then
244238
cat $SERVER_LOG

qa/L0_backend_python/examples/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -69,7 +69,7 @@ pip3 install validators
6969
# Install JAX
7070
# Jax has dropped the support for Python 3.8. See https://jax.readthedocs.io/en/latest/changelog.html
7171
if [ "$TEST_JETSON" == "0" ] && [ ${PYTHON_ENV_VERSION} != "8" ]; then
72-
pip3 install --upgrade "jax[cuda12_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
72+
pip install -U "jax[cuda12]"
7373
fi
7474

7575
git clone ${TRITON_REPO_ORGANIZATION}/python_backend -b $PYTHON_BACKEND_REPO_TAG

qa/L0_backend_python/setup_python_enviroment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ conda update -n base -c defaults conda -y
5656
# been setup correctly.
5757
if [ ${PYTHON_ENV_VERSION} = "11" ]; then
5858
create_conda_env "3.11" "python-3-11"
59-
conda install torch=2.6.0 -y
59+
conda install pytorch=2.6.0 -y
6060
conda install -c conda-forge libstdcxx-ng=14 -y
6161
conda install numpy=1.23.5 -y
6262
EXPECTED_VERSION_STRING="Python version is 3.11, NumPy version is 1.23.5, and PyTorch version is 2.6.0"

0 commit comments

Comments
 (0)