-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: simp_arith: faster denote
through Lean.RArray
#6068
Merged
Merged
Conversation
This file contains 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
!bench |
github-actions
bot
added
the
changes-stage0
Contains stage0 changes, merge manually using rebase
label
Nov 13, 2024
nomeata
changed the title
refactor: simp_arith: faster
perf: simp_arith: faster Nov 13, 2024
denote
through RArrray
denote
through RArrray
nomeata
changed the title
perf: simp_arith: faster
perf: simp_arith: faster Nov 13, 2024
denote
through RArrray
denote
through Lean.RArray
nomeata
changed the title
perf: simp_arith: faster
perf: simp_arith: faster Nov 13, 2024
denote
through Lean.RArray
denote
through Lean.RArray
Here are the benchmark results for commit 90138d8. Benchmark Metric Change
============================================================
- big_omega.lean branch-misses 1.4% (14.8 σ)
- language server startup branches 1.0% (26.4 σ)
- language server startup instructions 1.0% (23.0 σ)
+ simp_arith1 branches -23.9% (-3750.6 σ)
+ simp_arith1 instructions -25.1% (-4892.6 σ)
- unionfind task-clock 11.0% (10.8 σ)
- unionfind wall-clock 11.0% (10.8 σ) |
Merged
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Nov 13, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Nov 13, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 13, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Nov 13, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 13, 2024
Mathlib CI status (docs):
|
leanprover-community-bot
added
the
builds-mathlib
CI has verified that Mathlib builds against this PR
label
Nov 13, 2024
nomeata
changed the base branch from
joachim/Poly.norm
to
nightly-with-mathlib
November 13, 2024 20:46
nomeata
force-pushed
the
joachim/RArray
branch
from
November 13, 2024 21:17
b79c887
to
ce64f81
Compare
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Nov 13, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 13, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 14, 2024
This PR adds the Lean.RArray data structure. This data structure is equivalent to `Fin n → α` or `Array α`, but optimized for a fast kernel-reduction `get` operation. It is not suitable as a general-purpose data structure. The primary intended use case is the “denote” function of a typical proof by reflection proof, where only the `get` operation is necessary, and where using `List.get` unnecessarily slows down proofs with more than a hand-full of atomic expressions. There is no well-formedness invariant attached to this data structure, to keep it concise; it's semantics is given through `RArray.get`. In that way one can also view an `RArray` as a decision tree implementing `Nat → α`. In #6068 this data structure is used in `simp_arith`.
nomeata
added a commit
that referenced
this pull request
Nov 14, 2024
This PR prepares #6068 by using the `RArray` data structure in `simp_arith` the simp-arith meta code. After the subsequent stage0 we can change the simp-arith theorems in `Init`.
nomeata
added a commit
that referenced
this pull request
Nov 14, 2024
This PR makes `simp_arith` use `RArray` for the context of the reflection proofs, which scales better when there are many variables.
nomeata
force-pushed
the
joachim/RArray
branch
from
November 14, 2024 11:29
065820c
to
a652e9c
Compare
nomeata
added
the
release-ci
Enable all CI checks for a PR, like is done for releases
label
Nov 14, 2024
nomeata
added a commit
that referenced
this pull request
Nov 14, 2024
This PR makes `simp_arith` use `RArray` for the context of the reflection proofs, which scales better when there are many variables. On our synthetic benchmark: ``` simp_arith1 instructions -25.1% (-4892.6 σ) ``` No effect on mathlib, though, guess it’s not used much on large goals there: http://speed.lean-fro.org/mathlib4/compare/873b982b-2038-462a-9b68-0c0fc457f90d/to/56e66691-2f1f-4947-a922-37b80680315d
nomeata
force-pushed
the
joachim/RArray
branch
from
November 14, 2024 11:30
a652e9c
to
59ee1ac
Compare
This PR prepares #6068 by using the `RArray` data structure in `simp_arith` the simp-arith meta code. After the subsequent stage0 we can change the simp-arith theorems in `Init`.
This PR makes `simp_arith` use `RArray` for the context of the reflection proofs, which scales better when there are many variables. On our synthetic benchmark: ``` simp_arith1 instructions -25.1% (-4892.6 σ) ``` No effect on mathlib, though, guess it’s not used much on large goals there: http://speed.lean-fro.org/mathlib4/compare/873b982b-2038-462a-9b68-0c0fc457f90d/to/56e66691-2f1f-4947-a922-37b80680315d
nomeata
force-pushed
the
joachim/RArray
branch
from
November 14, 2024 11:31
59ee1ac
to
725d59e
Compare
Kha
pushed a commit
that referenced
this pull request
Nov 14, 2024
This PR prepares #6068 by using the `RArray` data structure in `simp_arith` the simp-arith meta code. After the subsequent stage0 we can change the simp-arith theorems in `Init`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
builds-mathlib
CI has verified that Mathlib builds against this PR
changes-stage0
Contains stage0 changes, merge manually using rebase
release-ci
Enable all CI checks for a PR, like is done for releases
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
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.
This PR improves the asymptotic performance of
simp_arith
when there are many variables to consider.On our synthetic benchmark:
No effect on mathlib, though, guess it’s not used much on large goals there:
http://speed.lean-fro.org/mathlib4/compare/873b982b-2038-462a-9b68-0c0fc457f90d/to/56e66691-2f1f-4947-a922-37b80680315d