Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference failure with sort(::CuMatrix) after loading MLDatasets #2258

Closed
ngphuoc opened this issue Feb 7, 2024 · 2 comments
Closed

Inference failure with sort(::CuMatrix) after loading MLDatasets #2258

ngphuoc opened this issue Feb 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ngphuoc
Copy link

ngphuoc commented Feb 7, 2024

The Minimal Working Example (MWE) for this bug:

$ julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(fortest) pkg> st
Status `~/fortest/Project.toml`
  [052768ef] CUDA v5.2.0
  [587475ba] Flux v0.14.11
  [eb30cadb] MLDatasets v0.7.14

julia> using CUDA, MLDatasets

julia> a = CUDA.rand(3, 4)
3×4 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}:
 0.281195  0.209999  0.826027  0.57313
 0.743842  0.159     0.966851  0.460495
 0.149446  0.301568  0.611666  0.0910624

julia> sort(a, dims=1)
ERROR: InvalidIRError: compiling MethodInstance for CUDA.QuickSortImpl.qsort_kernel(::CuDeviceMatrix{…}, ::Int64, ::Int64, ::Bool, ::Val{…}, ::Int64, ::Nothing, ::typeof(isless), ::typeof(identity), ::Val{…}) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to julia.new_gc_frame)
Stacktrace:
 [1] promote_typejoin
   @ ./promotion.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.push_gc_frame)
Stacktrace:
 [1] promote_typejoin
   @ ./promotion.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.pop_gc_frame)
Stacktrace:
 [1] promote_typejoin
   @ ./promotion.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] _promote_typesubtract
   @ ./promotion.jl:175
 [2] promote_typejoin
   @ ./promotion.jl:172
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to typesplit(a, b) @ Base promotion.jl:140)
Stacktrace:
 [1] _promote_typesubtract
   @ ./promotion.jl:175
 [2] promote_typejoin
   @ ./promotion.jl:172
 [3] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typesplit
   @ ./promotion.jl:142
 [2] _promote_typesubtract
   @ ./promotion.jl:175
 [3] promote_typejoin
   @ ./promotion.jl:172
 [4] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.get_gc_frame_slot)
Stacktrace:
 [1] promote_typejoin
   @ ./promotion.jl:172
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to typesplit(a, b) @ Base promotion.jl:140)
Stacktrace:
 [1] typesplit
   @ ./promotion.jl:146
 [2] _promote_typesubtract
   @ ./promotion.jl:175
 [3] promote_typejoin
   @ ./promotion.jl:172
 [4] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typesplit
   @ ./promotion.jl:146
 [2] _promote_typesubtract
   @ ./promotion.jl:175
 [3] promote_typejoin
   @ ./promotion.jl:172
 [4] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] supertype
   @ ./operators.jl:43
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.new_gc_frame)
Stacktrace:
 [1] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.push_gc_frame)
Stacktrace:
 [1] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.pop_gc_frame)
Stacktrace:
 [1] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.get_gc_frame_slot)
Stacktrace:
 [1] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f__svec_ref)
Stacktrace:
 [1] getindex
   @ ./essentials.jl:764
 [2] full_va_len
   @ ./promotion.jl:230
 [3] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.new_gc_frame)
Reason: unsupported call to an unknown function (call to julia.push_gc_frame)
Reason: unsupported call to an unknown function (call to julia.pop_gc_frame)
Reason: unsupported call to an unknown function (call to julia.get_gc_frame_slot)
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [11] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [12] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:427
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] call
    @ ./none:0
 [11] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [12] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:427
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [11] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [12] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:441
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] call
    @ ./none:0
 [11] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [12] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:441
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:29
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:31
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_type_unionall)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:34
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_type_unionall)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:36
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:49
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to length)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:50
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to length)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:51
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to ==)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:52
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:53
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:53
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to ==)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:55
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:56
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:56
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to full_va_len)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:58
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to full_va_len)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:59
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:61
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] typejoin
   @ ./promotion.jl:62
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:63
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:63
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:63
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] typejoin
   @ ./promotion.jl:66
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:67
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:67
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:71
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] typejoin
   @ ./promotion.jl:72
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:73
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:73
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:73
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] typejoin
   @ ./promotion.jl:76
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to tailjoin)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:77
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:77
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] typejoin
   @ ./promotion.jl:81
 [3] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to min)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:85
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:85
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:87
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f__apply_iterate)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:89
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:94
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:94
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:95
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:98
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:99
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:99
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:100
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:100
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:107
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:109
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to length)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:109
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to ==)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:110
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_alloc_array_1d)
Stacktrace:
 [1] Array
   @ ./boot.jl:477
 [2] Array
   @ ./boot.jl:496
 [3] vect
   @ ./array.jl:160
 [4] typejoin
   @ ./promotion.jl:113
 [5] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to Colon())
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:114
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to iterate)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:114
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to ijl_get_nth_field_checked)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:114
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getproperty)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:115
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to getindex)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:115
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:116
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:117
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to iterate)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:125
 [2] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to UnionAll)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:127
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:45
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_issubtype)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:0
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_egal__unboxed)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:95
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_egal__unboxed)
Stacktrace:
 [1] typejoin
   @ ./promotion.jl:116
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call through a literal pointer (call to ijl_array_grow_beg)
Stacktrace:
 [1] _growbeg!
   @ ./array.jl:1070
 [2] typejoin
   @ ./promotion.jl:121
 [3] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] cudacall
    @ ~/.julia/packages/CUDA/htRwP/lib/cudadrv/execution.jl:133
 [11] multiple call sites
    @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] Pairs
   @ ./essentials.jl:343
 [2] pairs
   @ ./iterators.jl:279
 [3] cudacall
   @ ~/.julia/packages/CUDA/htRwP/lib/cudadrv/execution.jl:133
 [4] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to ijl_new_structv)
Stacktrace:
 [1] Pairs
   @ ./essentials.jl:343
 [2] pairs
   @ ./iterators.jl:279
 [3] cudacall
   @ ~/.julia/packages/CUDA/htRwP/lib/cudadrv/execution.jl:133
 [4] multiple call sites
   @ unknown:0
Reason: unsupported dynamic function invocation (call to #cudacall#892)
Stacktrace:
 [1] cudacall
   @ ~/.julia/packages/CUDA/htRwP/lib/cudadrv/execution.jl:133
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
 [1] promote_typejoin
   @ ./promotion.jl:173
 [2] multiple call sites
   @ unknown:0
Reason: unsupported call to an unknown function (call to julia.new_gc_frame)
Stacktrace:
 [1] qsort_kernel
   @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to julia.push_gc_frame)
Stacktrace:
 [1] qsort_kernel
   @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to julia.pop_gc_frame)
Stacktrace:
 [1] qsort_kernel
   @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to julia.get_gc_frame_slot)
Stacktrace:
 [1] qsort_kernel
   @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [11] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [12] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:427
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] call
    @ ./none:0
 [11] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [12] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:427
 [14] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [11] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [12] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:441
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Reason: unsupported call to an unknown function (call to jl_f_apply_type)
Stacktrace:
  [1] promote_typejoin
    @ ./promotion.jl:173
  [2] #54
    @ ./tuple.jl:235
  [3] afoldl
    @ ./operators.jl:544
  [4] _compute_eltype
    @ ./tuple.jl:231
  [5] eltype
    @ ./tuple.jl:211
  [6] nteltype
    @ ./namedtuple.jl:239
  [7] eltype
    @ ./namedtuple.jl:237
  [8] Pairs
    @ ./essentials.jl:343
  [9] pairs
    @ ./iterators.jl:279
 [10] call
    @ ./none:0
 [11] DeviceKernel
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:422
 [12] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:96
 [13] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:441
 [14] qsort_kernel
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:378
Hint: catch this exception as `err` and call `code_typed(err; interactive = true)` to introspect the erronous code with Cthulhu.jl
Stacktrace:
  [1] check_ir(job::GPUCompiler.CompilerJob{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}, args::LLVM.Module)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/validation.jl:147
  [2] macro expansion
    @ ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:440 [inlined]
  [3] macro expansion
    @ ~/.julia/packages/TimerOutputs/RsWnF/src/TimerOutput.jl:253 [inlined]
  [4] macro expansion
    @ ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:439 [inlined]
  [5]
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/utils.jl:92
  [6] emit_llvm
    @ ~/.julia/packages/GPUCompiler/U36Ed/src/utils.jl:86 [inlined]
  [7]
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:129
  [8] codegen
    @ ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:110 [inlined]
  [9]
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:106
 [10] compile
    @ ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:98 [inlined]
 [11] #1072
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/compilation.jl:247 [inlined]
 [12] JuliaContext(f::CUDA.var"#1072#1075"{GPUCompiler.CompilerJob{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:47
 [13] compile(job::GPUCompiler.CompilerJob)
    @ CUDA ~/.julia/packages/CUDA/htRwP/src/compiler/compilation.jl:246
 [14] actual_compilation(cache::Dict{…}, src::Core.MethodInstance, world::UInt64, cfg::GPUCompiler.CompilerConfig{…}, compiler::typeof(CUDA.compile), linker::typeof(CUDA.link))
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/execution.jl:125
 [15] cached_compilation(cache::Dict{…}, src::Core.MethodInstance, cfg::GPUCompiler.CompilerConfig{…}, compiler::Function, linker::Function)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/execution.jl:103
 [16] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:367 [inlined]
 [17] macro expansion
    @ ./lock.jl:267 [inlined]
 [18] cufunction(f::typeof(CUDA.QuickSortImpl.qsort_kernel), tt::Type{Tuple{…}}; kwargs::@Kwargs{})
    @ CUDA ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:362
 [19] cufunction(f::typeof(CUDA.QuickSortImpl.qsort_kernel), tt::Type{Tuple{…}})
    @ CUDA ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:359
 [20] macro expansion
    @ ~/.julia/packages/CUDA/htRwP/src/compiler/execution.jl:112 [inlined]
 [21] quicksort!(c::CuArray{…}; lt::typeof(isless), by::typeof(identity), dims::Int64, partial_k::Nothing, block_size_shift::Int64)
    @ CUDA.QuickSortImpl ~/.julia/packages/CUDA/htRwP/src/sorting.jl:475
 [22] sort!(c::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}; dims::Int64, lt::Function, by::Function, rev::Bool)
    @ CUDA ~/.julia/packages/CUDA/htRwP/src/sorting.jl:947
 [23] sort!
    @ ~/.julia/packages/CUDA/htRwP/src/sorting.jl:941 [inlined]
 [24] sort(c::CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}; kwargs::@Kwargs{dims::Int64})
    @ CUDA ~/.julia/packages/CUDA/htRwP/src/sorting.jl:952
 [25] top-level scope
    @ REPL[4]:1
 [26] top-level scope
    @ ~/.julia/packages/CUDA/htRwP/src/initialization.jl:206
Some type information was truncated. Use `show(err)` to see complete types.
@ngphuoc ngphuoc added the bug Something isn't working label Feb 7, 2024
@maleadt maleadt changed the title Mysterious error when sorting 2D CuArray which only happens when using MLDatasets Inference failure with sort(::CuMatrix) after loading MLDatasets Feb 13, 2024
@maleadt
Copy link
Member

maleadt commented Feb 13, 2024

So it's just loading MLDatasets that causes this? Reminds me of #1508. These kinds of issues, where method definitions impact inference quality, are fairly hard to address here.

@maleadt
Copy link
Member

maleadt commented Dec 3, 2024

Let's close this in favor of #1508.

@maleadt maleadt closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants