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

scatter!() on CuArrays now triggers scalar operations #298

Closed
dfdx opened this issue Mar 15, 2021 · 3 comments
Closed

scatter!() on CuArrays now triggers scalar operations #298

dfdx opened this issue Mar 15, 2021 · 3 comments

Comments

@dfdx
Copy link
Contributor

dfdx commented Mar 15, 2021

MWE:

using NNlib   # v0.7.17
using CUDA

CUDA.allowscalar(false)

scatter!(+, cu(rand(5)), cu([2.0]), cu([1]))
# ==> ERROR: scalar getindex is disallowed

Note that this works in ScatterNNlib (destination slightly modified to conform to older API):

ScatterNNlib.scatter_add!(cu(rand(5, 1)), cu([2.0]), cu([1]))
# ==> ok

From the recent PRs I see that only the generic (i.e. CPU) version of scatter!() is implemented. Is the CUDA version implemented somewhere, planned or is explicitly unsupported?

cc: @yuehhua

@ToucheSir
Copy link
Member

#296?

@yuehhua
Copy link
Member

yuehhua commented Mar 16, 2021

As you see, we are currently migrating functionality of ScatterNNlib.jl to NNlib.jl. scatter!() for generic use is merged, while for cuda is WIP. scatter!(), scatter(), gather!() and gather() will be supported for CPU and CUDA, as well as their AD in the future.

@dfdx
Copy link
Contributor Author

dfdx commented Mar 16, 2021

Perfect, thank you!

@dfdx dfdx closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants