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

Avoid scalar indexing on GPU in init_expectations #74

Closed
guyvdbroeck opened this issue Apr 17, 2021 · 1 comment
Closed

Avoid scalar indexing on GPU in init_expectations #74

guyvdbroeck opened this issue Apr 17, 2021 · 1 comment
Assignees

Comments

@guyvdbroeck
Copy link
Member

The initializer for expectations on the GPU is doing scalar indexing on https://github.com/Juice-jl/ProbabilisticCircuits.jl/blob/fc0c3acb9f0eb54fc1a12baf62d0c427a265a16f/src/queries/expectation_bit.jl#L88
This ends up happening on the GPU if ParamBitCircuitPair is on the GPU; scalar indexing on the GPU is very slow and a bad idea! We should move the BitCircuit to CPU or keep it there when doing these scalar operations. Perhaps postpone moving BitCircuit to GPU until after the initializer is called.

@khosravipasha
Copy link
Contributor

Wrote a cuda kernel to fix this
14fbf66

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

2 participants