Skip to content

Commit c440e1c

Browse files
Allow set XLA_FLAGS with --debug_dump_gcs
1 parent 5c6124a commit c440e1c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/xpk/core/core.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,17 @@ def parse_env_config(args, tensorboard_config, system: SystemCharacteristics):
233233

234234
if not args.use_pathways:
235235
if args.debug_dump_gcs:
236-
if 'XLA_FLAGS' in env:
236+
if 'XLA_FLAGS' in env and '--xla_dump_to' in env['XLA_FLAGS']:
237237
raise ValueError(
238-
'Conflict: XLA_FLAGS defined in both --debug_dump_gcs '
239-
'and environment file. Please choose one way to define '
240-
'XLA_FLAGS.'
238+
'Conflict: --xla_dump_to defined in both --debug_dump_gcs '
239+
'and environment file via XLA_FLAGS. Please choose one way '
240+
'to define it.'
241241
)
242-
env['XLA_FLAGS'] = '--xla_dump_to=/tmp/xla_dump/'
242+
other_flags = ''
243+
if 'XLA_FLAGS' in env:
244+
other_flags = env['XLA_FLAGS']
245+
246+
env['XLA_FLAGS'] = '--xla_dump_to=/tmp/xla_dump/ ' + other_flags
243247

244248
if tensorboard_config:
245249
env['UPLOAD_DATA_TO_TENSORBOARD'] = True

0 commit comments

Comments
 (0)