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

llvmcall deprecation warnings #139

Open
nsajko opened this issue May 18, 2024 · 4 comments
Open

llvmcall deprecation warnings #139

nsajko opened this issue May 18, 2024 · 4 comments

Comments

@nsajko
Copy link
Contributor

nsajko commented May 18, 2024

  1 dependency had output during precompilation:
┌ Groebner
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in _sort!(AbstractArray{T, 1} where T, Base.Sort.StableCheckSorted{T} where T<:Base.Sort.Algorithm, Base.Order.Ordering, Any) at sort.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in _sort!(AbstractArray{T, 1} where T, Base.Sort.InsertionSortAlg, Base.Order.Ordering, Any) at sort.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in partition!(AbstractArray{T, 1} where T, Integer, Integer, Integer, Base.Order.Ordering, AbstractArray{T, 1} where T, Bool, AbstractArray{T, 1} where T, Integer) at sort.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in var"#f4_find_multiplied_reducer!#565"(Bool, typeof(Groebner.f4_find_multiplied_reducer!), Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MacaulayMatrix{T} where T<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering where M<:Union{Array{T, 1} where T, Groebner.AbstractPackedTuple{T, B} where B<:Unsigned where T<:Unsigned, Groebner.SparseExponentVector{T, I, N} where N where I where T}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering where M<:Union{Array{T, 1} where T, Groebner.AbstractPackedTuple{T, B} where B<:Unsigned where T<:Unsigned, Groebner.SparseExponentVector{T, I, N} where N where I where T}, Int32) at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/f4.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in pairset_update!(Groebner.Pairset{Degree} where Degree, Groebner.Basis{C}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Int64) where {C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, M<:Union{Array{T, 1} where T, Groebner.AbstractPackedTuple{T, B} where B<:Unsigned where T<:Unsigned, Groebner.SparseExponentVector{T, I, N} where N where I where T}} at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/utils/timeit.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in insert_lcms_in_basis_hashtable!(Groebner.Pairset{Degree} where Degree, Int64, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Array{Int32, 1}, Int64, Int64) where {M} at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/basis.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in basis_is_new_polynomial_redundant!(Groebner.Pairset{Degree} where Degree, Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Int64) where {M} at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/basis.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in basis_sweep_redundant!(Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Any) at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/basis.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in f4_reducegb_learn!(Groebner.TraceF4{C1, C2, M, Ord1, Ord2} where Ord2 where Ord1 where M<:Union{Array{T, 1} where T, Groebner.AbstractPackedTuple{T, B} where B<:Unsigned where T<:Unsigned, Groebner.SparseExponentVector{T, I, N} where N where I where T} where C2<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N} where C1<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.PolyRing{Ord, C} where C<:Union{Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N} where Ord<:Union{Groebner.AbstractInternalOrdering, Groebner.AbstractMonomialOrdering}, Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MacaulayMatrix{T} where T<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.AlgorithmParameters{MonomOrd1, MonomOrd2, MonomOrd3, Arithmetic} where Arithmetic<:(Groebner.AbstractArithmetic{AccumType, CoeffType} where CoeffType where AccumType) where MonomOrd3 where MonomOrd2 where MonomOrd1) where {M<:Union{Array{T, 1} where T, Groebner.AbstractPackedTuple{T, B} where B<:Unsigned where T<:Unsigned, Groebner.SparseExponentVector{T, I, N} where N where I where T}} at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/learn-apply.jl
│  WARNING: llvmcall with integer pointers is deprecated.
│  Use actual pointers instead, replacing i32 or i64 with i8* or ptr
│  in f4_autoreduce!(Groebner.PolyRing{Ord, C} where C<:Union{Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N} where Ord<:Union{Groebner.AbstractInternalOrdering, Groebner.AbstractMonomialOrdering}, Groebner.Basis{C} where C<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MacaulayMatrix{T} where T<:Union{Base.Rational{Base.GMP.BigInt}, Signed, Unsigned, Groebner.CompositeInt{N, T} where T<:Union{Signed, Unsigned} where N}, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Groebner.MonomialHashtable{M, Ord} where Ord<:Groebner.AbstractInternalOrdering, Any) where {M} at /home/nsajko/.julia/packages/Groebner/IF5vZ/src/f4/f4.jl
└

Also, IMO, using assembly at all, let alone so much of it, is a red flag/strong code smell for such a high-level package.

@sumiya11
Copy link
Owner

Thanks for reporting that. I'll switch to pointers.

Also, IMO, using assembly at all, let alone so much of it, is a red flag/strong code smell for such a high-level package.

I'm not excited about this as well. ATM I just try to keep llvmcalls in a single file, and maybe I ought to rethink their usefulness later.

@sumiya11
Copy link
Owner

UPD: Now there is one more file where llvmcallss are used: https://github.com/sumiya11/Groebner.jl/blob/1966672ac52cba9f68f90685433abd21f4e584cc/src/utils/packed.jl

These llvmcalls grant around 15% performance improvement on one class of inputs.

Either compilers become smart enough to produce such code by themselves or I decide I do not care enough and delete all llvmcalls -- whivever comes first.

@sumiya11
Copy link
Owner

sumiya11 commented Sep 21, 2024

To be more precise

using Groebner, AbstractAlgebra
k = GF(2^30+3)
C = [
           Groebner.Examples.HIV2(k=k),
           Groebner.Examples.Goodwin_with_weights(k=k),
           Groebner.Examples.yang1(k=k),
           Groebner.Examples.Cholera(k=k),
           Groebner.Examples.bayes148(k=k),
           Groebner.Examples.mayr42(k=k)
       ];

@time for c in C groebner(c); end

No llvmcalls :

98.660280 seconds (121.74 M allocations: 12.032 GiB, 4.05% gc time)

With llvmcalls :

92.756787 seconds (121.74 M allocations: 12.032 GiB, 4.25% gc time)

This is Julia Version 1.12.0-DEV.1076

@sumiya11
Copy link
Owner

Either compilers become smart enough to produce such code by themselves or I decide I do not care enough and delete all llvmcalls -- whivever comes first.

#157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants