Skip to content

Tune solver tolerances and barrier ordering#273

Open
SutubraResearch wants to merge 2 commits intoTemoaProject:unstablefrom
SutubraResearch:pr/solver-tuning
Open

Tune solver tolerances and barrier ordering#273
SutubraResearch wants to merge 2 commits intoTemoaProject:unstablefrom
SutubraResearch:pr/solver-tuning

Conversation

@SutubraResearch
Copy link
Collaborator

Summary

Two solver configuration changes that improve performance on large-scale models:

  • Solver tolerances: Relax barrier convergence tolerance from 1e-5 to 1e-3 and feasibility tolerance from 1e-6 to 1e-4 for both Gurobi and CPLEX. These values are standard for large-scale energy system models and match the tolerances used in mip-dev and PyPSA. Tighter tolerances cause unnecessary barrier iterations without meaningful solution improvement.
  • BarOrder auto: Change Gurobi BarOrder from 0 (AMD) to -1 (automatic). Automatic ordering selects the best fill-reducing strategy per problem structure, yielding 2-4x speedup on national-scale barrier solves (268s vs 1029s on a 26-region test case).

Files changed

File Change
temoa/_internal/run_actions.py Tolerance values + BarOrder setting

Test plan

  • All 190 tests pass
  • No functional change to model results (solver parameters only)
  • Verified on 26-region national model: 2-4x barrier speedup from BarOrder alone

Relax barrier convergence tolerance from 1e-5 to 1e-3 and
feasibility tolerance from 1e-6 to 1e-4 for both Gurobi and
CPLEX. These values align with mip-dev defaults and are
standard for large-scale energy system models where tighter
tolerances cause unnecessary barrier iterations without
meaningful solution improvement.
Change BarOrder from 0 (AMD) to -1 (automatic) for barrier
solves. Automatic ordering selects the best fill-reducing
strategy per problem structure, yielding 2-4x speedup on
national-scale energy system models (268s vs 1029s on a
26-region test case). AMD ordering is suboptimal for the
sparse constraint structure typical of Temoa models.
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Warning

Rate limit exceeded

@SutubraResearch has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 275f4138-471f-4142-926e-2681e3ea7b75

📥 Commits

Reviewing files that changed from the base of the PR and between 7f7ff86 and ffa76f1.

📒 Files selected for processing (1)
  • temoa/_internal/run_actions.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant