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

type-piracy of materialize #504

Open
vtjnash opened this issue Apr 18, 2023 · 1 comment
Open

type-piracy of materialize #504

vtjnash opened this issue Apr 18, 2023 · 1 comment

Comments

@vtjnash
Copy link

vtjnash commented Apr 18, 2023

Looking at the SnoopCompile report, this is pirating the materialize function, causing latency problems after loading this package:

 [1] materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(NNlib.relu), <:Tuple{CUDA.CuArray{<:Union{Float16, Float32, Float64}}}})
     @ NNlibCUDA ~/.julia/packages/NNlibCUDA/C6t0p/src/cudnn/activations.jl:28
 [2] materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(NNlib.elu), <:Tuple{CUDA.CuArray{<:Union{Float16, Float32, Float64}}}})
     @ NNlibCUDA ~/.julia/packages/NNlibCUDA/C6t0p/src/cudnn/activations.jl:28
 [3] materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(NNlib.σ), <:Tuple{CUDA.CuArray{<:Union{Float16, Float32, Float64}}}})
     @ NNlibCUDA ~/.julia/packages/NNlibCUDA/C6t0p/src/cudnn/activations.jl:28
 [4] materialize(bc::Base.Broadcast.Broadcasted{<:Any, <:Any, typeof(tanh), <:Tuple{CUDA.CuArray{<:Union{Float16, Float32, Float64}}}})
     @ NNlibCUDA ~/.julia/packages/NNlibCUDA/C6t0p/src/cudnn/activations.jl:28

But if we look at the docs, the function for overloading is broadcasted instead:
https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting

@ToucheSir
Copy link
Member

Thanks for the report. I've been wanting to remove those overloads for a while, but never got around to them because (to my knowledge) none of the benchmarking in #509 ever happened...

@CarloLucibello CarloLucibello transferred this issue from FluxML/NNlibCUDA.jl Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants