-
-
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
Seperate LinearAlgebra.axp(b)y!
and BLAS.axp(b)y!
.
#44758
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm seeing this when building the docs. I presume this PR is causing it.
|
@ViralBShah, I can't reproduce locally. $ make -C doc
make: Entering directory '/cygdrive/c/Users/MYJ/Documents/Github/julia/doc'
/cygdrive/c/Users/MYJ/Documents/Github/julia/deps/tools/jlchecksum "/cygdrive/c/Users/MYJ/Documents/Github/julia/deps/srccache/UnicodeData-13.0.0.txt"
cp "/cygdrive/c/Users/MYJ/Documents/Github/julia/deps/srccache/UnicodeData-13.0.0.txt" UnicodeData.txt
Building HTML documentation.
/cygdrive/c/Users/MYJ/Documents/Github/julia/usr/bin/julia --startup-file=no --color=yes `cygpath -w /cygdrive/c/Users/MYJ/Documents/Github/julia/doc/make.jl` linkcheck= doctest= buildroot=`cygpath -w /cygdrive/c/Users/MYJ/Documents/Github/julia` texplatform= revise=
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: skipped.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: HTMLWriter: rendering HTML pages.
┌ Warning: invalid local link: unresolved path in base\file.md
│ link.text =
│ 1-element Vector{Any}:
│ Markdown.Code("", "mkpidlock")
│ link.url = "FileWatching.html#FileWatching.Pidfile.mkpidlock"
└ @ Documenter.Writers.HTMLWriter C:\Users\MYJ\Documents\Github\julia\doc\deps\packages\Documenter\9rkAd\src\
Writers\HTMLWriter.jl:2077
┌ Warning: invalid local link: unresolved path in stdlib\LinearAlgebra.md
│ link.text =
│ 1-element Vector{Any}:
│ Markdown.Code("", "\\")
│ link.url = "math.html#Base.:\\-Tuple{Any, Any}"
└ @ Documenter.Writers.HTMLWriter C:\Users\MYJ\Documents\Github\julia\doc\deps\packages\Documenter\9rkAd\src\
Writers\HTMLWriter.jl:2077
┌ Warning: invalid local link: unresolved path in stdlib\LinearAlgebra.md
│ link.text =
│ 1-element Vector{Any}:
│ Markdown.Code("", "rdiv!")
│ link.url = "../stdlib/LinearAlgebra.html#LinearAlgebra.rdiv!"
└ @ Documenter.Writers.HTMLWriter C:\Users\MYJ\Documents\Github\julia\doc\deps\packages\Documenter\9rkAd\src\
Writers\HTMLWriter.jl:2077
Build finished. The HTML pages are in _build/html.
make: Leaving directory '/cygdrive/c/Users/MYJ/Documents/Github/julia/doc' |
I had mismatched versions - I can't reproduce it either now with a clean build of everything. Thanks for checking. |
FWIW, this change broke the module Ambig
using LinearAlgebra
abstract type AbstractGPUArray{T, N} <: DenseArray{T, N} end
LinearAlgebra.dot(::AbstractGPUArray, ::AbstractGPUArray) = 1
struct oneArray{T,N} <: AbstractGPUArray{T,N} end
oneStridedArray{T,N} = Union{oneArray{N}, Base.ReinterpretArray}
LinearAlgebra.dot(::oneStridedArray{Float32}, ::oneStridedArray{Float32}) = 2
end
using LinearAlgebra
@show Base.isambiguous(methods(dot, Ambig)[1], methods(dot, Ambig)[2]) This results in an ambiguity on 1.9, while it used to work on 1.8: Candidates:
dot(x::oneStridedArray{T}, y::oneStridedArray{T}) where T<:Union{Float32, Float64}
@ oneAPI.oneMKL ~/Julia/pkg/oneAPI/lib/mkl/linalg.jl:22
dot(x::GPUArraysCore.AbstractGPUArray, y::GPUArraysCore.AbstractGPUArray)
@ GPUArrays ~/Julia/pkg/GPUArrays/src/host/linalg.jl:480
dot(x::Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, Base.ReshapedArray{T, N, A} where {N, A<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}}, SubArray{T, var"#s970", var"#s969", I, true} where {var"#s970", var"#s969"<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, Base.ReshapedArray{T, N, A} where {N, A<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}}, DenseArray{T}}, I}, DenseArray{T}}, y::Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, Base.ReshapedArray{T, N, A} where {N, A<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}}, SubArray{T, var"#s970", var"#s969", I, true} where {var"#s970", var"#s969"<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, Base.ReshapedArray{T, N, A} where {N, A<:Union{Base.ReinterpretArray{T, N, S, A, IsReshaped} where {T, N, A<:Union{SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}, IsReshaped, S}, SubArray{T, N, A, I, true} where {T, N, A<:DenseArray, I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}}, DenseArray}}, DenseArray{T}}, I}, DenseArray{T}}) where T<:Union{Float32, Float64}
@ LinearAlgebra ~/Julia/depot/juliaup/julia-1.9.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/matmul.jl:14
Possible fix, define
dot(::oneArray{T}, ::oneArray{T}) where T<:Union{Float32, Float64} The Any suggestions on a workaround? The suggested fix obviously doesn't work for anything but oneArray (e.g. reshaped, contiguous views, etc). |
IIRC MKL's dot only supports vec-like input (1 inc for X and 1 inc for Y) on GPU, thus If this is a |
Fair enough, and that does work around the ambiguity. Thanks! |
What's the difference between the StridedVecLike introduced here, and StridedVector? |
julia> view(zeros(200,200),:,:) isa Base.StridedVector
false
julia> view(zeros(200,200),:,:) isa LinearAlgebra.StridedVecLike
true |
At present we have
BLAS.axp(b)y! === LinearAlgebra.axp(b)y!
, which seems strange asBLAS.axp(b)y!
should always call BLAS.This PR seperate them, and make
LinearAlgebra.axp(b)y!
callBLAS.axp(b)y!
if inputs are stride-vector like. (Thus there should be no performance regression.)