Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions benchmarks/experiment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ def generate_and_run_all_configs(self):
xla_flags = f"{xla_flags} {new_xla_flags}"
process_env["XLA_FLAGS"] = xla_flags

if self._args.save_ir_format:
path = self._get_results_file_path(experiment_cfg, model_cfg, "dump",
self._args.save_ir_format)
process_env["XLA_SAVE_TENSORS_FMT"] = self._args.save_ir_format
process_env["XLA_SAVE_TENSORS_FILE"] = str(path)

# Launch subprocess.
try:
command = [sys.executable] + sys.argv + [
Expand Down Expand Up @@ -1006,6 +1012,11 @@ def __str__(self):
type=int,
help="Defines the duration of the profiling when `profile-xla` flag is set.",
)
parser.add_argument(
"--save-ir-format",
choices=["text", "hlo", "stablehlo"],
help="Save intermediate IR.",
)
return parser.parse_args(args)


Expand Down