Skip to content

hcat of many SparseVectors freezes / crashes in julia 1.9 #49887

Closed
@jtackm

Description

@jtackm

Running this toy code that concatenates a large number of sparse vectors

nsamp, notus = (8000, 2500)
vecs = [sparse(zeros(nsamp)) for i in 1:notus]
@time hcat(vecs...)

works fine in julia 1.8.2 (~5.5s runtime), but hangs for a long time in julia 1.9. If I ommit sparse, everything works correctly. In a real-world example julia usually hangs, but sometimes finishes quickly, crashes, and/or produces stack overflows like this one:

Internal error: stack overflow in type inference of _is_fixed(SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}, 
[ many repetitions ]
SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}, SparseArrays.SparseVector{Int64, Int64}).
This might be caused by recursion over very long tuples or argument lists.

My version:

julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 256 × AMD EPYC 7742 64-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver2)
  Threads: 96 on 256 virtual cores
Environment:
  JULIA_WORKER_TIMEOUT = 3600
  JULIA_LOAD_PATH = [ removed ]
  JULIA_DEPOT_PATH = [ removed ]
  LD_GOLD = [ removed ]
  JULIA_NUM_THREADS = 96

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions