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] - feat: use suppress_compilation in tensor products #7504

Closed
wants to merge 22 commits into from

Conversation

sgouezel
Copy link
Contributor

@sgouezel sgouezel commented Oct 4, 2023

More principled version of #7281.


Not completely satisfactory still, as suppress_compilation doesn't work with notation3, but the workaround using unsuppress_compilation in looks sufficient for now.

Open in Gitpod

@sgouezel
Copy link
Contributor Author

sgouezel commented Oct 4, 2023

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit e525671.
There were significant changes against commit b2540cf:

  Benchmark                                                       Metric                 Change
  =============================================================================================
+ build                                                           .olean serialization    -8.0%
+ build                                                           compilation            -28.5%
+ ~Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic              instructions           -12.2%
+ ~Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed             instructions           -13.6%
+ ~Mathlib.Algebra.Category.Ring.Constructions                    instructions            -9.8%
+ ~Mathlib.Algebra.Lie.BaseChange                                 instructions           -87.7%
+ ~Mathlib.Algebra.Lie.TensorProduct                              instructions           -25.1%
+ ~Mathlib.Algebra.Lie.Weights                                    instructions           -81.3%
+ ~Mathlib.AlgebraicGeometry.Limits                               instructions            -5.8%
+ ~Mathlib.LinearAlgebra.BilinearForm.TensorProduct               instructions           -86.4%
+ ~Mathlib.LinearAlgebra.Contraction                              instructions            -7.4%
+ ~Mathlib.LinearAlgebra.DirectSum.TensorProduct                  instructions           -77.8%
+ ~Mathlib.LinearAlgebra.Multilinear.TensorProduct                instructions           -11.3%
+ ~Mathlib.LinearAlgebra.PiTensorProduct                          instructions           -11.1%
+ ~Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries   instructions           -21.7%
+ ~Mathlib.LinearAlgebra.TensorAlgebra.ToTensorPower              instructions           -35.0%
+ ~Mathlib.LinearAlgebra.TensorPower                              instructions           -11.2%
+ ~Mathlib.LinearAlgebra.TensorProduct                            instructions           -36.6%
+ ~Mathlib.LinearAlgebra.TensorProduct.Opposite                   instructions           -16.8%
+ ~Mathlib.LinearAlgebra.TensorProduct.Prod                       instructions           -33.6%
+ ~Mathlib.LinearAlgebra.TensorProduct.Tower                      instructions           -54.7%
+ ~Mathlib.LinearAlgebra.TensorProductBasis                       instructions           -21.8%
+ ~Mathlib.RepresentationTheory.FdRep                             instructions            -7.8%
+ ~Mathlib.RepresentationTheory.Invariants                        instructions           -85.6%
+ ~Mathlib.RepresentationTheory.Rep                               instructions           -44.6%
+ ~Mathlib.RingTheory.Kaehler                                     instructions           -18.8%
+ ~Mathlib.RingTheory.PolynomialAlgebra                           instructions           -10.2%
+ ~Mathlib.RingTheory.TensorProduct                               instructions           -12.3%
- ~Mathlib.Tactic.SuppressCompilation                             instructions            68.3%

@ocfnash
Copy link
Contributor

ocfnash commented Oct 10, 2023

Thank you very much for this

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Oct 10, 2023
bors bot pushed a commit that referenced this pull request Oct 10, 2023
@ocfnash
Copy link
Contributor

ocfnash commented Oct 10, 2023

Apparently the bors job containing this PR crashed:
image

Let's try again

bors merge

bors bot pushed a commit that referenced this pull request Oct 10, 2023
@ocfnash
Copy link
Contributor

ocfnash commented Oct 10, 2023

This is genuinely failing to build for bors with errors like:

Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:130:4: error: compiler IR check failed at 'lTensor.toFun._rarg', error: unknown declaration 'LinearMap.lTensor'
Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:137:4: error: failed to compile definition, consider marking it as 'noncomputable' because it depends on 'TensorProduct.lift', and it does not have executable code
Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:198:4: error: compiler IR check failed at 'lTensor.linearEquiv_of_rightInverse._rarg', error: unknown declaration 'lTensor.toFun'
Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:234:4: error: compiler IR check failed at 'rTensor.toFun._rarg', error: unknown declaration 'LinearMap.rTensor'
Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:241:4: error: failed to compile definition, consider marking it as 'noncomputable' because it depends on 'TensorProduct.lift', and it does not have executable code
Error: ./././Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean:302:4: error: compiler IR check failed at 'rTensor.linearEquiv_of_rightInverse._rarg', error: unknown declaration 'rTensor.toFun'

I think you may need to merge master.

bors r-

@bors
Copy link

bors bot commented Oct 10, 2023

Canceled.

@sgouezel
Copy link
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Oct 11, 2023
@bors
Copy link

bors bot commented Oct 11, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: use suppress_compilation in tensor products [Merged by Bors] - feat: use suppress_compilation in tensor products Oct 11, 2023
@bors bors bot closed this Oct 11, 2023
@bors bors bot deleted the SG_noncomputable_tensor branch October 11, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants