Skip to content

Batch solver - #91

Merged
klamike merged 52 commits into
madsuite-org:mainfrom
klamike:mk/nativebatch
Apr 28, 2026
Merged

Batch solver#91
klamike merged 52 commits into
madsuite-org:mainfrom
klamike:mk/nativebatch

Conversation

@klamike

@klamike klamike commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a batched solver to MadIPM. It takes as input implementations of AbstractBatchNLPModel from BatchQuadraticModels.jl.

The solver mimics closely the unbatched MadIPM algorithm, trying to keep the batched and unbatched code as close as possible not only in terms of the computations but also the syntax and code structure. The hope is to eventually (not in this PR) unify many of the functions.

Things I'd like to leave for future PRs:

@klamike klamike mentioned this pull request Mar 9, 2026
12 tasks
@frapac

frapac commented Mar 10, 2026

Copy link
Copy Markdown
Member

@klamike very nice work! I will review this PR in detail.

By any chance, can you share the script you are using to run the benchmark on the DC-OPF instances?

@frapac
frapac self-requested a review March 10, 2026 14:31
@sshin23

sshin23 commented Mar 10, 2026

Copy link
Copy Markdown
Member

This is awesome. Congratulations @klamike. Looks like we have strong scaling for the pglib_opf_case14_ieee case

@klamike

klamike commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator Author

Why a copy-paste ? There cannot be an abstract type that allows sharing code between the two ?

I didn't think about it too deeply, you are right that we can still have some code sharing. Once we have MadCore we can put generic MOI stuff there.

@klamike

klamike commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator Author

Note that 8baa4a0 also removes device sync for the unbatched solver. It improves the performance (which makes the batch speedup worse, but still ~10x on 1354x64)

@klamike

klamike commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

Okay, the code should be final now, including the tests. Note MadIPM doesn't have docs.

I'm getting started on the paper writing now. There can be another PR if any changes are needed for the paper benchmarks. And once we have MadCore ~70% of this code can probably be moved there.

@klamike
klamike requested a review from frapac March 31, 2026 17:21

@frapac frapac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just skimmed through the latest changes, they all look good to me.

I would suggest we move on and merge this PR. We can continue optimizing the code later, in subsequent PRs.

We now depend on BatchQuadraticModels, which is not released. I think it's fine keeping it, as it is specified in the [sources] inside the Project.toml. Long term, we will see if we do our own version of QuadraticModels with batch support.

@klamike
klamike merged commit 28c02ec into madsuite-org:main Apr 28, 2026
3 checks passed
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.

4 participants