Adds GPU CI for TensorFlow (#18549)

* Adds GPU CI for TensorFlow

* Adds GPU CI for TensorFlow

* Adds GPU CI for TensorFlow
This commit is contained in:
Ramesh Sampath 2023-10-05 04:02:58 -05:00 committed by GitHub
parent 38bfa3cb76
commit 5ff811dc7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 0 deletions

@ -0,0 +1,31 @@
set -e
set -x
cd "${KOKORO_ROOT}/"
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
PYTHON_BINARY="/usr/bin/python3.9"
"${PYTHON_BINARY}" -m venv venv
source venv/bin/activate
# Check the python version
python --version
python3 --version
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:"
cd "src/github/keras"
pip install -U pip setuptools
pip install -r requirements.txt --progress-bar off
if [ "$KERAS_BACKEND" == "tensorflow" ]
then
echo "TensorFlow backend detected."
pip uninstall -y tensorflow-cpu
pip install -U tensorflow
echo "Check that TensorFlow uses GPU"
python3 -c 'import tensorflow as tf;assert len(tf.config.list_physical_devices("GPU")) > 0'
fi
pip uninstall -y keras
pytest keras --ignore keras/applications --cov=keras

@ -0,0 +1,8 @@
build_file: "keras/keras/kokoro/github/ubuntu/gpu/build.sh"
action {
define_artifacts {
regex: "**/sponge_log.log"
regex: "**/sponge_log.xml"
}
}

@ -0,0 +1,13 @@
build_file: "keras/keras/kokoro/github/ubuntu/gpu/build.sh"
action {
define_artifacts {
regex: "**/sponge_log.log"
regex: "**/sponge_log.xml"
}
}
env_vars: {
key: "KERAS_BACKEND"
value: "tensorflow"
}