bench: Ipopt + MadNLP allocation profile script#71
Open
jack-champagne wants to merge 3 commits intofeat/madnlp-integrationfrom
Open
bench: Ipopt + MadNLP allocation profile script#71jack-champagne wants to merge 3 commits intofeat/madnlp-integrationfrom
jack-champagne wants to merge 3 commits intofeat/madnlp-integrationfrom
Conversation
Adds benchmark/alloc_profile.jl which runs Profile.Allocs-traced solves on the shared bilinear toy problem for both in-tree NLP backends, saving AllocProfileResult JLD2s via HarmoniqsBenchmarks' benchmark_memory! / save_alloc_profile API. benchmark/Project.toml pins HarmoniqsBenchmarks to the feat/alloc-profile branch until that PR merges.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
analyze_allocs.jl ranks alloc hotspots by scaled bytes across all profile JLD2s in benchmark/results/allocs/ with noise-frame filtering. Companion to the existing alloc_profile.jl driver. alloc_profile.jl: coerce MadNLP.ERROR to Int for MadNLPOptions — symmetric to Piccolissimo commit 472fe4d.
Identified by Gennadi. abs2(tr(U_goal'·U))/n² is phase-insensitive, so +im·U_goal and -im·U_goal are equally valid optima. With free Δt, solvers fall into different basins depending on init + step sequence; with fixed Δt, both consistently land in the same basin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
benchmark/alloc_profile.jl— standalone Julia script that runsDirectTrajOpt.solve!underProfile.Allocsfor both Ipopt and MadNLP on the shared bilinear toy problem, saving oneAllocProfileResultJLD2 per solver viaHarmoniqsBenchmarks.benchmark_memory!/save_alloc_profile.benchmark/Project.tomlwith DTO + the two NLP backends +HarmoniqsBenchmarks(pinned tofeat/alloc-profileuntil HarmoniqsBenchmarks.jl#1 merges)./benchmark/results/so local profile output stays out of history.The sibling
Piccolissimo.jlPR covers the Altissimo+MadNLP+Ipopt three-way on an X-gate; this PR is the DTO-only lane that tracks Ipopt/MadNLP performance over time on DTO's own test fixture.Rationale
sample_ratedefaults to0.01inmain()— Ipopt/MadNLP generate orders of magnitude more fine-grained allocations than asample_rate=1.0trace can complete in reasonable wall time (an N=10 bilinear toy hangs 15+ minutes at 1.0).0.01still gives statistically useful traces for hot-path triage.JIT warmup runs on a throwaway
deepcopyof the problem before the profiled pass so compile-time allocations stay out of the recorded trace.Dependencies
Blocked on HarmoniqsBenchmarks.jl#1 merging — once it does, drop the
rev =pin frombenchmark/Project.toml.Test plan
julia --project=benchmark benchmark/alloc_profile.jlproduces two*_allocs.jld2underbenchmark/results/allocs/AllocProfileResult.total_count > 0andtotal_bytes > 0for both solversload_alloc_profileroundtrips correctly