Skip to content

Commit

Permalink
set xla flags before any imports
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Nov 8, 2024
1 parent 31f9e87 commit 050c20c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 10 additions & 0 deletions source/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import os

# set XLA FLAGS before any jax import
os.environ["XLA_FLAGS"] = " ".join(
(
"--xla_cpu_multi_thread_eigen=false",
"intra_op_parallelism_threads=1",
"inter_op_parallelism_threads=1",
)
)
9 changes: 0 additions & 9 deletions source/tests/jax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import os

os.environ["XLA_FLAGS"] = " ".join(
(
"--xla_cpu_multi_thread_eigen=false",
"intra_op_parallelism_threads=1",
"inter_op_parallelism_threads=1",
)
)

0 comments on commit 050c20c

Please sign in to comment.