Of course. Here it is:
julia> gradient(() -> loss_fn(predict(x_gpu, model_gpu), y_gpu))# Fails
ERROR: CUDA error: unspecified launch failure (code 719, ERROR_LAUNCH_FAILED)
Stacktrace:
[1] throw_api_error(res::CUDA.cudaError_enum)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/error.jl:91
[2] isdone
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/stream.jl:109 [inlined]
[3] nonblocking_synchronize
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/stream.jl:139 [inlined]
[4] (::CUDA.var"#217#218"{Float32, CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, Int64, Vector{Float32}, Int64, Int64})()
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:388
[5] #context!#63
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/state.jl:164 [inlined]
[6] context!
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/state.jl:161 [inlined]
[7] unsafe_copyto!(dest::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, doffs::Int64, src::Vector{Float32}, soffs::Int64, n::Int64)
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:384
[8] copyto!
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:342 [inlined]
[9] copyto!
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:346 [inlined]
[10] CuArray
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:288 [inlined]
[11] adjoint
@ ~/.julia/packages/Zygote/H6vD3/src/lib/broadcast.jl:275 [inlined]
[12] _pullback
@ ~/.julia/packages/ZygoteRules/AIbCs/src/adjoint.jl:65 [inlined]
[13] _pullback
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:535 [inlined]
[14] _pullback
@ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:42 [inlined]
[15] _pullback
@ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:40 [inlined]
[16] _pullback (repeats 2 times)
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:545 [inlined]
[17] _pullback
@ ~/.julia/packages/Flux/qAdFM/src/functor.jl:97 [inlined]
[18] _pullback
@ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:42 [inlined]
[19] _pullback
@ ~/.julia/packages/Adapt/wASZA/src/Adapt.jl:40 [inlined]
[20] _pullback
@ ~/.julia/packages/Flux/qAdFM/src/functor.jl:177 [inlined]
[21] _pullback
@ ~/.julia/packages/Functors/qBIlC/src/functor.jl:50 [inlined]
[22] _pullback(::Zygote.Context, ::Functors.var"##fmap#17", ::typeof(Flux._isbitsarray), ::typeof(Functors._default_walk), ::IdDict{Any, Any}, ::Functors.NoKeyword, ::typeof(fmap), ::Flux.var"#138#139", ::Vector{Float64})
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface2.jl:0
[23] _pullback
@ ~/.julia/packages/Functors/qBIlC/src/functor.jl:49 [inlined]
[24] _pullback(::Zygote.Context, ::Functors.var"#fmap##kw", ::WARNING: Error while freeing DeviceBuffer(104 bytes at 0x0000000302006c00):
CUDA.CuError(code=CUDA.cudaError_enum(0x000002cf), meta=nothing)
Stacktrace:
[1] throw_api_error(res::CUDA.cudaError_enum)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/error.jl:91
[2] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/error.jl:101 [inlined]
[3] cuMemFreeAsync(dptr::CUDA.Mem.DeviceBuffer, hStream::CuStream)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/utils/call.jl:26
[4] #free#2
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/memory.jl:97 [inlined]
[5] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:58 [inlined]
[6] macro expansion
@ ./timing.jl:299 [inlined]
[7] #actual_free#189
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:57 [inlined]
[8] #_free#207
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:375 [inlined]
[9] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:340 [inlined]
[10] macro expansion
@ ./timing.jl:299 [inlined]
[11] #free#206
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:339 [inlined]
[12] #212
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:79 [inlined]
[13] context!(f::CUDA.var"#212#213"{CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, CuStream}, ctx::CuContext; skip_destroyed::Bool)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/state.jl:164
[14] unsafe_free!(xs::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, stream::CuStream)
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:78
[15] unsafe_finalize!(xs::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer})
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:99
[16] show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar})
@ Base ./show.jl:640
[17] show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar})
@ Base ./show.jl:1011
[18] show_datatype
@ ./show.jl:989 [inlined]
[19] _show_type(io::IOContext{IOBuffer}, x::Type)
@ Base ./show.jl:889
[20] show(io::IOContext{IOBuffer}, x::Type)
@ Base ./show.jl:881
[21] sprint(f::Function, args::Type; context::IOContext{Base.TTY}, sizehint::Int64)
@ Base ./strings/io.jl:112
[22] print_type_stacktrace(io::IOContext{Base.TTY}, type::Type; color::Symbol)
@ Base ./show.jl:2399
[23] print_type_stacktrace(io::IOContext{Base.TTY}, type::Type)
@ Base ./show.jl:2399
[24] show_tuple_as_call(io::IOContext{Base.TTY}, name::Symbol, sig::Type; demangle::Bool, kwargs::Nothing, argnames::Vector{Symbol}, qualified::Bool, hasfirst::Bool)
@ Base ./show.jl:2380
[25] show_spec_linfo(io::IOContext{Base.TTY}, frame::Base.StackTraces.StackFrame)
@ Base.StackTraces ./stacktraces.jl:244
[26] print_stackframe(io::IOContext{Base.TTY}, i::Int64, frame::Base.StackTraces.StackFrame, n::Int64, digit_align_width::Int64, modulecolor::Symbol)
@ Base ./errorshow.jl:709
[27] print_stackframe(io::IOContext{Base.TTY}, i::Int64, frame::Base.StackTraces.StackFrame, n::Int64, digit_align_width::Int64, modulecolordict::IdDict{Module, Symbol}, modulecolorcycler::Base.Iterators.Stateful{Base.Iterators.Cycle{Vector{Symbol}}, Union{Nothing, Tuple{Symbol, Int64}}})
@ Base ./errorshow.jl:685
[28] show_full_backtrace(io::IOContext{Base.TTY}, trace::Vector{Any}; print_linebreaks::Bool)
@ Base ./errorshow.jl:574
[29] show_backtrace(io::IOContext{Base.TTY}, t::Vector{Base.StackTraces.StackFrame})
@ Base ./errorshow.jl:769
[30] showerror(io::IOContext{Base.TTY}, ex::CuError, bt::Vector{Base.StackTraces.StackFrame}; backtrace::Bool)
@ Base ./errorshow.jl:90
[31] showerror(io::IOContext{Base.TTY}, ex::CuError, bt::Vector{Base.StackTraces.StackFrame})
@ Base ./errorshow.jl:87
[32] display_repl_error(io::Base.TTY, stack::VSCodeServer.EvalErrorStack)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:173
[33] #invokelatest#2
@ ./essentials.jl:716 [inlined]
[34] invokelatest
@ ./essentials.jl:714 [inlined]
[35] display_error(io::Base.TTY, err::VSCodeServer.EvalErrorStack)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:319
[36] (::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:170
[37] withpath(f::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:184
[38] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:153
[39] hideprompt(f::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:36
[40] (::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:124
[41] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:511
[42] with_logger
@ ./logging.jl:623 [inlined]
[43] (::VSCodeServer.var"#62#66"{VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:201
[44] #invokelatest#2
@ ./essentials.jl:716 [inlined]
[45] invokelatest(::Any)
@ Base ./essentials.jl:714
[46] macro expansion
@ ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
[47] (::VSCodeServer.var"#60#61")()
@ VSCodeServer ./task.jl:423
WARNING: Error while freeing DeviceBuffer(104 bytes at 0x0000000302006000):
CUDA.CuError(code=CUDA.cudaError_enum(0x000002cf), meta=nothing)
Stacktrace:
[1] throw_api_error(res::CUDA.cudaError_enum)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/error.jl:91
[2] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/error.jl:101 [inlined]
[3] cuMemFreeAsync(dptr::CUDA.Mem.DeviceBuffer, hStream::CuStream)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/utils/call.jl:26
[4] #free#2
@ ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/memory.jl:97 [inlined]
[5] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:58 [inlined]
[6] macro expansion
@ ./timing.jl:299 [inlined]
[7] #actual_free#189
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:57 [inlined]
[8] #_free#207
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:375 [inlined]
[9] macro expansion
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:340 [inlined]
[10] macro expansion
@ ./timing.jl:299 [inlined]
[11] #free#206
@ ~/.julia/packages/CUDA/5jdFl/src/pool.jl:339 [inlined]
[12] #212
@ ~/.julia/packages/CUDA/5jdFl/src/array.jl:79 [inlined]
[13] context!(f::CUDA.var"#212#213"{CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, CuStream}, ctx::CuContext; skip_destroyed::Bool)
@ CUDA ~/.julia/packages/CUDA/5jdFl/lib/cudadrv/state.jl:164
[14] unsafe_free!(xs::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, stream::CuStream)
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:78
[15] unsafe_finalize!(xs::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer})
@ CUDA ~/.julia/packages/CUDA/5jdFl/src/array.jl:99
[16] show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar})
@ Base ./show.jl:640
[17] show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar})
@ Base ./show.jl:1011
[18] show_datatype
@ ./show.jl:989 [inlined]
[19] _show_type(io::IOContext{IOBuffer}, x::Type)
@ Base ./show.jl:889
[20] show(io::IOContext{IOBuffer}, x::Type)
@ Base ./show.jl:881
[21] sprint(f::Function, args::Type; context::IOContext{Base.TTY}, sizehint::Int64)
@ Base ./strings/io.jl:112
[22] print_type_stacktrace(io::IOContext{Base.TTY}, type::Type; color::Symbol)
@ Base ./show.jl:2399
[23] print_type_stacktrace(io::IOContext{Base.TTY}, type::Type)
@ Base ./show.jl:2399
[24] show_tuple_as_call(io::IOContext{Base.TTY}, name::Symbol, sig::Type; demangle::Bool, kwargs::Nothing, argnames::Vector{Symbol}, qualified::Bool, hasfirst::Bool)
@ Base ./show.jl:2380
[25] show_spec_linfo(io::IOContext{Base.TTY}, frame::Base.StackTraces.StackFrame)
@ Base.StackTraces ./stacktraces.jl:244
[26] print_stackframe(io::IOContext{Base.TTY}, i::Int64, frame::Base.StackTraces.StackFrame, n::Int64, digit_align_width::Int64, modulecolor::Symbol)
@ Base ./errorshow.jl:709
[27] print_stackframe(io::IOContext{Base.TTY}, i::Int64, frame::Base.StackTraces.StackFrame, n::Int64, digit_align_width::Int64, modulecolordict::IdDict{Module, Symbol}, modulecolorcycler::Base.Iterators.Stateful{Base.Iterators.Cycle{Vector{Symbol}}, Union{Nothing, Tuple{Symbol, Int64}}})
@ Base ./errorshow.jl:685
[28] show_full_backtrace(io::IOContext{Base.TTY}, trace::Vector{Any}; print_linebreaks::Bool)
@ Base ./errorshow.jl:574
[29] show_backtrace(io::IOContext{Base.TTY}, t::Vector{Base.StackTraces.StackFrame})
@ Base ./errorshow.jl:769
[30] showerror(io::IOContext{Base.TTY}, ex::CuError, bt::Vector{Base.StackTraces.StackFrame}; backtrace::Bool)
@ Base ./errorshow.jl:90
[31] showerror(io::IOContext{Base.TTY}, ex::CuError, bt::Vector{Base.StackTraces.StackFrame})
@ Base ./errorshow.jl:87
[32] display_repl_error(io::Base.TTY, stack::VSCodeServer.EvalErrorStack)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:173
[33] #invokelatest#2
@ ./essentials.jl:716 [inlined]
[34] invokelatest
@ ./essentials.jl:714 [inlined]
[35] display_error(io::Base.TTY, err::VSCodeServer.EvalErrorStack)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:319
[36] (::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:170
[37] withpath(f::VSCodeServer.var"#65#69"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:184
[38] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:153
[39] hideprompt(f::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/repl.jl:36
[40] (::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:124
[41] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:511
[42] with_logger
@ ./logging.jl:623 [inlined]
[43] (::VSCodeServer.var"#62#66"{VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:201
[44] #invokelatest#2
@ ./essentials.jl:716 [inlined]
[45] invokelatest(::Any)
@ Base ./essentials.jl:714
[46] macro expansion
@ ~/.vscode/extensions/julialang.language-julia-1.6.15/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
[47] (::VSCodeServer.var"#60#61")()
@ VSCodeServer ./task.jl:423
NamedTuple{(:exclude,), Tuple{typeof(Flux._isbitsarray)}}, ::typeof(fmap), ::Flux.var"#138#139", ::Vector{Float64})
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface2.jl:0
[25] _pullback
@ ~/.julia/packages/Flux/qAdFM/src/functor.jl:177 [inlined]
[26] _pullback
@ ./operators.jl:966 [inlined]
[27] _pullback(::Zygote.Context, ::typeof(|>), ::Vector{Float64}, ::typeof(gpu))
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface2.jl:0
[28] _pullback
@ ~/Documents/julia_tutorial/minimal_repro_ex.jl:39 [inlined]
[29] _pullback(::Zygote.Context, ::typeof(predict), ::Flux.OneHotArray{UInt32, 26, 1, 2, CuArray{UInt32, 1, CUDA.Mem.DeviceBuffer}}, ::Model)
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface2.jl:0
[30] _pullback
@ ~/Documents/julia_tutorial/minimal_repro_ex.jl:57 [inlined]
[31] _pullback(::Zygote.Context, ::var"#12#13")
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface2.jl:0
[32] _pullback(::Function)
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface.jl:34
[33] pullback(::Function)
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface.jl:40
[34] gradient(::Function)
@ Zygote ~/.julia/packages/Zygote/H6vD3/src/compiler/interface.jl:75
[35] top-level scope
@ ~/Documents/julia_tutorial/minimal_repro_ex.jl:57