Skip to content

Commit 8610385

Browse files
committed
Fix JAX GPU tests.
Using XLA_PYTHON_CLIENT_MEM_FRACTION.
1 parent e4bca84 commit 8610385

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.kokoro/github/ubuntu/gpu/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ python3 --version
1818
# Check cuda
1919
nvidia-smi
2020
nvcc --version
21+
echo "LD_LIBRARY_PATH before ${LD_LIBRARY_PATH}"
2122

2223
cd "src/github/keras"
2324
pip install -U pip setuptools
@@ -43,13 +44,18 @@ fi
4344

4445
if [ "$KERAS_BACKEND" == "jax" ]
4546
then
47+
export XLA_PYTHON_CLIENT_MEM_FRACTION=.5
48+
export JAX_TRACEBACK_FILTERING=off
49+
4650
echo "JAX backend detected."
4751
pip install -r requirements-jax-cuda.txt --progress-bar off --timeout 1000
4852
pip uninstall -y keras keras-nightly
4953
python3 -c 'import jax;print(jax.__version__);print(jax.default_backend())'
5054
# Raise error if GPU is not detected.
5155
python3 -c 'import jax;assert jax.default_backend().lower() == "gpu"'
5256

57+
echo "LD_LIBRARY_PATH after ${LD_LIBRARY_PATH}"
58+
5359
# TODO: keras/layers/merging/merging_test.py::MergingLayersTest::test_sparse_dot_2d Fatal Python error: Aborted
5460
# TODO: keras/trainers/data_adapters/py_dataset_adapter_test.py::PyDatasetAdapterTest::test_basic_flow0 Fatal Python error: Aborted
5561
# keras/backend/jax/distribution_lib_test.py is configured for CPU test for now.

.kokoro/github/ubuntu/gpu/jax/continuous.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ action {
77
}
88
}
99

10-
env_vars: {
10+
env_vars {
1111
key: "KERAS_BACKEND"
1212
value: "jax"
1313
}

.kokoro/github/ubuntu/gpu/jax/presubmit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ action {
77
}
88
}
99

10-
env_vars: {
10+
env_vars {
1111
key: "KERAS_BACKEND"
1212
value: "jax"
1313
}

0 commit comments

Comments
 (0)