Comments (7)
CORDIC-like method is ~5x slower (cached table, 60 entries). Accuracy would be sufficient.
Pre-calculate table (takes negligible time):
cordic_table_size = 60
l1 = np.empty(cordic_table_size)
l2 = l1.copy()
for idx in range(cordic_table_size):
exp = np.exp2(-idx)
l1[idx] = exp
l2[idx] = np.arctan(exp)
Call function (too slow):
@jit(cache=False, nopython=True, fastmath=True)
def arctan_cordic(y, l1, l2, x=1.0):
r = 0.0
for idx in range(len(l1)):
if y < 0:
r, x, y = r - l2[idx], x - l1[idx]*y, y + l1[idx]*x
else:
r, x, y = r + l2[idx], x + l1[idx]*y, y - l1[idx]*x
return r
from pandora.
20x faster with new numpy
numpy/numpy#19478
from pandora.
New numpy with AVX512 not released yet
Will make only Intel CPUs faster (and future AMD if they get AVX512?), and currently only on Linux
Installed numpy dev from source
have to modify "setup.py" with version numbers (lines 60ff)
then pip install .
Own test for 1m linspace values artcan: 1s vs 0.2s (~5x)
In new env: numba installs (old) numpy --> install all else first, then new numpy version
Problem: numba requires version >1.17 <1.20
Can change, but is linked to github version (hard to change)(
not sure if it would break numba
easier to extract arctan source?
from pandora.
Will be released with Numpy 1.22 https://numpy.org/devdocs/release/1.22.0-notes.html
from pandora.
Can switch off numba warning in__init__.py
for ellipse_pos_iter: is hardly faster (9.18 vs 8.96)
for ellipse_pos: (10.92 8.01) vs (7.82 7.91)
from pandora.
Try CUDA https://numba.discourse.group/t/cant-use-basic-numpy-functions-with-cuda-like-zeros-or-empty/628/3
from pandora.
It takes ~0.1ms to transfer data from CPU to GPU and back, i.e. <10k models/sec even at zero model calc time
==> not worth using GPU (or only in vectorized case which is hard to implement)
from pandora.
Related Issues (20)
- Better pre-check for out of transit data HOT 1
- Make pure C version of eclipse to compare speed HOT 1
- Cornerplot: Customize and Beautify
- Introduce physical boundaries HOT 4
- Planetary mass prior in log?
- Make GPU test version with long array to examine best-case performance
- Faster Kepler equation solver for e_S>0
- Test ellipse_pos_iter_bary with .astype(np.float32) HOT 2
- Add parameter "concentric circles" for video
- change params.b_bary and others to bary
- test float32 performance HOT 1
- ecc_bary
- Nested Folding to visualize
- Analytical calculation of planet-moon occultation when >=1 body touching stellar limb
- Convergence speed mass_ratio versus separate moon mass
- Create example for injection-retrieval workflow with UltraNest
- Crash while using default example.py HOT 2
- Example: Planet-moon injection and retrieval - wrong LD conversion
- Speed issue: Lightkurve / add warning if user provides data format other than array of floats HOT 1
- Question about returned timesteps/cadence HOT 1
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 pandora.