Skip to content

kron doesn't support Diagonals #668

Closed

Description

@kshyatt

Right now only full matrices are supported, and to pass in a Diagonal you have to convert it to a full dense array with diagm. Some additional special cases here would be great.

Activity

  1. shreyas-omkar commented on Feb 22, 2026

    @shreyas-omkar
    Member

    Hi @kshyatt , I was trying to call kron(Diagonal(ROCArray), Diagonal(ROCArray)) with allowscalar(false) on my RX9060XT (gfx1200) GPU, it crashes with a HIPError and poisons the entire GPU context, so nothing GPU-related works until you restart Julia.

    **System**
    - GPU: AMD Radeon RX 9060 XT (gfx1100)
    - VRAM: 16 GiB
    - Julia: 1.12.1
    - AMDGPU.jl: v2.2.1
    - ROCm: 7.8.0
    - Julia: 1.12.1
    
    **Reproducer**
    
    using AMDGPU
    using LinearAlgebra
    
    AMDGPU.allowscalar(false)
    
    n = 512
    d = Diagonal(ROCArray(rand(Float32, n)))  # hangs here
    
    

    Is this something which is specific to RDNA4 as even or is this actually a bug worth creating an issue?

  2. added
    arraysThe array abstraction: broadcasting, mapreduce, indexing, views, generic linear algebra.
    and removed on Oct 19, 2026
  3. maleadt commented on Oct 19, 2026

    @maleadt
    Member

    Fixed by #690, which added kron/kron! for GPU-backed Diagonal with Diagonal and dense matrices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arraysThe array abstraction: broadcasting, mapreduce, indexing, views, generic linear algebra.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions