Skip to content

Commit cc96bae

Browse files
abhishek002002Orbax Authors
authored andcommitted
Address blocker where benchmark runs failed to initialize JAX on Viperlite (vlp) and Ghostlite (glp) pods on Borg.
PiperOrigin-RevId: 945140560
1 parent 4f2db70 commit cc96bae

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

checkpoint/orbax/checkpoint/_src/testing/benchmarks/run_benchmarks.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
using standard environment variables like JAX_COORDINATOR_ADDRESS,
2121
JAX_PROCESS_ID and JAX_NUM_PROCESSES.
2222
"""
23-
# pylint: disable=g-statement-before-imports,g-import-not-at-top
23+
import os
2424

25-
try: # SimDevice import must occur before JAX.
26-
import simdevice # pylint: disable=unused-import
27-
except (ImportError, FileNotFoundError):
28-
pass
25+
# pylint: disable=g-statement-before-imports,g-import-not-at-top
26+
if os.environ.get('SIMDEVICE_CONFIG_PATH') or os.environ.get(
27+
'ENABLE_SIMDEVICE', ''
28+
).lower() in ('true', '1'):
29+
try: # SimDevice import must occur before JAX.
30+
import simdevice # pylint: disable=unused-import
31+
except (ImportError, FileNotFoundError):
32+
pass
2933

30-
import os
3134

3235
from absl import app
3336
from absl import flags

0 commit comments

Comments
 (0)