JuliaLinearAlgebra/ArrayLayouts.jl

Use of internal caches broken on 1.7 (and 1.6 soon)

vchuravy opened this issue · 6 comments

For context: JuliaLang/julia#42309

Helium all electron: Error During Test at /home/runner/work/DFTK.jl/DFTK.jl/test/helium_all_electron.jl:5
  Got exception outside of a @test
  UndefVarError: Abuf not defined
  Stacktrace:
    [1] tiled_blasmul!(tile_size::Int64, α::Float64, A::Matrix{ComplexF64}, B::SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, Base.OneTo{Int64}}, false}, β::Float64, C::SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false})
      @ ArrayLayouts ~/.julia/packages/ArrayLayouts/O51Gr/src/muladd.jl:101
    [2] materialize!(M::ArrayLayouts.MulAdd{ArrayLayouts.DenseColumnMajor, ArrayLayouts.ColumnMajor, ArrayLayouts.ColumnMajor, Float64, Matrix{ComplexF64}, SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, Base.OneTo{Int64}}, false}, SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false}})
      @ ArrayLayouts ~/.julia/packages/ArrayLayouts/O51Gr/src/muladd.jl:247
    [3] muladd!(α::Float64, A::Matrix{ComplexF64}, B::SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, Base.OneTo{Int64}}, false}, β::Float64, C::SubArray{ComplexF64, 2, Matrix{ComplexF64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false})
      @ ArrayLayouts ~/.julia/packages/ArrayLayouts/O51Gr/src/muladd.jl:70

Is this broken in tests? I’ve been testing on Julia v1.7 without issue so far. So if it’s not being triggered by the tests is there a MWE?

Simple reproducer extracted from the test case in DFTK mentioned by @vchuravy:

using BlockArrays
X = randn(ComplexF64, 8, 4)
Y = mortar((randn(8, 2), randn(8, 2)))
YX = Y'X
mul!(X, Y, YX, -1.0, 1.0)

Currently works fine on v1.6, but fails on v1.7.

Thanks @mfherbst for posting the reproducer.

I've removed this from the 1.6 backport branch since we try to be quite conservative there, even with internals like this.

MWE

        X = randn(ComplexF64, 8, 4)
        Y = randn(8, 2)
        mul(Y',X)

Thanks!