-
-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
For e.g. Float16
where mul!
(mat-vec) does not call BLAS, but the generic julia implementation, the resulting vector after mul!
with α, β = false, false
still contains NaN
s.
Here's a MWE:
julia> using LinearAlgebra
julia> x, A, y = fill(NaN32, 2), fill(NaN32, 2, 2), fill(NaN32, 2)
(Float32[NaN, NaN], Float32[NaN NaN; NaN NaN], Float32[NaN, NaN])
julia> mul!(y, A, x, false, false) # stops the NaN propagation
2-element Vector{Float32}:
0.0
0.0
julia> x, A, y = fill(NaN16, 2), fill(NaN16, 2, 2), fill(NaN16, 2)
(Float16[NaN, NaN], Float16[NaN NaN; NaN NaN], Float16[NaN, NaN])
julia> mul!(y, A, x, false, false) # does NOT stop the NaN's
2-element Vector{Float16}:
NaN
NaN
julia> X, A, Y = fill(NaN16, 2, 2), fill(NaN16, 2, 2), fill(NaN16, 2, 2)
(Float16[NaN NaN; NaN NaN], Float16[NaN NaN; NaN NaN], Float16[NaN NaN; NaN NaN])
julia> mul!(Y, A, X, false, false) # however, matmatmul does
2×2 Matrix{Float16}:
0.0 0.0
0.0 0.0
I tried with julia 1.11.5 and 1.12.0-beta4.
mikmoore
Metadata
Metadata
Assignees
Labels
No labels