-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Backporting the libblas and vendor() improvements to 1.8 #44467
Conversation
Prior to this PR, Julia's precompiled `*.ji` files saved just two categories of code: unspecialized method definitions and type-specialized code for the methods defined by the package. Any novel specializations of methods from Base or previously-loaded packages were not saved, and therefore effectively thrown away. This PR caches all the code---internal or external---called during package definition that hadn't been previously inferred, as long as there is a backedge linking it back to a method owned by a module being precompiled. (The latter condition ensures it will actually be called by package methods, and not merely transiently generated for the purpose of, e.g., metaprogramming or variable initialization.) This makes precompilation more intuitive (now it saves all relevant inference results), and substantially reduces latency for inference-bound packages. Closes #42016 Fixes #35972 Issue #35972 arose because codegen got started without re-inferring some discarded CodeInstances. This forced the compiler to insert a `jl_invoke`. This PR fixes the issue because needed CodeInstances are no longer discarded by precompilation. (cherry picked from commit df81bf9)
(cherry-picked from 675911a)
(cherry picked from commit 627016a)
(cherry picked from commit ac922b0)
(cherry picked from commit 6850940)
(cherry picked from commit f20d5de)
Because we're starting to distribute macOS tarballs as well, let's codesign them by default, when possible. (cherry picked from commit 6b29ebd)
…et (#44262) We collect the relocations (i.e. the GOT slots that is used in the code) for each target in `tgt.relocs`. Needing a relocation, however, does not imply that the function is cloned for this target within the group (It does mean that at least one target in the group has it cloned). The previous version would miss the relocation in this case. This was triggerred with the following cloning situation caller: clone_1 callee: clone_1, clone_1.clone_3 Since caller.clone_1 may call either callee.clone_1 or callee.clone_1.clone_3 a relocation for callee will be used and is required to be initialized. In addition to target 1, target 2 (and in fact target 3) within group 1 will also use caller.clone_1. However, since callee isn't cloned for target 2 the previous version wouldn't have saved this slot in the relocation array. (cherry picked from commit 76fc067)
I believe it's intentional that for these methods, the `sig` field is just ignored and always set to `Tuple`. Also fixes a lowering bug I discovered that would cause errors if `Union` was shadowed. I have verified that this fixes the reported warnings. Co-authored-by: Jameson Nash <vtjnash@gmail.com> (cherry picked from commit 5deb503)
`vendor()` returns `:lbt` `libblas_name` and `liblapack_name` are set to "libblastrampoline" (cherry picked from commit bf6d9de)
* Clarify the behavior of `@threads for` Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com> (cherry picked from commit 2f67b51)
* fix errors Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> (cherry picked from commit a9d8c85)
…4416) Intersection cannot deal with this `metharg`, so it does not simplify the type at all when handling this case. This can cause us to run into an assertion later, where we assume the intersection of a non-Varags type will always return a simple DataType without Varargs. Fixes #44238 atype = Tuple{typeof(Base.similar), Tuple{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T}, Array{_A, 1} where _A, Array{_C, 1} where _C, Array{_B, 1} where _B} metharg = Tuple{typeof(Base.similar), Tuple{Vararg{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T}}, Vararg{Union{Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HyperPlane{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HalfSpace{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:AbstractArray{T, 1}, Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Line{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Ray{T, AT} where AT<:AbstractArray{T, 1})} where T}} Currently `typeintersection(atype, metharg) === metharg` (cherry picked from commit ffc5ffa)
This reverts commit e54b04a.
* Report libblastrampoline as Base.libblas_name and Base.liblapack_name * Cleanup a lot of the LBT stuff * Fix * Remove test for LinearAlgebra.LAPACK.liblapack * Fix * Fix the precompile tests (cherry picked from commit e84b06c)
Some of the 0-stride tests are failing - no exception is being thrown. Maybe something changed in openblas 0.3.20. I'll look into it a bit more and should be easy to fix. |
I think we need #42957 to fix the test failures with 0 strides - which seems to be necessary since we updated to openblas 0.3.20, added tests, but did not pull in the relevant fixes that got merged just after branching. |
(cherry picked from commit 6409a8a)
win32 test failure seems unrelated. |
fb69baf
to
5f66327
Compare
Why is this so important to get into 1.8 (and why is it on the milestone). And #42957 looks like a feature. |
This has been a lot of hassle for 1.8. Let's not bother about getting this to 1.8. We'll just focus on 1.9. There are some annoyances where 1.8 will unconditionally (and incorrectly when MKL is loaded) claim that Best to focus on 1.9 to get it fixed ecosystem-wide. |
This PR includes #44360, #44379, and #42957 all of which are required together. The crash reported in #44379 (comment) is fixed as a result.