-
Notifications
You must be signed in to change notification settings - Fork 7
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
MethodErrors caused by StrideArrays.jl overrides #34
Comments
Hm, yeah that seems to be a problem in StrideArrays.jl's broadcast system, it's just manifesting here because Bumper uses types from StrideArrays. julia> using StrideArrays
julia> let a = StrideArray{ComplexF32}(undef, 10)
a .= 1
a .= cos.(a)
end
ERROR: MethodError: no method matching vmaterialize!(::StrideArray{…}, ::Base.Broadcast.Broadcasted{…}, ::Val{…}, ::Val{…}, ::Val{…})
Closest candidates are:
vmaterialize!(::Any, ::Any, ::Val{Mod}, ::Val{UNROLL}) where {Mod, UNROLL}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:753
vmaterialize!(::Union{Adjoint{T, A}, Transpose{T, A}}, ::BC, ::Val{Mod}, ::Val{UNROLL}, ::Val{dontbc}) where {T<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit}, N, A<:AbstractArray{T, N}, BC<:Union{Base.Broadcast.Broadcasted, LoopVectorization.Product}, Mod, UNROLL, dontbc}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:682
vmaterialize!(::AbstractArray{T, N}, ::BC, ::Val{Mod}, ::Val{UNROLL}, ::Val{dontbc}) where {T<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit}, N, BC<:Union{Base.Broadcast.Broadcasted, LoopVectorization.Product}, Mod, UNROLL, dontbc}
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:673
...
Stacktrace:
[1] vmaterialize!
@ LoopVectorization ~/.julia/packages/LoopVectorization/7gWfp/src/broadcast.jl:759 [inlined]
[2] _materialize!
@ StrideArrays ~/.julia/packages/StrideArrays/PeLtr/src/broadcast.jl:181 [inlined]
[3] materialize!(dest::StrideArray{…}, bc::Base.Broadcast.Broadcasted{…})
@ StrideArrays ~/.julia/packages/StrideArrays/PeLtr/src/broadcast.jl:188
[4] top-level scope
@ REPL[9]:3 Could you try opening an issue in StrideArrays.jl? |
Thanks, posted there: JuliaSIMD/StrideArrays.jl#85 |
It could also be Signature: T<:Union{Bool, Float16, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, SIMDTypes.Bit} |
So what's going on here is that Bumper.jl uses StrideArraysCore.jl because it defines nice pointer-backed performant array types. If one loads StrideArrays.jl, then StrideArraysCore.jl will override various things like broadcasting and matrix multiplication on those types to use LoopVectorization.jl instead of the normal machinery. That normally works fine, but there are cases where those overrides probably shouldn't be defined, such as when one encounters a However, due to issues like this, and the fact that StrideArrays isn't being actively worked on very often, I am considering making a new pointer backed array type to use instead of those from StrideArraysCore. |
Given that LoopVectorization.jl is being deprecated for 1.11, I was wondering what the status of this? I would be very eager to make Bumper.jl a hard dependency for some of my packages, as the perf has been extremely good, but I only hesitate because of the interaction with the soon-to-be-deprecated StrideArrays/LoopVectorization ecosystem. Maybe the PtrArray could simply be copied over so StrideArrays doesn't overload it? |
Friendly ping @MasonProtter |
Hey Miles, sorry I want to evaluate options soon. I'm considering switching to UnsafeArrays.jl or something like that, or forking StrideArraysCore or something but haven't had time or bandwidth to deal with it lately. I'm hoping I can get to this soon-ish though |
Thanks! Btw, I think |
Currently planning on just dropping StrideArrays and switching to https://github.com/LilithHafner/PtrArrays.jl/ instead. Should give us everything we need. |
Awesome, looking forward to it!! |
Friendly ping on this |
MWE:
In a fresh REPL:
However, if I import
StrideArrays
, I get an error:I think maybe a fallback methods should be used if it doesn't exist?
The text was updated successfully, but these errors were encountered: