Skip to content

[MRG] Warmstart with dual potentials for exact OT solver#793

Merged
rflamary merged 6 commits intoPythonOT:masterfrom
nathanneike:warmstart_simplex
Feb 13, 2026
Merged

[MRG] Warmstart with dual potentials for exact OT solver#793
rflamary merged 6 commits intoPythonOT:masterfrom
nathanneike:warmstart_simplex

Conversation

@nathanneike
Copy link
Contributor

@nathanneike nathanneike commented Feb 9, 2026

…omputed potentials from sinkhorn or even related simplex

Types of changes

Add Warmstart intialisation to the simplex solver allows us to give good potentials to our solvers and get why faster to solution with less iterations.

Motivation and context / Related issue

This change allows us to warmstart with potentials from other solvers. Instead of using normal initial pivots to create a Tree. We use the given potential to create a first feasible solution in our Simplex. If given potentials are good potential for big speedup. Still need to compute all Reduce Costs at least once which means that the running time for the warmstart can be big for big problems so should be done with good potentials and not just any potentials.

How has this been tested (if it applies)

Added a test for verifying correctness.
Speedup for exact potentials from an exact solve is around 3x and using good sinkhorn potentials 1.4x.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

…omputed potentials from sinkhorn or even related simplex
@github-actions github-actions bot added the ot.lp label Feb 9, 2026
@rflamary rflamary changed the title Simplex Warmstart [WIP] Warmstart from dual potentials for exact OT solver Feb 11, 2026
@rflamary rflamary changed the title [WIP] Warmstart from dual potentials for exact OT solver [WIP] Warmstart with dual potentials for exact OT solver Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.76%. Comparing base (5c92598) to head (2532edc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #793   +/-   ##
=======================================
  Coverage   96.76%   96.76%           
=======================================
  Files         107      107           
  Lines       22249    22282   +33     
=======================================
+ Hits        21529    21562   +33     
  Misses        720      720           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@rflamary rflamary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @nathanneike ,

It would be nice that you also provide a few computation times in the description of the PR so that we have an idea of the speedup when using warm start.

Note that potentials_init was used for warm start in ot.solve and you should use this same also in emd.

I would also like that you update ot.solve and ot.solve_sample to pass the warmstart to emd.

few other comments below

check_marginals: bool, optional (default=True)
If True, checks that the marginals mass are equal. If False, skips the
check.
warmstart_dual: tuple of two arrays (alpha, beta), optional (default=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to doc but not in teh function params and the call no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont get this one they are there, I use them later to set alpha and beta init

G_warm, log_warm = ot.emd(a, b, M, log=True, warmstart_dual=(u_partial, v_partial))

# cold-start reference
G_cold, log_cold = ot.emd(a, b, M, log=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also ad emd2 (which was missing)

@rflamary rflamary changed the title [WIP] Warmstart with dual potentials for exact OT solver [MRG] Warmstart with dual potentials for exact OT solver Feb 13, 2026
@rflamary rflamary merged commit 83d05f9 into PythonOT:master Feb 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants