Skip to content

Commit

Permalink
PR #12633: Fix handling of unknown flags in the multihost HLO runner.
Browse files Browse the repository at this point in the history
Imported from GitHub PR openxla/xla#12633

Fixes openxla/xla#7923
Copybara import of the project:

--
71083c7d6dfdcaec1a5458b3f1cd04b11e13f8bd by Ilia Sergachev <isergachev@nvidia.com>:

Fix handling of unknown flags in the multihost HLO runner.

Merging this change closes #12633

PiperOrigin-RevId: 636229361
  • Loading branch information
sergachev authored and tensorflower-gardener committed May 22, 2024
1 parent f3341ea commit 5985851
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions third_party/xla/xla/tools/multihost_hlo_runner/hlo_runner_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ int main(int argc, char** argv) {
LOG(QFATAL) << kUsageString;
}
}
// tsl::Flags::Parse() leaves unknown flags in argv.
// argv[0] is always the program name.
if (argc > 1) {
if (hlo_file.empty()) {
LOG(INFO) << "--hlo_file was not specified; assuming " << argv[1]
<< " is the HLO file name.";
hlo_file = argv[1];
--argc;
}
CHECK_LT(argc, 2) << ": Encountered unknown flags.";
}

std::unique_ptr<xla::DistributedRuntimeService> service;

Expand Down

0 comments on commit 5985851

Please sign in to comment.