Mentions légales du service

Skip to content
Snippets Groups Projects
  • ANDREY Paul's avatar
    549b7766
    Update 'tox.ini' to improve GPU usage. · 549b7766
    ANDREY Paul authored
    - Add environment variables to prevent over-allocation of GPU VRAM
      by TensorFlow and/or Jax.
    - Add 'py{3x}-ci' test environments that are tweaked specifically
      for our CI runner, adding instructions that offer as much support
      for GPU as possible given our runner host's configuration.
    - At the moment, an update of the host to the latest CUDA version
      enables native support for Torch, and TensorFlow with Python>=3.9
      (but not 3.8), plus Jax with some extra installation command.
    Verified
    549b7766
    History
    Update 'tox.ini' to improve GPU usage.
    ANDREY Paul authored
    - Add environment variables to prevent over-allocation of GPU VRAM
      by TensorFlow and/or Jax.
    - Add 'py{3x}-ci' test environments that are tweaked specifically
      for our CI runner, adding instructions that offer as much support
      for GPU as possible given our runner host's configuration.
    - At the moment, an update of the host to the latest CUDA version
      enables native support for Torch, and TensorFlow with Python>=3.9
      (but not 3.8), plus Jax with some extra installation command.
tox.ini 2.00 KiB
[tox]
envlist = py38
minversion = 3.18.0
install_command =
    python -I -m pip install -U {opts} {packages}


[testenv:py{38,39,310,311,312}]
description =
    "Default job, running all kinds of tests."
extras =
    all,tests
allowlist_externals =
    bash
commands=
    bash scripts/run_tests.sh lint_code
    bash scripts/run_tests.sh lint_tests
    bash scripts/run_tests.sh run_tests {posargs}
set_env =
    TF_FORCE_GPU_ALLOW_GROWTH=true  # prevent TensorFlow GPU pre-allocation
    XLA_PYTHON_CLIENT_PREALLOCATE=false  # prevent Jax GPU pre-allocation


[testenv:py{38,39,310,311,312}-ci]
description =
    "CI-runner-adjusted job, running all kinds of tests."
extras =
    all,tests
allowlist_externals =
    bash
commands_pre =
    # Install JaxLib compiled with CUDA 12 support.
    pip install jax[cuda12_pip]~=0.4.1 \
      -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
commands =
    bash scripts/run_tests.sh lint_code
    bash scripts/run_tests.sh lint_tests
    bash scripts/run_tests.sh run_tests {posargs}
set_env =
    TF_FORCE_GPU_ALLOW_GROWTH=true  # prevent TensorFlow GPU pre-allocation
    XLA_PYTHON_CLIENT_PREALLOCATE=false  # prevent Jax GPU pre-allocation


[testenv:py{38,39,310,311,312}-tests]
description =
    "Individualized job to run unit and integration tests."
extras =
    all,tests
allowlist_externals =
    bash
commands=
    bash scripts/run_tests.sh run_tests {posargs}
set_env =
    TF_FORCE_GPU_ALLOW_GROWTH=true  # prevent TensorFlow GPU pre-allocation
    XLA_PYTHON_CLIENT_PREALLOCATE=false  # prevent Jax GPU pre-allocation


[testenv:py{38,39,310,311,312}-lint_code]
description =
    "Individualized job to run source code static analysis."
extras =
    all,tests
allowlist_externals =
    bash
commands =
    bash scripts/run_tests.sh lint_code


[testenv:py{38,39,310,311,312}-lint_tests]
description =
    "Individualized job to run test code static analysis."
extras =
    all,tests
allowlist_externals =
    bash
commands =
    bash scripts/run_tests.sh lint_tests