Conversation
|
Looks basically good modulo docs nitpicks. Also, because the PR description becomes the commit message, it would be nice to summarize the benchmark runs in the text, because they will presumably not be accessible at that URL in the time period where understanding this commit message might be useful. |
Co-authored-by: David Thrane Christiansen <david@lean-fro.org>
|
One remaining concern from the sf-in-lean thread: merging this will break Verso on Linux with Lean below v4.34. |
|
I don't think that this will. From what I can see, the issue on that thread came from them importing Lake, and its I'll run a Linux build of SF against this PR to be sure, though. |
|
Do you mind if I OCR the tables so that we have actual numbers in the commit message, rather than links to GitHub images? I don't know how long those links last. |
Updated.
Well, VersoLiterate.Config imports it, so at the end of the day $ ldd .lake/build/lib/libverso_VersoLiterate.so
linux-vdso.so.1 (0x000075def12fa000)
libc.so.6 => /nix/store/qqiqd3ah10x8hzsif4j1y4xc1miw23nx-glibc-2.42-67/lib/libc.so.6 (0x000075def1000000)
libLake_shared.so => /home/wjn/.elan/toolchains/leanprover--lean4---v4.34.0-rc2/lib/lean/libLake_shared.so (0x000075def0600000)
(...)and with But maybe older versions are a moot point? I just tried changing |
|
Yep, I checked it out and it does indeed - I'd forgotten that part. We'll just have to say this is a 4.34 and up feature. |
|
I think this is good go now. Hooray! |
|
I tested the exact PR head ( Representative warmed medians for the controlled interpreted-generator comparison:
Precompilation increases clean build cost: Verso went from 51.90 to 111.22 seconds (+114.30%), while enabling it in VBP went from 64.57 to 73.97 seconds (+14.56%). Fully compiling the FLT generator is considerably more expensive because it pulls in the native FLT/Mathlib closure and produces a 426 MB executable. My takeaway is that this PR is an unambiguous win. We will enable |
|
Follow-up on performance A. Matched end-to-end measurementsDependencies and the Lake artifact cache were warm. The edit case starts after a unique prose edit in one Blueprint module.
Native is 3.915 seconds faster than interpreted when nothing changed. After a prose edit the difference is only 0.465 seconds. The interpreted no-edit path includes the outer VBP target check and its internal
The actual traversal and emission are therefore a minority of the elapsed time. B. Measuring generation without the full Mathlib closureTo measure the generator without importing the full FLT and Mathlib environment into a compiled host, I constructed a project-specific runtime artifact:
For FLT, the runtime closure contains 8,733 IR declarations from 79 modules. It contains no formal At the direct-execution boundary:
The generic host is 286 MB, compared with 426 MB for the fully native FLT executable. The host can be shared between projects, leaving only the 12.13 MiB runtime artifact as project-specific cached data. The export-plus-host row in section A includes the complete producer and host workflow through their public Lake commands. C. Could the module system provide this?The module system can express the relevant phase distinction: formal dependencies can be Lake's native build graph does not currently preserve that distinction. In a minimal FLT test, a single A phase-aware Lake native graph could eventually make a small Blueprint runtime module viable. However, that would require Lake to preserve So the module system could become part of the solution, but it does not currently provide an alternative to a cached runtime artifact. |
This PR re-enables
precompileModulesand documents how this can be leveraged to speed up rebuilds as a tip.No-Changelog: internal optimization detail.
We do not change Verso's benchmarking configuration at this time - it will continue to measure build times for the default setup (with native-compiled
Mainexecutables), as experienced by most users (though leanprover/verso-blueprint'svbp buildCLI should immediately benefit from this).Benchmark results with interpreted
MainandprecompileModules:Mainsince we don't compile these when interpretingMain.Raw radar data:
runner-leanNwithnproc(48?) coresrunner-leanNlimited to 4 cores (emulating GitHub's CI runners or a small laptop)