Comments (2)
It seems that this issue didn't attention from the devs. @weiyuanlou were you able to make this work?
from quadgk.jl.
Hi,
I don't think f_int.(Zcu)
, which is solving multiple integrals in parallel, can be currently solved with QuadGK.jl. The adaptation logic in the code will not port well to the GPU.
You could attempt using quadgk!
to evaluate an inplace integrand that evaluates all of your different integrands on the GPU in an embarrasingly parallel fashion.
using CUDA
using QuadGK
Z = Array([z for z in 1:1:4]);
Zcu = CuArray([z for z in 1:1:4]);
function f_int(z_ob)
iii(z) = z_ob - z
return quadgk(z -> iii(z), 0, 1, rtol=1e-4)[1]
end
f_int.(Z) # This works
quadgk!((y, z) -> y .= Zcu .- z, similar(Zcu), 0, 1, rtol=1e-4) # try this
I haven't tested this (I don't have a gpu), and I think it should parallelize well for large Zcu
.
Now, with version 2.9 you will be able to use a BatchIntegrand
to parallelize the evaluation of a single integral. That pr (#80) should allow, for example BatchIntegrand((y, x) -> y .= f.(x), CuArray{Float64}(undef, 1000), CuVector{Float64}(undef, 1000); max_batch=1000)
. This is not embarrasingly parallel since it only parallelizes within each adaptive step
QuadGK.jl is missing support for batched+inplace integrands, which would allow for more parallelism, but it would be worth trying to see how much mileage you can get out of either of the above approaches first.
from quadgk.jl.
Related Issues (20)
- Quadrature points and weights in the intervals [0, Inf] and [-Inf, +Inf] HOT 2
- Documentation suggestion
- TagBot trigger issue HOT 13
- AD compatibility HOT 1
- How to cite QuadGK HOT 1
- Possible regression using quadgk function and Unitful limits HOT 9
- unitful infinite bounds
- order=1 seems børked HOT 1
- contour integration HOT 1
- documentation build is failing HOT 4
- Autodiff of `quadgk` HOT 2
- Can not catch a JuliaError caused by function blowing up to infinity HOT 2
- misleading error estimate for non-convergent integral (maxevals=10^7 reached) HOT 5
- QuadGK evaluates function at upper bound HOT 4
- No cachedrule for DynamicQuantities types HOT 4
- Regression with [email protected] HOT 6
- spurious underflow in kronrod for large n HOT 1
- infinite limits with units and segbuf broken
- quadgk with identical lower and upper bound is broken HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quadgk.jl.