Skip to content

Commit

Permalink
Updates the solver to accept feasible -- albeit suboptimal -- solutions.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 679744195
  • Loading branch information
Google-ML-Automation committed Sep 28, 2024
1 parent 0f30f33 commit 7b3dd96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xla/hlo/experimental/auto_sharding/auto_sharding_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,14 @@ AutoShardingSolverResult SolveAndExtractSolution(
} else if (status == operations_research::MPSolver::MODEL_INVALID) {
LOG(FATAL) << "Solver says that the input MIP is invalid. This is most "
"likely a bug and should be reported.";
return AutoShardingSolverResult(absl::InternalError("Solver timed out."),
return AutoShardingSolverResult(absl::InternalError("Invalid MIP."),
/*skip_auto_sharding=*/false);
} else if (status != operations_research::MPSolver::OPTIMAL) {
} else if (status == operations_research::MPSolver::NOT_SOLVED) {
LOG(WARNING) << "Solver timeout; no solution was produced";
return AutoShardingSolverResult(absl::InternalError("Solver timed out."),
/*skip_auto_sharding=*/true);
} else if (status != operations_research::MPSolver::OPTIMAL) {
LOG(WARNING) << "Solver timeout; moving forward with a suboptimal solution";
}

// Fingerprint the model & solution (useful when checking for determinism).
Expand Down

0 comments on commit 7b3dd96

Please sign in to comment.