This repository has been archived by the owner on Mar 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 83
Disable the GC after taking pool-related spinlocks. #693
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vchuravy
reviewed
Apr 24, 2020
This solves my test case (it doesn't lock up any more). |
vchuravy
reviewed
Apr 25, 2020
@maleadt Commit df0dc90 also solves the issue for me! But not the latest Commit 2d99e03. The deadlock still seems to happen. Here's the full stacktrace: Stacktrace:
[1] lock(::Base.Threads.SpinLock) at ./locks-mt.jl:71
[2] macro expansion at ./lock.jl:181 [inlined]
[3] free(::CUDAdrv.CuPtr{Nothing}) at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory/binned.jl:393
[4] macro expansion at /home/lpjiang97/.julia/packages/TimerOutputs/NvIUx/src/TimerOutput.jl:245 [inlined]
[5] macro expansion at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:245 [inlined]
[6] macro expansion at ./util.jl:234 [inlined]
[7] free at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:244 [inlined]
[8] _unsafe_free!(::CuArray{Float32,3,Nothing}) at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/array.jl:51
[9] unsafe_free!(::CuArray{Float32,3,Nothing}) at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/array.jl:40
[10] enable_finalizers at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:16 [inlined]
[11] macro expansion at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:23 [inlined]
[12] macro expansion at ./lock.jl:183 [inlined]
[13] alloc(::Int64) at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory/binned.jl:383
[14] macro expansion at /home/lpjiang97/.julia/packages/TimerOutputs/NvIUx/src/TimerOutput.jl:245 [inlined]
[15] macro expansion at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:196 [inlined]
[16] macro expansion at ./util.jl:234 [inlined]
[17] alloc at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/memory.jl:195 [inlined]
[18] CuArray{Float32,2,P} where P(::UndefInitializer, ::Tuple{Int64,Int64}) at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/array.jl:107
[19] similar at /home/lpjiang97/.julia/packages/CuArrays/DO2vR/src/array.jl:139 [inlined]
[20] similar at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/adjtrans.jl:197 [inlined]
[21] * at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:153 [inlined]
[22] #1285 at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/lib/array.jl:292 [inlined]
[23] (::Zygote.var"#3260#back#1287"{Zygote.var"#1285#1286"{CuArray{Float32,2,Nothing},CuArray{Float32,2,Nothing}}})(::CuArray{Float32,2,Nothing}) at /home/lpjiang97/.julia/packages/ZygoteRules/6nssF/src/adjoint.jl:49
[24] Dense at /home/lpjiang97/.julia/packages/Flux/Fj3bt/src/layers/basic.jl:122 [inlined]
[25] (::typeof(∂(invoke)))(::CuArray{Float32,2,Nothing}) at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/compiler/interface2.jl:0
[26] Dense at /home/lpjiang97/.julia/packages/Flux/Fj3bt/src/layers/basic.jl:133 [inlined]
[27] (::typeof(∂(λ)))(::CuArray{Float32,2,Nothing}) at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/compiler/interface2.jl:0
[28] #3 at /home/lpjiang97/Research/probabilistic-pc/foo/debug.jl:21 [inlined]
[29] (::typeof(∂(λ)))(::Float32) at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/compiler/interface2.jl:0
[30] (::Zygote.var"#48#49"{Zygote.Params,Zygote.Context,typeof(∂(λ))})(::Float32) at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/compiler/interface.jl:108
[31] gradient(::Function, ::Zygote.Params) at /home/lpjiang97/.julia/packages/Zygote/4tJp5/src/compiler/interface.jl:45
[32] ISTA(::CuArray{Float32,2,Nothing}, ::Dense{typeof(identity),CuArray{Float32,2,Nothing},CuArray{Float32,1,Nothing}}, ::Float64, ::Int64, ::Float64, ::Float64) at /home/lpjiang97/Research/probabilistic-pc/foo/debug.jl:20
[33] top-level scope at /home/lpjiang97/Research/probabilistic-pc/foo/debug.jl:48
[34] include(::String) at ./client.jl:439
[35] top-level scope at none:1
[36] eval(::Module, ::Any) at ./boot.jl:331
[37] exec_options(::Base.JLOptions) at ./client.jl:264
[38] _start() at ./client.jl:484 |
Co-Authored-By: Valentin Churavy <[email protected]>
Alright, another attempt. Could you test again? |
This seems to have fixed it! Thanks @maleadt ! |
Still passes my tests. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Potential fix for #685.
@denizyuret @colinxs @lpjiang97 could you try out this PR?