Skip to content
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

[Merged by Bors] - perf(linear_algebra): speed up graded_algebra instances #14967

Closed
wants to merge 8 commits into from

Conversation

alreadydone
Copy link
Collaborator

@alreadydone alreadydone commented Jun 26, 2022

Reduce elaboration of graded_algebra in:

  • exterior_algebra.graded_algebra from ~20s to 3s-
  • tensor_algebra.graded_algebra from 7s+ to 2s-
  • clifford_algebra.graded_algebra from 14s+ to 4s-

(These numbers were before lift_ι and lift_ι_eq were extracted from exterior_algebra.graded_algebra and lift_ι_eq was extracted from clifford_algebra.graded_algebra in #12182.)

Fix timeout reported on Zulip

Also shorten the statements of the first two without reducing clarity (I think).


Open in Gitpod

@alreadydone alreadydone added the awaiting-review The author would like community review of the PR label Jun 26, 2022
@alreadydone alreadydone added the awaiting-CI The author would like to see what CI has to say before doing more work. label Jun 26, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jun 26, 2022
@eric-wieser
Copy link
Member

@eric-wieser
Copy link
Member

I think your approach is cleaner, if it doesn't time out.

@eric-wieser eric-wieser added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jun 26, 2022
@alreadydone
Copy link
Collaborator Author

The extracted lift_ι_eq (and lift_ι in the case of clifford_algebra) are still slow so the same fixes apply. Should I inline them again, or just speed up the extracted def/lemmas?

@alreadydone alreadydone added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jun 27, 2022
@alreadydone
Copy link
Collaborator Author

I removed a few by apply that are not statistically significant; the remaining ones were tested to shaves off 0.x seconds ~ several seconds each.

@alreadydone alreadydone added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes merge-conflict Please `git merge origin/master` then a bot will remove this label. labels Jun 27, 2022
@alreadydone alreadydone changed the title perf(linear_algebra): fix timeout in graded_algebra instances perf(linear_algebra): speed up graded_algebra instances Jun 27, 2022
@kmill
Copy link
Collaborator

kmill commented Jul 8, 2022

Thanks!

bors r+

(You might consider writing some kind of library note about using by apply for performance. I'm not sure how important that is, though, since this might just be a short-term fix until these tricks become potentially irrelevant with Lean 4.)

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jul 8, 2022
bors bot pushed a commit that referenced this pull request Jul 8, 2022
Reduce `elaboration of graded_algebra` in:

+ `exterior_algebra.graded_algebra` from ~20s to 3s-
+ `tensor_algebra.graded_algebra` from 7s+ to 2s-
+ `clifford_algebra.graded_algebra` from 14s+ to 4s-

(These numbers were before `lift_ι` and `lift_ι_eq` were extracted from `exterior_algebra.graded_algebra` and `lift_ι_eq` was extracted from `clifford_algebra.graded_algebra` in #12182.)

Fix [timeout reported on Zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/deterministic.20timeout/near/286996731)

Also shorten the statements of the first two without reducing clarity (I think).
@bors
Copy link

bors bot commented Jul 8, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title perf(linear_algebra): speed up graded_algebra instances [Merged by Bors] - perf(linear_algebra): speed up graded_algebra instances Jul 8, 2022
@bors bors bot closed this Jul 8, 2022
@bors bors bot deleted the graded_algebra_timeout' branch July 8, 2022 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants