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 debug_dump_gcs to be specified with other XLA_FLAGS #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ environment from a file. Usage is the same as Docker's
```

* Workload create accepts a --debug-dump-gcs flag which is a path to GCS bucket.
Passing this flag sets the XLA_FLAGS='--xla_dump_to=/tmp/xla_dump/' and uploads
Passing this flag adds '--xla_dump_to=/tmp/xla_dump/' to XLA_FLAGS and uploads
hlo dumps to the specified GCS bucket for each worker.

# Integration Test Workflows
Expand Down
11 changes: 6 additions & 5 deletions xpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2058,13 +2058,14 @@ 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 flag defined by both --debug_dump_gcs '
'and XLA_FLAGS in container environment. Please choose one way to '
'define.'
)
env['XLA_FLAGS'] = '--xla_dump_to=/tmp/xla_dump/'
xla_flags = env.get('XLA_FLAGS', '')
env['XLA_FLAGS'] = xla_flags + ' --xla_dump_to=/tmp/xla_dump/'

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