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

three CUDA.@atomic in a row result in out-of-bounds error #1254

Closed
bjarthur opened this issue Nov 30, 2021 · 3 comments
Closed

three CUDA.@atomic in a row result in out-of-bounds error #1254

bjarthur opened this issue Nov 30, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@bjarthur
Copy link
Contributor

bjarthur commented Nov 30, 2021

but only on a 1080Ti. works fine on an A100. if i delete one of them, it also works. a minimum broken example would take some time to write. wanted to inquire whether this is a known issue before i investigate further. kernel as it is now looks like this:

function kernel(bspike,
                w0Index, w0Weights, forwardInputsE, forwardInputsI,
                wpIndexOut, wpWeightOut, forwardInputsP)
    i = threadIdx().x + (blockIdx().x - 1) * blockDim().x
    j = threadIdx().y + (blockIdx().y - 1) * blockDim().y

    if bspike[j]
        if i<=size(w0Index,1)
            CUDA.@atomic forwardInputsE[0x1 + w0Index[i,j]] += max(w0Weights[i,j], 0)
            CUDA.@atomic forwardInputsI[0x1 + w0Index[i,j]] += min(w0Weights[i,j], 0)
        end
        if i<=size(wpIndexOut,1)
            CUDA.@atomic forwardInputsP[0x1 + wpIndexOut[i,j]] += wpWeightOut[i,j]
        end
    end
    return nothing
end

this is with julia 1.7-rc2, CUDA.jl 3.5.0, and CUDA 11.2 for the 1080Ti and 11.4 for the A100. thanks.

@bjarthur bjarthur added the bug Something isn't working label Nov 30, 2021
@bjarthur
Copy link
Contributor Author

oh, and it works on a 2080Ti too with 11.4. so maybe it's just broken for 11.2??

@maleadt
Copy link
Member

maleadt commented Nov 30, 2021

Define 'broken'? Please include at least a stack trace or compiler error. Generally this would require a MWE, I don't see what shouldn't work about multiple @atomic invocations.

@bjarthur
Copy link
Contributor Author

bjarthur commented Dec 1, 2021

i can't reproduce now. sorry. will re-open if/when i can.

@bjarthur bjarthur closed this as completed Dec 1, 2021
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