Skip to content

LLVM 18 / Julia 1.12: Invalid vectorization leads to ptxas error #3036

@maleadt

Description

@maleadt

MWE:

julia> kron(adjoint(CuArray(rand(Complex{Int16}, 32, 64))), adjoint(CuArray(rand(Complex{Int16}, 128, 16))))
ERROR: Failed to compile PTX code (ptxas exited with code 255)
Invocation arguments: --generate-line-info --verbose --gpu-name sm_120 --output-file /tmp/jl_A7CvIrOtW5.cubin /tmp/jl_KlexYHAjwJ.ptx
ptxas /tmp/jl_KlexYHAjwJ.ptx, line 336; error   : Unexpected instruction types specified for 'sub'
ptxas fatal   : Ptx assembly aborted due to errors

This because LLVM emits sub.s16x2 %r18, %r16, %r17; which doesn't exist.
Fixed in LLVM 19 by llvm/llvm-project@2089596

Not easy to work around since this is LLVM vectorizing things:

  %49 = insertelement <2 x i16> <i16 poison, i16 0>, i16 %40, i64 0
  %50 = insertelement <2 x i16> poison, i16 %41, i64 0
  %51 = insertelement <2 x i16> %50, i16 %44, i64 1
  %52 = sub <2 x i16> %49, %51

Metadata

Metadata

Assignees

No one assigned

    Labels

    cuda kernelsStuff about writing CUDA kernels.upstreamSomebody else's problem.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions