Comments (10)
.... indeed as I'm writing this it occured to me that ForwardDiff will probably get very good performance:
[ Info: And with FOrwardDiff
14.570 ns (0 allocations: 0 bytes)
from interpolations.jl.
Could you provide the code that generated the benchmark?
from interpolations.jl.
trying to reduce it to a short script, the weirdest thing happened:
using Interpolations, ForwardDiff
rr = range(0.0, stop=5.0, length=10_000)
spl = cubic_spline_interpolation(rr, sin.(rr))
r = rand() * 5
print("Evaluation: "); @btime $spl($r)
print(" gradient1: "); @btime Interpolations.gradient1($spl, $r)
print(" Dual: "); @btime $spl(ForwardDiff.Dual($r, 1))
rr = range(0.0, stop=5.0, length=10_000)
spl = cubic_spline_interpolation(rr, sin.(rr))
r = rand() * 5
@btime $spl($r)
@btime Interpolations.gradient1($spl, $r)
@btime $spl(ForwardDiff.Dual($r, 1))
produces output
Evaluation: 8.717 ns (0 allocations: 0 bytes)
gradient1: 12.345 ns (0 allocations: 0 bytes)
Dual: 15.030 ns (0 allocations: 0 bytes)
8.717 ns (0 allocations: 0 bytes)
56.682 ns (0 allocations: 0 bytes)
15.030 ns (0 allocations: 0 bytes)
Most likely a problem with benchmarking and not with Interpolations.jl
, please close this if you agree.
from interpolations.jl.
Try running with @benchmark
to get more statistics.
from interpolations.jl.
with @benchmark
the discrepancy does not occur. If you agree, we close this and I file an issue with BenchmarkTools
from interpolations.jl.
That is intriguing. How so?
@btime
reports the fastest time. @benchmark
obviously provides more statistics. Perhaps more autodiff is occurring on the first run than the second run?
from interpolations.jl.
that would not explain it. The weird time is already the second run.
from interpolations.jl.
Is the weird time the faster time?
from interpolations.jl.
No - the slow time. The fast time is consistent with what I'm expecting to see.
from interpolations.jl.
I cannot reproduce in latest versions.
from interpolations.jl.
Related Issues (20)
- Documentation hard for me to understand HOT 3
- Cubic spline interpolation HOT 1
- Precompilation warnings HOT 3
- Documentation: what exactly is meant by "irregular grid"? HOT 1
- NaturalNeighbours.jl HOT 1
- `BoundsError` with Julia 1.10.0-beta1 HOT 2
- Interpolating 2D non-uniform Data HOT 1
- Interpolate a set of points HOT 1
- issue to remove
- Free(OnGrid()) boundary conditions produce surprising results HOT 4
- Documentation on GPU support HOT 6
- Interpolation bug when calling without extrapolate HOT 2
- CITATION.cff not generating options
- RFC: possible rework of element type and inferrability HOT 2
- Running examples in docs fails HOT 4
- Setup jldoctest
- Stable docs is pointing to 0.14.7 HOT 1
- Use abbreviated show methods HOT 1
- If raster contains a single NaN Linear() works but Cubic() returns all NaNs HOT 2
- Cubic spline interpolation for Vector Type x
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 interpolations.jl.