|
fastlowess-cpp
High-performance LOWESS smoothing
|
These measurements compare the R binding and Rust GPU backend; they are shared reference results, not separately measured timings for each binding. Timings depend on hardware, drivers, thread availability, and workload; crossover points are observations from this run, not universal thresholds.
The plot and table use mean CPU timings. Parentheses show speedup relative to stats::lowess; values above 1 indicate faster execution than R.
| Scenario | stats::lowess | rfastlowess (serial) | rfastlowess (parallel) |
|---|---|---|---|
| clustered | 2.34 ms | 2.15 ms (1.1×) | 1.07 ms (2.2×) |
| constant_y | 1.62 ms | 2.12 ms (0.8×) | 0.76 ms (2.1×) |
| extreme_outliers | 6.34 ms | 6.35 ms (1.0×) | 2.91 ms (2.2×) |
| financial_1000 | 0.26 ms | 0.22 ms (1.2×) | 0.22 ms (1.2×) |
| financial_500 | 0.22 ms | 0.14 ms (1.6×) | 0.15 ms (1.5×) |
| financial_5000 | 1.12 ms | 0.92 ms (1.2×) | 0.79 ms (1.4×) |
| fraction_0.05 | 0.97 ms | 0.76 ms (1.3×) | 0.93 ms (1.1×) |
| fraction_0.1 | 1.67 ms | 1.39 ms (1.2×) | 1.05 ms (1.6×) |
| fraction_0.2 | 2.58 ms | 2.28 ms (1.1×) | 1.20 ms (2.1×) |
| fraction_0.3 | 3.65 ms | 3.20 ms (1.1×) | 1.28 ms (2.9×) |
| fraction_0.5 | 4.97 ms | 4.98 ms (1.0×) | 1.87 ms (2.7×) |
| fraction_0.67 | 6.07 ms | 6.73 ms (0.9×) | 1.84 ms (3.3×) |
| genomic_1000 | 0.23 ms | 0.28 ms (0.8×) | 0.34 ms (0.7×) |
| genomic_100000 | 32.71 ms | 25.84 ms (1.3×) | 8.76 ms (3.7×) |
| genomic_5000 | 1.42 ms | 1.57 ms (0.9×) | 1.10 ms (1.3×) |
| high_noise | 8.01 ms | 7.46 ms (1.1×) | 2.33 ms (3.4×) |
| iterations_0 | 0.48 ms | 0.50 ms (1.0×) | 0.36 ms (1.3×) |
| iterations_1 | 1.31 ms | 1.47 ms (0.9×) | 0.60 ms (2.2×) |
| iterations_10 | 7.29 ms | 5.96 ms (1.2×) | 2.63 ms (2.8×) |
| iterations_2 | 1.95 ms | 2.09 ms (0.9×) | 1.07 ms (1.8×) |
| iterations_3 | 2.57 ms | 2.19 ms (1.2×) | 1.10 ms (2.3×) |
| iterations_5 | 3.37 ms | 3.33 ms (1.0×) | 1.62 ms (2.1×) |
| large_delta_0 | 10 067.77 ms | 5 279.61 ms (1.9×) | 1 434.48 ms (7.0×) |
| large_delta_0.1 | 11.90 ms | 12.68 ms (0.9×) | 5.05 ms (2.4×) |
| large_high_fraction | 9 434.85 ms | 4 940.71 ms (1.9×) | 1 216.33 ms (7.8×) |
| large_high_iter | 31 189.44 ms | 14 409.17 ms (2.2×) | 4 475.26 ms (7.0×) |
| scale_1000 | 0.38 ms | 0.36 ms (1.1×) | 0.35 ms (1.1×) |
| scale_10000 | 2.69 ms | 2.59 ms (1.0×) | 1.51 ms (1.8×) |
| scale_5000 | 1.82 ms | 1.43 ms (1.3×) | 0.99 ms (1.8×) |
| scientific_1000 | 0.42 ms | 0.60 ms (0.7×) | 0.50 ms (0.8×) |
| scientific_500 | 0.29 ms | 0.25 ms (1.2×) | 0.30 ms (1.0×) |
| scientific_5000 | 1.92 ms | 1.88 ms (1.0×) | 1.35 ms (1.4×) |
At small sizes, fixed per-call overhead can dominate, and parallel execution is not always faster. The large wide-window workload reaches 7.8× parallel speedup; the high-iteration workload reaches 2.2× serial speedup. Allowing default delta reduces the reference workload from approximately 10.07 s to 11.90 ms.
The first measured input size where GPU median time is below CPU-parallel median time:
| Fraction | 0 robustness iterations | 3 robustness iterations |
|---|---|---|
| 0.1 | 50 000 | 50 000 |
| 0.3 | 50 000 | 50 000 |
| 0.5 | 25 000 | 25 000 |
Selected median timings, with GPU speedup defined as CPU-parallel time divided by GPU time:
| n | Fraction | Iterations | CPU-parallel | GPU | GPU speedup |
|---|---|---|---|---|---|
| 10 000 | 0.5 | 3 | 4.66 ms | 6.31 ms | 0.74× |
| 50 000 | 0.5 | 0 | 7.69 ms | 2.64 ms | 2.92× |
| 100 000 | 0.5 | 3 | 52.40 ms | 24.62 ms | 2.13× |
| 250 000 | 0.3 | 3 | 96.33 ms | 49.14 ms | 1.96× |
| 1 000 000 | 0.5 | 3 | 1 118.35 ms | 236.47 ms | 4.73× |
The GPU is slower for the selected 10 000-point case, but approximately 4.7× faster for the million-point case. Wider windows increase per-query work and can make GPU execution worthwhile at smaller input sizes.
The crossover is the first sampled GPU win, not a guarantee that every larger input favors the GPU. At fraction 0.1, CPU wins again at 100K for both iteration counts.
Recorded wall-clock timings for the complete Rust GPU workload:
| n | Mean | Median | Minimum | Maximum |
|---|---|---|---|---|
| 1 000 | 6.091 ms | 6.512 ms | 4.710 ms | 7.170 ms |
| 5 000 | 5.162 ms | 5.136 ms | 4.344 ms | 5.957 ms |
| 10 000 | 6.548 ms | 6.606 ms | 4.904 ms | 8.548 ms |
| 50 000 | 7.565 ms | 7.376 ms | 7.172 ms | 8.352 ms |
| 100 000 | 14.170 ms | 14.396 ms | 12.213 ms | 16.029 ms |
| 500 000 | 63.544 ms | 63.831 ms | 61.600 ms | 64.527 ms |
| 1 000 000 | 141.224 ms | 141.413 ms | 137.718 ms | 143.109 ms |
Small workloads have a substantial fixed setup cost. Beyond those sizes, runtime grows with the amount of fitting work.
Mean transfer latencies and effective bandwidth from the isolated transfer benchmark. Round-trip bandwidth uses the combined uploaded/downloaded bytes divided by mean round-trip time:
Transfer measurements used an Intel Arc 140V integrated GPU (16 GB) with the Vulkan backend.
| n | Upload | Download | Round trip | Effective bandwidth |
|---|---|---|---|---|
| 1 000 | 0.361 ms | 0.399 ms | 0.760 ms | 0.026 GB/s |
| 5 000 | 0.404 ms | 0.403 ms | 0.807 ms | 0.124 GB/s |
| 10 000 | 0.440 ms | 0.506 ms | 0.946 ms | 0.212 GB/s |
| 50 000 | 0.426 ms | 0.326 ms | 0.751 ms | 1.331 GB/s |
| 100 000 | 0.730 ms | 0.853 ms | 1.583 ms | 1.263 GB/s |
| 500 000 | 1.922 ms | 2.212 ms | 4.134 ms | 2.419 GB/s |
| 1 000 000 | 3.662 ms | 4.295 ms | 7.957 ms | 2.514 GB/s |
Fixed transfer latency dominates the smaller buffers; effective bandwidth reaches approximately 2.5 GB/s for the largest recorded transfer. These measurements isolate transfer operations, so they should not be subtracted directly from timings collected by a different fit benchmark.
The transfer-fraction report uses rfastlowess_parallel.json, which is a CPU reference, not an end-to-end GPU measurement. Its 216.4% fraction and negative kernel time are therefore not valid GPU timing results and are omitted here.