Skip to content

Commit

Permalink
Change flag name to enable exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 24, 2025
1 parent 3609333 commit 8cce1e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ The logging and exceptions configurations is controlled by the following environ

*Default:* ``DEBUG`` for development, ``WARNING`` for production.

- ``JAXSIM_DISABLE_EXCEPTIONS``: Disables the runtime checks and exceptions. Note that enabling exceptions might lead to device-to-host transfer of data, increasing the computational time required.
- ``JAXSIM_ENABLE_EXCEPTIONS``: Enables the runtime checks and exceptions. Note that enabling exceptions might lead to device-to-host transfer of data, increasing the computational time required.

*Default:* ``True``.
*Default:* ``False``.

.. note::
Runtime exceptions are disabled by default on TPU.
4 changes: 2 additions & 2 deletions src/jaxsim/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def raise_if(

# Disable host callback if running on unsupported hardware or if the user
# explicitly disabled it.
if jax.devices()[0].platform in {"tpu", "METAL"} or os.environ.get(
"JAXSIM_DISABLE_EXCEPTIONS", 1
if jax.devices()[0].platform in {"tpu", "METAL"} or not os.environ.get(
"JAXSIM_ENABLE_EXCEPTIONS", 0
):
return

Expand Down

0 comments on commit 8cce1e1

Please sign in to comment.