Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set XLA_FLAGS with --debug_dump_gcs #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/xpk/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,17 @@ def parse_env_config(args, tensorboard_config, system: SystemCharacteristics):

if not args.use_pathways:
if args.debug_dump_gcs:
if 'XLA_FLAGS' in env:
if 'XLA_FLAGS' in env and '--xla_dump_to' in env['XLA_FLAGS']:
raise ValueError(
'Conflict: XLA_FLAGS defined in both --debug_dump_gcs '
'and environment file. Please choose one way to define '
'XLA_FLAGS.'
'Conflict: --xla_dump_to defined in both --debug_dump_gcs '
'and environment file via XLA_FLAGS. Please choose one way '
'to define it.'
)
env['XLA_FLAGS'] = '--xla_dump_to=/tmp/xla_dump/'
other_flags = ''
if 'XLA_FLAGS' in env:
other_flags = env['XLA_FLAGS']

env['XLA_FLAGS'] = '--xla_dump_to=/tmp/xla_dump/ ' + other_flags

if tensorboard_config:
env['UPLOAD_DATA_TO_TENSORBOARD'] = True
Expand Down
Loading