QuakeScope · PR #71 · 2026-10-26

Faster QuakeScope: do the picks and amplitudes change?

PR #71 proposes faster CPU code for the QuakeScope workflow (waveform loading, PhaseNet picking and amplitude measurement), found by an automated optimization tool (VibeSys). We re-ran the leaderboard's waveforms with it and compared every pick and amplitude.

Answer

fp32 keeps every pick. fp16 stays within a 30 ms tolerance; bf16 does not.

PR #71 rewrites how PhaseNet and the amplitude code run on a CPU. We re-picked the leaderboard's 26,531 picks (threshold 0.2, weight PhaseNet original, weight version 2) three ways and compared each pick with the current code's.

fp32 · what the PR uses on Fargate and Graviton

26,529 of 26,531

picks identical to the millisecond

The other 2 moved by one sample (10 ms) on a flat-topped peak. Amplitudes agree to 9e-12. Runs 5.9 to 6.6 times faster on Graviton.

fp16 · not in the PR, tested for comparison

98.7 %

picks identical

99.83 % within 30 ms; 29 picks move further (up to 420 ms). Picks gained or lost all sit at the threshold. Speed not measured.

bf16 · the PR's mode on Intel AMX CPUs only

89.3 %

picks identical

98.06 % within 30 ms; 333 picks move further (up to 480 ms) and 437 appear or disappear. No speed gain on our hardware, which has no AMX.

Against the 7,593 analyst picks, none of the three changes recall by more than 0.001 or mean absolute error by more than 1 ms, and none moves the median bias. The difference is in reproducing the catalogue, not in accuracy.

Precision

How far do the picks move?

Share of the current code's picks that each mode reproduces within a given timing tolerance, at threshold 0.2. The 30 ms line is the tolerance used on this page: analyst P picks scatter by 23 ms (Ross et al. 2018) and the current code's P picks scatter around the analysts' by 32 ms on this benchmark. Curves stop short of 100 % because of picks that appear or disappear at the threshold (0.19 % for fp16, 1.65 % for bf16, none for fp32).

Share of picks reproduced within a timing toleranceAt threshold 0.2: fp32 reaches 100 percent at 10 ms, fp16 starts at 98.7 percent, bf16 at 89.3 percent.88%90%92%94%96%98%100%0102030405060708090100timing tolerance (ms)1 sample (10 ms)tolerance used here (30 ms)PhaseNet–analyst P σ, Zhu 2019 (52 ms)fp32 100.0%fp32: 99.99% of picks within 0 msfp32: 100.00% of picks within 10 msfp32: 100.00% of picks within 20 msfp32: 100.00% of picks within 30 msfp32: 100.00% of picks within 50 msfp32: 100.00% of picks within 100 msfp16 99.9%fp16: 98.73% of picks within 0 msfp16: 99.49% of picks within 10 msfp16: 99.71% of picks within 20 msfp16: 99.83% of picks within 30 msfp16: 99.89% of picks within 50 msfp16: 99.92% of picks within 100 msbf16 99.2%bf16: 89.30% of picks within 0 msbf16: 95.31% of picks within 10 msbf16: 96.95% of picks within 20 msbf16: 98.06% of picks within 30 msbf16: 98.91% of picks within 50 msbf16: 99.20% of picks within 100 ms
modeidentical (0 ms)within 10 mswithin 30 mslargest shiftspread of shifts (σ)picks appearing or disappearing
fp3299.99 %100.00 %100.00 %10 ms0.1 ms0 / 0
fp1698.74 %99.49 %99.83 %420 ms4.7 ms16 / 34
bf1689.32 %95.31 %98.06 %480 ms11.3 ms181 / 256

For scale: the current code's own picks scatter around the analysts' with a σ (from the median absolute deviation) of 32 ms (P) and 38 ms (S) on this benchmark. bf16 adds a 11 ms scatter on top; fp16 5 ms.

Background

What fp32, fp16 and bf16 are

They are ways of storing each number inside the network. Fewer bits make the arithmetic faster on CPUs built for it, and round every intermediate value more coarsely. Think of it as digitizer resolution applied to every layer of PhaseNet.

formatbits per valuebits of precisionrounding step (relative)largest value
fp32 (single precision)3224, like a 24-bit digitizer6×10-83×1038
fp16 (half precision)16115×10-465,504
bf16 ("brain float")1684×10-33×1038

PhaseNet's output is a probability trace per phase, and a pick is the sample where it peaks above the threshold. Rounding perturbs that trace a little. Where the peak is sharp nothing happens; where it is flat the maximum can jump to a neighbouring sample, and where it sits near the threshold the pick can appear or disappear. Under bf16 the 99th percentile change in the trace's peak value is 0.045; under fp32 it is too small to measure at the 10-4 level.

Precision

Against analyst picks

Recall within 0.5 s at threshold 0.2, as on the leaderboard. Of the 7,593 analyst picks, the number whose outcome changes is 0 for fp32, 2 for fp16 and 14 for bf16.

trackphaseanalyst pickscurrent codefp32fp16bf16
US sequencesP6250.7200.7200.7200.720
US sequencesS4390.7540.7540.7540.754
swarm sequencesP3,3140.6800.6800.6800.681
swarm sequencesS3,2150.6580.6580.6590.658

Your tolerance

Choose what counts as the same pick

Starts at a 30 ms tolerance with 0.5 % of picks allowed to fail; change either. Picks that appear or disappear only because they sit just at the threshold are excused by the confidence margin.

A pick fails when it moves by more than the tolerance, or when it is lost or new and its confidence is more than the margin above the threshold. Per-pick data: errors_pr_fp32.csv.gz · errors_pr_fp16.csv.gz · errors_pr_bf16.csv.gz.

Speed

Six times faster on AWS Graviton, in fp32

The same 5.55 station-days (42 benchmark windows) processed by four workers on an 8-vCPU machine, the shape of a Fargate task. Median of four repetitions; picking and amplitudes included, S3 reads and writes not.

machinecurrent codePR, fp32fasterSpot $ per 1,000 station-days
M1 Max laptop150 s129 s1.2×–
c6g.2xlarge (Graviton2)145 s22 s6.6×$0.58 → $0.09
c7g.2xlarge (Graviton3)93 s16 s5.9×$0.38 → $0.06
c8g.2xlarge (Graviton4)77 s13 s6.1×$0.30 → $0.05

Where the time goes

Most of the saving is the Wood-Anderson amplitude code: 90 % of the time saved on Graviton4. PhaseNet itself runs 1.7× faster there. These windows are aftershock sequences with many picks; an ordinary station-day has far fewer, so the gain in a campaign will be smaller. Not yet measured.

Why the laptop gains little

The PR's fast PhaseNet needs a library (oneDNN) that no macOS build of PyTorch includes, so on an Apple laptop only the amplitude code speeds up, and picking runs 1.34× slower.

Prices: on-demand from the AWS Pricing API, cheapest-AZ Spot from describe_spot_price_history, both 2026-10-26. For comparison, Fargate Spot costs about $0.17/h for the same 8 vCPU (CloudBank billing). Fargate itself was not timed.

Details

Method, full tables, limits

What each mode runs

Current code: sbm.PhaseNet.from_pretrained("original").classify and main's AmplitudeExtractor() at 7dd1be7. fp32: PR head a5d4d43 with the settings of its removed runner (vibesys/pick_workload.py at 4271d67): BatchNorm folded into the convolutions, polyphase transposed convolutions, fast windowing (glue=fused), amplitudes impl="fused", signal="slim". bf16 and fp16: the same, with weights and inputs in 16 bits, fp32 accumulation, and every layer's output rounded to 16 bits. This emulates Intel AMX for bf16 and is a best case for fp16. Run on the M1 Max laptop.

Precision workload: 130 cached station-windows of docs/benchmark/results/{us,swarm}_sequences, 7,593 analyst picks. Picks at a 0.02 floor, thresholded afterwards, paired with benchmark_metrics.match_picks within 0.5 s. The cached waveforms for Mendocino, Monroe and San Simeon CI are not the streams the leaderboard picked, so absolute US recall differs from the board; every mode read the same files.

Picks against the current code, both thresholds
thresholdmodetrackpicksidenticalmovedlostnewp99 |shift|p99 |Δconfidence|
0.2fp32swarm sequences22,42899.996 %1000 ms0.000
0.2fp32US sequences4,10399.976 %1000 ms0.000
0.2fp16swarm sequences22,42898.863 %243122510 ms0.004
0.2fp16US sequences4,10398.050 %773810 ms0.006
0.2bf16swarm sequences22,42889.772 %2,15114320840 ms0.034
0.2bf16US sequences4,10386.863 %512273740 ms0.045
0.3fp32swarm sequences18,65299.995 %1000 ms0.000
0.3fp32US sequences3,45999.971 %1000 ms0.000
0.3fp16swarm sequences18,65298.949 %18313120 ms0.004
0.3fp16US sequences3,45998.236 %601710 ms0.005
0.3bf16swarm sequences18,65290.682 %1,6449413030 ms0.032
0.3bf16US sequences3,45987.280 %420203240 ms0.044
Every fp32 difference at the 0.02 floor (10 picks)
sequencestationphasetimeconfidence, currentconfidence, fp32side
Etna edifice 2022-2024IV.EPDNS2023-05-28 05:17:05.2300.0558–vanilla only
Etna edifice 2022-2024IV.EPDNS2023-05-28 05:17:05.240–0.0558pr_fp32 only
Jones-Guthrie 2014-2015OK.U32AP2014-07-13 02:43:48.2100.6186–vanilla only
Jones-Guthrie 2014-2015OK.U32AP2014-07-13 02:43:48.220–0.6186pr_fp32 only
Jones-Guthrie 2014-2015US.WMOKP2014-03-22 03:59:47.5200.0427–vanilla only
Maurienne 2017-2019GU.RRLP2017-10-27 01:13:23.1800.0470–vanilla only
Maurienne 2017-2019GU.RRLP2017-10-27 01:13:23.210–0.0470pr_fp32 only
Mendocino 2024BK.RBOWS2024-12-05 20:12:28.2900.4039–vanilla only
Mendocino 2024BK.RBOWS2024-12-05 20:12:28.300–0.4041pr_fp32 only
Mendocino 2024NC.KCTP2024-12-05 19:17:16.163–0.0203pr_fp32 only

Same arrival one to three samples apart with confidences equal to about 10-4. Folding BatchNorm changes the order of the fp32 sums, which moves the probability trace by about 10-6 and can flip which sample of a flat peak is the maximum.

Amplitudes
amplitudepicksstationswith a valuemissing-value pattern differsmax relative difference
Wood-Anderson13,727447,53509.4e-12
velocity13,7274413,53004.1e-12

Western US and Oklahoma stations only: EarthScope served no response for the Etna (IV) stations, and the French and most Czech stations were not measured.

Exact agreement across Graviton generations
picks identical to the msc6g currentc7g currentc8g currentc6g PRc7g PRc8g PR
c6g current10,62010,61610,62010,61910,61510,619
c7g current10,61610,62010,61610,61710,61910,617
c8g current10,62010,61610,62010,61910,61510,619
c6g PR10,61910,61710,61910,62010,61610,620
c7g PR10,61510,61910,61510,61610,62010,616
c8g PR10,61910,61710,61910,62010,61610,620

10,620 picks per run at threshold 0.2. The current code itself differs by 4 picks between Graviton2 and Graviton3, so a millisecond rule cannot hold across our own hardware even without the PR.

Timing per repetition and cost at on-demand prices
machinecodewall per repetition (s)pickingWood-Andersonvelocity
M1 Max laptopcurrent code152.1, 151.5, 149.4, 137.4322 s192 s9.3 s
M1 Max laptopPR, fp32126.5, 132.3, 129.5, 128.7432 s32 s2.8 s
c6g.2xlarge (Graviton2)current code144.8, 144.2, 144.7, 144.567 s395 s10.6 s
c6g.2xlarge (Graviton2)PR, fp3221.9, 21.8, 21.8, 21.736 s23 s2.2 s
c7g.2xlarge (Graviton3)current code93.3, 93.1, 93.1, 93.223 s268 s7.7 s
c7g.2xlarge (Graviton3)PR, fp3215.7, 15.7, 15.7, 15.725 s16 s1.9 s
c8g.2xlarge (Graviton4)current code76.6, 76.6, 76.737 s206 s6.7 s
c8g.2xlarge (Graviton4)PR, fp3212.6, 12.6, 12.6, 12.521 s12 s1.7 s

Stage times summed over the four workers.

instanceCPUon-demand $/hSpot $/hon-demand $ per 1,000 station-days, current / PR
c6g.2xlarge (Graviton2)AWS Graviton2 (Neoverse-N1)$0.272$0.0802$1.969 / $0.297
c7g.2xlarge (Graviton3)AWS Graviton3$0.289$0.0824$1.347 / $0.227
c8g.2xlarge (Graviton4)AWS Graviton4$0.318$0.0772$1.219 / $0.200
Limits and defects found in the PR
  • jma_wc, the global weight, was not scored. obs (PickBlue) cannot use the fast path: building it raises does not cover this model setup: ['padding/filter'].
  • bf16 was emulated, not run on AMX hardware. fp16 speed was not measured.
  • Streams the model resamples (30 of 130 windows) fall back to SeisBench's windowing. Timing used 100 Hz only.
  • The 707-line s3_helper.py rewrite was not reviewed.
  • veliir.c (velocity amplitudes) does not build on ARM, so SciPy ran on Graviton. Built with its x86-only CPU probe guarded, it matched SciPy to 10-11.
  • As merged, nothing selects the fast settings, so production would run the current code.
Reproduce

Harness in scripts/vibesys_pr71/; export_results.py writes the tables in docs/benchmark/results/vibesys_pr71/, and scripts/build_vibesys_report.py builds this page from them.

References

  1. Ross, Z. E., Meier, M.-A. and Hauksson, E. (2018). P wave arrival picking and first-motion polarity determination with deep learning. Journal of Geophysical Research: Solid Earth 123, 5120-5129. doi:10.1029/2017JB015251
  2. Zhu, W. and Beroza, G. C. (2019). PhaseNet: a deep-neural-network-based seismic arrival-time picking method. Geophysical Journal International 216, 261-273. doi:10.1093/gji/ggy423