Searching LIGO data for 20 cents a week
Updated
divyanshgolyan.com/posts/ligo-20-cents/
A full search of LIGO data costs too much to run as often or as widely as physicists would like. Some mergers may still be sitting in data already recorded. LIGO, Virgo and KAGRA used about 700 million CPU core-hours in a single year of their last observing run. So I made the search cheap. It hasn’t found anything new yet, but at this price anyone can run searches that were too expensive before.
My version searches a week of data from both LIGO detectors for about $0.20 on a rented GPU.About ₹19. PyCBC, one of LIGO’s standard pipelines, needs 182 CPU core-hours for the same search.
About ₹19.What LIGO hears
When two black holes or neutron stars spiral into each other, they stretch and squeeze space itself, and the ripple spreads out.
LIGO catches them with two L-shaped detectors, one in Hanford, Washington and one in Livingston, Louisiana, about 3,000 km apart. Each arm is 4 km long, and a laser measures its length. A passing wave stretches one arm and squeezes the other by less than a hundredth of a proton’s width.
We get the measurement as the change in length of each arm, two thousand times a second. Almost all of it is noise from the ground, the laser and the mirrors themselves. A merger is a faint pattern somewhere inside it.
The search is a giant pattern match
Physicists predict the chirp each pair of merging black holes would make. These predictions are the templates. We can slide each template across every moment of the data, looking for a fit. The fit score is the signal-to-noise ratio (SNR): how much louder the match is than noise alone would make it. Noise alone scores around 1 to 3. Real mergers score 10 to 30.
But noise sometimes fakes a fit, so the search needs to know how often. A real signal reaches both LIGO detectors within ten milliseconds.The two detectors are about 3,000 km apart, and a gravitational wave moves at the speed of light, 300,000 km a second. So the search shifts one detector’s data by a few seconds, where nothing real can line up in both, and counts the fits it still finds (false positives).
The two detectors are about 3,000 km apart, and a gravitational wave moves at the speed of light, 300,000 km a second.Every search does three things to each stretch of data:
- Clean it. The raw data has a low-pitched rumble and sudden spikes. We cut the rumble, mute the spikes and measure how noisy each pitch is.
- Search it. Slide every template across the cleaned data and score the fit at each moment.
- Check the loud fits. A glitch can score high without looking like a chirp. So for each loud fit, the search splits the template into pieces by pitch and asks whether each piece fits as well as it should. A real chirp fits evenly whereas a glitch dumps its score into one piece.A chirp slides from low pitch to high, like someone singing up a scale. A real one hits every pitch band in turn, so each band gets its share of the score. A glitch is more like one shout: loud, but at one pitch, so one band takes the whole score. A chirp slides from low pitch to high, like someone singing up a scale. A real one hits every pitch band in turn, so each band gets its share of the score. A glitch is more like one shout: loud, but at one pitch, so one band takes the whole score.
PyCBC does step 2 one template at a time, on CPUs, and that’s where its 182 core-hours go. My search cuts that cost in three changes, one per section below.
$0.52: one big matrix multiply
Step 2 is the expensive one. Sliding a template across every moment sounds slow, but a Fourier transform (FFT) does every slide at once.One slide means lining the template up at one moment, multiplying it point by point with the data and adding it up. Doing that at every moment takes trillions of steps. An FFT rewrites the data and the template as mixes of pitches, where all the slides become one multiply per pitch. Converting back gives the score at every moment. The standard way runs one FFT per template, thousands for every stretch of data.
One slide means lining the template up at one moment, multiplying it point by point with the data and adding it up. Doing that at every moment takes trillions of steps. An FFT rewrites the data and the template as mixes of pitches, where all the slides become one multiply per pitch. Converting back gives the score at every moment.Most templates look alike. Compress them with a singular value decomposition (SVD, a standard way to find the shapes a set of signals shares) and those few basic shapes can rebuild all of them, the way a JPEG stores an image in fewer bytes. The search then needs one FFT per shape instead of one per template. Rebuilding every template’s score from the shapes’ scores is one large matrix multiply, the kind of work GPUs are built for.
The multiply produces a score for every template at every moment. The standard way writes all of them out to the GPU’s memory, then reads them back in to find the best ones. That copying takes longer than the math. So I had Claude write a GPU kernel that does it all in one place: it multiplies, and while the scores are still on the chip, keeps only the best in every 128 moments (about 1/16 of a second). Only those leave the chip. It ran about 7x faster than a standard multiply plus a separate pass to find the peaks.
That brought a week to $0.52: 4.5 GPU-minutes for the search and 34 for the checks.
$0.30: exact checks only when loud
The checks ran on every fit above SNR 5, millions a week, most of them noise. But the compressed search already gives every fit a quick score, and for 99 fits in 100 it lands within 1% of the exact one. So the quiet fits keep their quick score, and only loud fits get the exact score and the glitch checks.
Each check was slow too, because it read a whole stored template from memory. I made the chip rebuild the template from a few stored points, which made the checks 11x faster. With this and a cheaper way to set up the checks, they went from 200 ms to 17.7 ms per block of 1,024 templates. This compression is different from the SVD: that one shares shapes across templates, while this one shrinks each template itself.
Together, that brought a week to $0.30. Every step was now fast, but the GPU sat idle most of the time.
$0.142: keep the GPU busy
It was waiting: for downloads, for the CPU to clean the next batch, or for files to be written. It was busy 27% of the time, and I was paying for 100%.
The biggest fix was in how weak fits are dropped. The GPU made 200 million of them per batch, then sat idle while the CPU sorted and threw most of them away. Now the GPU drops them itself, and 23 million reach the CPU. Cleaning also moved onto the GPU, taking that step from 26 seconds a piece to 3.
Why memory speed sets the cost
All three fixes cut how much data moved between the chip and memory, not how much math it did. On an A40, the big FFTs used about 5% of the card’s math power. The rest of the time, the cores waited for data from memory.
That also decides which GPU to rent: the one with the most memory speed per dollar. In my tests, an RTX 4090, a gaming card, cost 0.62 times as much per result as the A40, a data-center card. The H100 was the fastest card I tried, but it cost 3.1 times as much per result.
| Card | GB/s per $ an hour | Cost per result |
|---|---|---|
| RTX 4090 | 1,024 | 0.62x |
| A40 | 944 | 1x |
| H100 | 744 | 3.1x |
Next I checked whether the cheaper search still finds the known mergers.
Finding 99 of 101 known mergers
I ran mine over all of O4a and O4b, the 232 days in which both LIGO detectors were recording.O4a ran from 24 May 2023 to 16 January 2024, and O4b from 10 April 2024 to 28 January 2025. PyCBC found 101 mergers there with high confidence, and mine found 99 of them.
O4a ran from 24 May 2023 to 16 January 2024, and O4b from 10 April 2024 to 28 January 2025.Both misses were borderline. My search saw GW241116_151753 in both of its template sets, but running two sets costs a small penalty, and that pushed it just over 1 false alarm a year. PyCBC also had data from Virgo, the European detector, which my search leaves out. PyCBC was the only pipeline sure about GW231119_075248: GstLAL and MBTA, two other LIGO pipelines, put it at 0.5 and 1.9 false alarms a year, and mine at 6.
Nothing new, yet
It found nothing new in O4a and O4b. But O4c comes out on 16 December. At 20 cents a week, anyone can search it in ways that would cost too much with the standard pipelines.
How I measured
My cost is the steady rate. Filtering one week of data from both LIGO detectors takes 868 GPU-seconds on an Nvidia A40 at $0.59 an hour, which is $0.142; ranking and the rest bring it to about $0.20. The steps in the first figure are from my lab notes: $0.52 is the first full week, $0.30 is one day scaled to a week, and $0.142 is the steady rate. The $0.52 and $0.30 steps searched only my 4,612 standard templates; $0.142 and PyCBC’s 182 core-hours cover all 5,880, including 1,268 for oval orbits. The full O4a and O4b run cost about $11 as billed, including restarts and tests, and O4b ran at $0.26 a week because its GPUs waited on downloads. PyCBC’s 182 core-hours is measured with PyCBC 2.8.3 on an Intel Xeon Gold 6342; it agrees with the published figure in Soni & Nitz, Table 4. The hollow dot is PyCBC on a GPU, tuned well: about $0.72 a week. In my test, its GPU mode searched 16x faster, but each job got only 2x faster, because the cleaning still ran on the CPU, repeated for every slice of the templates. The projection comes from 8 PyCBC processes sharing one A40, with the repeated cleaning removed. The GPU comparison is from a kernel test, with the 4090 at RunPod’s $0.89 an hour; on O4b, an RTX 3090 at $0.19 an hour searched a week for $0.141, one machine over two weeks. “High confidence” means PyCBC’s false-alarm rate is below 1 per 100 years, from the GWOSC event pages on 29 October 2026. I used only the two LIGO detectors, not Virgo. Code, data and results are on GitHub and archived at doi:10.5281/zenodo.23761181.