Skip to content

Upgrade to OCaml 5.0 as default#1137

Open
sim642 wants to merge 5 commits intomasterfrom
ocaml-5-apron
Open

Upgrade to OCaml 5.0 as default#1137
sim642 wants to merge 5 commits intomasterfrom
ocaml-5-apron

Conversation

@sim642
Copy link
Member

@sim642 sim642 commented Aug 16, 2023

Closes #1003.

We can finally do this because mlgmpidl and apron have been released on opam for OCaml 5.0.

TODO

@sim642 sim642 added setup Dependencies, CI, releasing dependencies Pull requests that update a dependency file labels Aug 16, 2023
@sim642 sim642 added this to the v2.2.0 milestone Aug 16, 2023
@sim642 sim642 self-assigned this Aug 16, 2023
@sim642 sim642 marked this pull request as ready for review August 16, 2023 09:07
@sim642
Copy link
Member Author

sim642 commented Sep 12, 2023

I did an sv-benchmarks run comparing OCaml 4.14 with OCaml 5.0 and the results are concerning. We might have to postpone making OCaml 5.0 the default and simply cherry-pick the changes from here to at least make Goblint OCaml 5.0 compatible, even if we don't use it by default.

Memory usage is significantly higher, almost 10× in some cases:
image

CPU time is also affected but that could be simply due to working with more memory:
image

(Full results)

@sim642 sim642 modified the milestones: v2.2.0, v2.3.0 Sep 12, 2023
@sim642 sim642 mentioned this pull request Sep 13, 2023
4 tasks
@sim642 sim642 modified the milestones: v2.3.0, v2.4.0 Nov 15, 2023
@michael-schwarz
Copy link
Member

Should we investigate what the performance is like with OCaml 5.1?

@sim642
Copy link
Member Author

sim642 commented Apr 5, 2024

I tried 5.1 at some point and it wasn't much better, still a regression from 4.14.
OCaml 5.2 is around the corner, so that's another thing to try.

@michael-schwarz
Copy link
Member

Sounds like 5.2 (released today) also won't fix our problems: https://discuss.ocaml.org/t/ocaml-5-2-0-released/14638

OCaml 5.2.0 is still a somewhat experimental release compared to the OCaml 4.14 branch. In particular

  • [...]
  • Ephemeron performances need to be investigated.

@FelixKrayer
Copy link
Contributor

Just as a quick note here:
The version of the dependency of camlidl will have to be changed to version 1.12, as the current camlidl = 1.11 requires ocaml < 5.0.

@sim642
Copy link
Member Author

sim642 commented Jun 20, 2024

All the dependencies in the Goblint lock file are for 4.14 anyway: the lock file also specifies OCaml 4.14. The non-locked dependencies allow appropriate versions to be installed on OCaml 5.0, 5.1 and 5.2.

@sim642 sim642 modified the milestones: v2.4.0, v2.5.0 Jun 25, 2024
@sim642 sim642 modified the milestones: v2.5.0, v2.6.0 Nov 26, 2024
@sim642
Copy link
Member Author

sim642 commented Jan 11, 2025

I might have to redo the 4.14 vs 5.x (5.3 now) runs now because a lot seems to have changed (in Goblint). I tried a few worst cases from my previous runs to see if they remain, but couldn't find an example of regression due to OCaml. Rather, some just got faster/slower on OCaml 4.14 even.

Having some significant examples of regression would allow us to open an issue with OCaml. The maintainers are interested in cases where performance regressions from OCaml 5 are holding things back: https://discuss.ocaml.org/t/ocaml-5-3-0-released/15916/4.

@DrMichaelPetter
Copy link
Collaborator

If it helps, I can set up a regular job on our servers, e.g. comparing runtimes of a sample set. We would need some way of building 4.14 and 5.x in an unsupervised fashion, though.

@sim642
Copy link
Member Author

sim642 commented Jan 14, 2025

I now opened an issue with OCaml, including an updated benchmark for the current Goblint and OCaml 5.3: ocaml/ocaml#13733. The large blob of 10× memory usage cases seems gone, but performance isn't clearly on par with 4.14 either.

@michael-schwarz
Copy link
Member

Random thought: Have you tried with the mitigation for #1513 for the example where we have a 5x slowdown?

@sim642 sim642 modified the milestones: v2.6.0, v2.7.0 Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file setup Dependencies, CI, releasing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make setup fails due to "invalid extra arguments" to opam switch create Upgrade to OCaml 5.0.0

4 participants