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

Remove dynamic call in check_args macro #1491

Closed
wants to merge 1 commit into from
Closed

Conversation

devmotion
Copy link
Member

@oschulz This PR fixes your example in #1067 (comment) for me. More concretely, I get

julia> using Distributions, CUDA

julia> Mu = cu(rand(10));

julia> Sigma = cu(rand(10));

julia> D = Normal.(Mu, Sigma)
10-element CuArray{Normal{Float32}, 1, CUDA.Mem.DeviceBuffer}:
 Normal{Float32}=0.521244f0, σ=0.21886574f0)
 Normal{Float32}=0.71777487f0, σ=0.7293551f0)
 Normal{Float32}=0.9532782f0, σ=0.64151007f0)
 Normal{Float32}=0.053326122f0, σ=0.9042364f0)
 Normal{Float32}=0.7432136f0, σ=0.8857779f0)
 Normal{Float32}=0.12811048f0, σ=0.61526275f0)
 Normal{Float32}=0.25544932f0, σ=0.8564379f0)
 Normal{Float32}=0.71731555f0, σ=0.57268643f0)
 Normal{Float32}=0.17898592f0, σ=0.40761828f0)
 Normal{Float32}=0.71395373f0, σ=0.39995775f0)

julia> X = cu(rand(10));

julia> logpdf.(D, X)
10-element CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}:
 -0.26363182
 -0.6177307
 -0.52780163
 -0.8318763
 -0.980844
 -0.451747
 -0.9199794
 -0.5523126
 -0.7440649
 -0.033901572

I don't know how to test this without GPUs though... Maybe we should add some GPU-specific tests and run them with buildkite (I got help with setting it up for OptimalTransport.jl a while ago, so I could add a similar setup here)?

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2022

Codecov Report

Merging #1491 (e98742a) into master (bdb44eb) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1491   +/-   ##
=======================================
  Coverage   84.42%   84.42%           
=======================================
  Files         124      124           
  Lines        7495     7495           
=======================================
  Hits         6328     6328           
  Misses       1167     1167           
Impacted Files Coverage Δ
src/utils.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bdb44eb...e98742a. Read the comment docs.

@oschulz
Copy link
Contributor

oschulz commented Jan 23, 2022

Thanks a lot @devmotion !

@devmotion
Copy link
Member Author

This issue will also be fixed by the changes in #1492.

@devmotion
Copy link
Member Author

I just confirmed that this was fixed by #1492 and the example works in the latest release of Distributions.

@devmotion devmotion closed this Jan 31, 2022
@devmotion devmotion deleted the dw/check_args branch January 31, 2022 18:57
@oschulz
Copy link
Contributor

oschulz commented Jan 31, 2022

Thanks @devmotion !

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

Successfully merging this pull request may close these issues.

3 participants