r/ScientificComputing • • 17h ago

Fast GPU and CPU ensembles of ODEs and Monte Carlo samples that each stop at a different time, from plain Python

Post image
4 Upvotes

If you run many independent simulations that end at different times (an event, convergence, a step budget), array libraries make you pay for the slowest sample on every step.

With this project you write the step for one sample as a typed Python function and run a million of them. Samples that finish drop out of the work. You also get the derivatives of your step (forward and reverse mode), and arrays move without copies to and from PyTorch, CuPy, NumPy and Warp.

With a million samples in double precision, each stopping at its own step:

  • on 6 GPUs, 2.5× to 4.2× faster than an NVIDIA Warp kernel and 9.8× to 130× faster than PyTorch with torch.compile;
  • on 4 server CPUs, from level with Numba to 2.3× faster, and 50× to 180× faster than NumPy.

When every sample runs all its steps, it ties with Warp. There is also a benchmark with an adaptive RK7(8) solver.

Install on Linux x86_64 with pip install raptor-eagle raptor-hawk (add [cuda12] or [cuda13] to both for a GPU). It runs on NVIDIA GPUs or on CPU threads. Linux ARM and macOS (CPU) wheels come next.

Personal project; I work at ESA. A start-here notebook (it runs in Colab), all the benchmark files, and how to rerun them: https://amasat01.github.io


r/ScientificComputing • • 4h ago

Has anybody tested Argon on the TheoPhysEval suite?

Thumbnail
arxiv.org
3 Upvotes

I'm curious because at this point the traditional benchmarks are pretty meaningless, and this suite is a fantastic real-world use case on problems that have no published solution.


r/ScientificComputing • • 8h ago

Binary black hole inspiral simulations!

2 Upvotes

Hello, I am a black hole enthusiast high school student.

I have conducted research on calculating the eccentricity of the binary black hole inspiral phase using an N-body simulation Python library called REBOUNDx. However, upon completion of the research, I wanted to avoid relying on Python libraries to calculate the physics behind binary black holes. So I studied Newtonian physics and wrote code for the post-Newtonian corrections to make black hole inspiral simulations without the help of physics Python libraries. I have created a README that walks you through the physics behind the inspiral phase, and I hope to soon implement numerical relativity to simulate the merger phase of the binary black holes as well. I would greatly appreciate your feedback to improve my simulation! Specifically:

  1. Are there any flaws in the physics behind my simulation?
  2. Any tips for implementing numerical relativity for the merger phase?

Here is the repo: https://github.com/happyalex98/Binary-black-hole-inspiral-simulation-3.5PN-

Thank you all in advance!


r/ScientificComputing • • 6m ago

How do you approximate fractional-order memory for embedded control with bounded computational cost?

Thumbnail
• Upvotes